35 #ifndef ROOT_TMVA_MethodCFMlpANN_Utils
36 #define ROOT_TMVA_MethodCFMlpANN_Utils
54 class MethodCFMlpANN_Utils {
58 MethodCFMlpANN_Utils();
59 virtual ~MethodCFMlpANN_Utils();
63 void Train_nn( Double_t *tin2, Double_t *tout2, Int_t *ntrain,
64 Int_t *ntest, Int_t *nvar2, Int_t *nlayer,
65 Int_t *nodes, Int_t *ncycle );
67 void Entree_new( Int_t *,
char *, Int_t *ntrain, Int_t *ntest,
68 Int_t *numlayer, Int_t *nodes, Int_t *numcycle,
71 virtual Int_t DataInterface( Double_t*, Double_t*, Int_t*, Int_t*, Int_t*, Int_t*,
72 Double_t*, Int_t*, Int_t* ) = 0;
74 Double_t Fdecroi(Int_t *i__);
78 void En_avant (Int_t *ievent);
79 void En_avant2 (Int_t *ievent);
80 void En_arriere(Int_t *ievent);
81 void Leclearn (Int_t *ktest, Double_t *tout2, Double_t *tin2);
82 void Out (Int_t *iii, Int_t *maxcycle);
83 void Cout (Int_t *, Double_t *xxx);
84 void Innit (
char *det, Double_t *tout2, Double_t *tin2, Int_t );
87 void GraphNN (Int_t *ilearn, Double_t *, Double_t *,
char *, Int_t);
88 void Foncf (Int_t *i__, Double_t *u, Double_t *f);
89 void Cout2 (Int_t * , Double_t *yyy);
90 void Lecev2 (Int_t *ktest, Double_t *tout2, Double_t *tin2);
91 void Arret (
const char* mot );
92 void CollectVar(Int_t *nvar, Int_t *class__, Double_t *xpg);
98 static const Int_t fg_max_nVar_;
99 static const Int_t fg_max_nNodes_;
101 static const char*
const fg_MethodName;
103 Double_t W_ref(
const Double_t wNN[], Int_t a_1, Int_t a_2, Int_t a_3)
const {
104 return wNN [(a_3*max_nNodes_ + a_2)*max_nLayers_ + a_1 - 187];
106 Double_t& W_ref(Double_t wNN[], Int_t a_1, Int_t a_2, Int_t a_3) {
107 return wNN [((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187];
110 Double_t Ww_ref(
const Double_t wwNN[], Int_t a_1,Int_t a_2)
const {
111 return wwNN[(a_2)*max_nLayers_ + a_1 - 7];
113 Double_t& Ww_ref(Double_t wwNN[], Int_t a_1,Int_t a_2) {
114 return wwNN[(a_2)*max_nLayers_ + a_1 - 7];
119 Double_t epsmin, epsmax, eeps, eta;
120 Int_t layerm, lclass, nevl, nblearn, nunilec, nunisor, nunishort, nunap;
121 Int_t nvar, itest, ndiv, ichoi, ndivis, nevt;
126 Double_t xmax[max_nVar_], xmin[max_nVar_];
127 Int_t nclass[max_Events_], mclass[max_Events_], iclass;
133 VARn2() : fNevt(0), fNvar(0) {
139 void Create( Int_t nevt, Int_t nvar ) {
140 fNevt = nevt+1; fNvar = nvar+1;
141 fxx =
new Double_t*[fNevt];
142 for (Int_t i=0; i<fNevt; i++) fxx[i] =
new Double_t[fNvar];
144 Double_t operator=( Double_t val ) {
return val; }
145 Double_t &operator()( Int_t ievt, Int_t ivar )
const {
146 if (0 != fxx && ievt < fNevt && ivar < fNvar)
return fxx[ievt][ivar];
148 printf(
"*** ERROR in varn3_(): fxx is zero pointer ==> abort ***\n") ;
153 void Delete(
void ) {
154 if (0 != fxx)
for (Int_t i=0; i<fNevt; i++)
if (0 != fxx[i])
delete [] fxx[i];
162 } fVarn2_1, fVarn3_1;
166 Double_t x[max_nLayers_*max_nNodes_];
167 Double_t y[max_nLayers_*max_nNodes_];
168 Double_t o[max_nNodes_];
169 Double_t w[max_nLayers_*max_nNodes_*max_nNodes_];
170 Double_t ww[max_nLayers_*max_nNodes_];
171 Double_t cut[max_nNodes_];
172 Double_t deltaww[max_nLayers_*max_nNodes_];
173 Int_t neuron[max_nLayers_];
178 Double_t coef[max_nNodes_], temp[max_nLayers_], demin, demax;
179 Double_t del[max_nLayers_*max_nNodes_];
180 Double_t delw[max_nLayers_*max_nNodes_*max_nNodes_];
181 Double_t delta[max_nLayers_*max_nNodes_*max_nNodes_];
182 Double_t delww[max_nLayers_*max_nNodes_];
188 Double_t ancout, tolcou;
192 void SetLogger(MsgLogger *l) { fLogger = l; }
196 MsgLogger& ULog() {
if (fLogger)
return *fLogger;
return *(fLogger =
new MsgLogger(
"CFMLP_Utils")); }
200 ClassDef(MethodCFMlpANN_Utils,0);