102 for(i=0; i<max_nNodes_;++i)
fNeur_1.cut[i] = 0;
104 for(i=0; i<max_nLayers_;++i)
fNeur_1.neuron[i] = 0;
106 for(i=0; i<max_nLayers_*max_nNodes_*max_nNodes_;++i)
fNeur_1.w[i] = 0;
108 for(i=0; i<max_nLayers_*max_nNodes_;++i)
fNeur_1.x[i] = 0;
133 for(i=0; i<max_nVar_;++i)
fVarn_1.xmax[i] = 0;
151 printf(
"*** CFMlpANN_f2c: Warning in Train_nn: number of training + testing" \
152 " events exceeds hardcoded maximum - reset to maximum allowed number");
153 *ntrain = *ntrain*(
max_Events_/(*ntrain + *ntest));
157 printf(
"*** CFMlpANN_f2c: ERROR in Train_nn: number of variables" \
158 " exceeds hardcoded maximum ==> abort");
162 printf(
"*** CFMlpANN_f2c: Warning in Train_nn: number of layers" \
163 " exceeds hardcoded maximum - reset to maximum allowed number");
167 printf(
"*** CFMlpANN_f2c: Warning in Train_nn: number of nodes" \
168 " exceeds hardcoded maximum - reset to maximum allowed number");
179 Entree_new(nvar2, det, ntrain, ntest, nlayer, nodes, ncycle, (
Int_t)20);
204 Int_t rewrite, i__, j, ncoef;
205 Int_t ntemp, num, retrain;
225 printf(
"Error: number of layers exceeds maximum: %i, %i ==> abort",
227 Arret(
"modification of mlpl3_param_lim.inc is needed ");
246 printf(
"Error: number of learning events exceeds maximum: %i, %i ==> abort",
248 Arret(
"modification of mlpl3_param_lim.inc is needed ");
251 printf(
"Error: number of testing events exceeds maximum: %i, %i ==> abort",
253 Arret(
"modification of mlpl3_param_lim.inc is needed ");
256 for (j = 1; j <= i__1; ++j) {
261 if (j ==
fParam_1.layerm && num != 2) {
267 for (j = 1; j <= i__1; ++j) {
268 ULog() <<
kINFO <<
"Number of layers for neuron(" << j <<
"): " <<
fNeur_1.neuron[j - 1] <<
Endl;
271 printf(
"Error: wrong number of classes at ouput layer: %i != 2 ==> abort\n",
276 for (j = 1; j <= i__1; ++j) {
280 for (j = 1; j <= i__1; ++j) {
287 printf(
"Big troubles !!! \n" );
288 Arret(
"new training or continued one !");
294 printf(
"%s: New training will be continued from a weight file\n",
fg_MethodName);
309 Arret(
" entree error code 1 : need to reported");
312 Arret(
"entree error code 2 : need to reported");
316 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 317 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 322 Int_t i__1, i__2, i__3;
327 for (layer = 2; layer <= i__1; ++layer) {
328 i__2 =
fNeur_1.neuron[layer - 2];
329 for (i__ = 1; i__ <= i__2; ++i__) {
330 i__3 =
fNeur_1.neuron[layer - 1];
331 for (j = 1; j <= i__3; ++j) {
332 w_ref(layer, j, i__) = (
Sen3a() * 2. - 1.) * .2;
342 #define xeev_ref(a_1,a_2) fVarn2_1(a_1,a_2) 343 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 344 #define x_ref(a_1,a_2) fNeur_1.x[(a_2)*max_nLayers_ + a_1 - 7] 345 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 346 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 351 Int_t i__1, i__2, i__3;
358 for (i__ = 1; i__ <= i__1; ++i__) {
362 for (layer = 1; layer <= i__1; ++layer) {
364 for (j = 1; j <= i__2; ++j) {
365 x_ref(layer + 1, j) = 0.;
366 i__3 =
fNeur_1.neuron[layer - 1];
367 for (i__ = 1; i__ <= i__3; ++i__) {
369 *
w_ref(layer + 1, j, i__) );
385 #define xeev_ref(a_1,a_2) fVarn2_1(a_1,a_2) 398 for (k = 1; k <= i__1; ++k) {
402 for (i__ = 1; i__ <= i__1; ++i__) {
407 for (i__ = 1; i__ <= i__1; ++i__) {
409 xpg, &
fVarn_1.nclass[i__ - 1], &ikend);
417 for (j = 1; j <= i__2; ++j) {
422 for (k = 1; k <= i__2; ++k) {
423 if (
fVarn_1.nclass[i__ - 1] == k) {
429 for (k = 1; k <= i__2; ++k) {
441 for (k = 1; k <= i__2; ++k) {
443 for (l = 1; l <= i__1; ++
l) {
444 if (nocla[k - 1] != nocla[l - 1]) {
451 for (i__ = 1; i__ <= i__1; ++i__) {
453 for (l = 1; l <= i__2; ++
l) {
470 #define delw_ref(a_1,a_2,a_3) fDel_1.delw[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 471 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 472 #define x_ref(a_1,a_2) fNeur_1.x[(a_2)*max_nLayers_ + a_1 - 7] 473 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 474 #define delta_ref(a_1,a_2,a_3) fDel_1.delta[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 475 #define delww_ref(a_1,a_2) fDel_1.delww[(a_2)*max_nLayers_ + a_1 - 7] 476 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 477 #define del_ref(a_1,a_2) fDel_1.del[(a_2)*max_nLayers_ + a_1 - 7] 478 #define deltaww_ref(a_1,a_2) fNeur_1.deltaww[(a_2)*max_nLayers_ + a_1 - 7] 483 Int_t i__1, i__2, i__3;
490 for (i__ = 1; i__ <= i__1; ++i__) {
491 if (
fVarn_1.nclass[*ievent - 1] == i__) {
500 for (i__ = 1; i__ <= i__1; ++i__) {
502 df = (f + 1.) * (1. -
f) / (
fDel_1.temp[l - 1] * 2.);
507 for (j = 1; j <= i__2; ++j) {
513 for (l =
fParam_1.layerm - 1; l >= 2; --l) {
515 for (i__ = 1; i__ <= i__2; ++i__) {
518 for (k = 1; k <= i__1; ++k) {
522 df = (f + 1.) * (1. -
f) / (
fDel_1.temp[l - 1] * 2.);
526 for (j = 1; j <= i__1; ++j) {
533 for (l = 2; l <= i__1; ++
l) {
535 for (i__ = 1; i__ <= i__2; ++i__) {
540 for (j = 1; j <= i__3; ++j) {
559 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 560 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 566 if (*iii == *maxcycle) {
574 #define delta_ref(a_1,a_2,a_3) fDel_1.delta[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 575 #define deltaww_ref(a_1,a_2) fNeur_1.deltaww[(a_2)*max_nLayers_ + a_1 - 7] 580 Int_t i__1, i__2, i__3;
583 Int_t nevod, layer, ktest, i1, nrest;
589 Lecev2(&ktest, tout2, tin2);
591 printf(
" .... strange to be here (1) ... \n");
595 for (layer = 1; layer <= i__1; ++layer) {
597 for (j = 1; j <= i__2; ++j) {
599 i__3 =
fNeur_1.neuron[layer - 1];
600 for (i__ = 1; i__ <= i__3; ++i__) {
614 Int_t num = i__3/100;
616 for (i1 = 1; i1 <= i__3; ++i1) {
618 if ( ( num>0 && (i1-1)%num == 0) || (i1 == i__3) ) timer.
DrawProgressBar( i1-1 );
621 for (i__ = 1; i__ <= i__2; ++i__) {
682 printf(
"Error: number of layers exceeds maximum: %i, %i ==> abort",
684 Arret(
"modification of mlpl3_param_lim.inc is needed ");
688 printf(
"Error: number of training events exceeds maximum: %i, %i ==> abort",
690 Arret(
"modification of mlpl3_param_lim.inc is needed ");
693 printf(
"Error: number of testing events exceeds maximum: %i, %i ==> abort",
695 Arret(
"modification of mlpl3_param_lim.inc is needed ");
699 printf(
"Error: wrong number of classes at ouput layer: %i != %i ==> abort\n",
701 Arret(
"problem needs to reported ");
705 printf(
"Error: number of variables exceeds maximum: %i, %i ==> abort",
707 Arret(
"modification of mlpl3_param_lim.inc is needed");
710 for (i__ = 1; i__ <= i__1; ++i__) {
713 printf(
"Error: number of neurons at layer exceeds maximum: %i, %i ==> abort",
718 printf(
" .... strange to be here (2) ... \n");
723 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 736 for (i__ = 1; i__ <= i__1; ++i__) {
739 for (j = 1; j <= i__2; ++j) {
740 if (
fVarn_1.nclass[i__ - 1] == j) {
748 c__ +=
fDel_1.coef[j - 1] * (d__1 * d__1);
758 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 759 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 766 Int_t jmax, k, layer, kk, nq, nr;
771 for (layer = 1; layer <= i__1; ++layer) {
772 nq =
fNeur_1.neuron[layer] / 10;
773 nr =
fNeur_1.neuron[layer] - nq * 10;
781 for (k = 1; k <= i__2; ++k) {
784 if (
fNeur_1.neuron[layer] < jmax) {
805 ret_val = aaa * (
Double_t) (*i__) + bbb;
809 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 833 for (i__ = 1; i__ <= i__1; ++i__) {
840 for (i__ = 1; i__ <= i__1; ++i__) {
843 for (j = 1; j <= i__2; ++j) {
845 if (
fVarn_1.nclass[i__ - 1] == j) {
861 for (j = 1; j <= i__1; ++j) {
862 xmok[j - 1] /= (
Double_t) nok[j - 1];
863 xmko[j - 1] /= (
Double_t) nko[j - 1];
864 fNeur_1.cut[j - 1] = (xmok[j - 1] + xmko[j - 1]) / 2.;
884 static Int_t fg_i1 = 3823;
885 static Int_t fg_i2 = 4006;
886 static Int_t fg_i3 = 2903;
889 Int_t k3, l3, k2, l2, k1, l1;
894 k2 = fg_i2 * j3 + fg_i3 * j2 + l3;
896 k1 = fg_i1 * j3 + fg_i2 * j2 + fg_i3 * j1 + l2;
898 fg_i1 = k1 - l1 * m12;
899 fg_i2 = k2 - l2 * m12;
900 fg_i3 = k3 - l3 * m12;
911 if (*u /
fDel_1.temp[*i__ - 1] > 170.) {
912 *f = .99999999989999999;
914 else if (*u /
fDel_1.temp[*i__ - 1] < -170.) {
915 *f = -.99999999989999999;
919 *f = (1. - yy) / (yy + 1.);
925 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 938 for (i__ = 1; i__ <= i__1; ++i__) {
941 for (j = 1; j <= i__2; ++j) {
942 if (
fVarn_1.mclass[i__ - 1] == j) {
950 c__ +=
fDel_1.coef[j - 1] * (d__1 * d__1);
959 #define xx_ref(a_1,a_2) fVarn3_1(a_1,a_2) 982 for (i__ = 1; i__ <= i__1; ++i__) {
984 xpg, &
fVarn_1.mclass[i__ - 1], &ikend);
991 for (j = 1; j <= i__2; ++j) {
992 xx_ref(i__, j) = xpg[j - 1];
997 for (i__ = 1; i__ <= i__1; ++i__) {
999 for (l = 1; l <= i__2; ++
l) {
1016 #define w_ref(a_1,a_2,a_3) fNeur_1.w[((a_3)*max_nNodes_ + (a_2))*max_nLayers_ + a_1 - 187] 1017 #define x_ref(a_1,a_2) fNeur_1.x[(a_2)*max_nLayers_ + a_1 - 7] 1018 #define y_ref(a_1,a_2) fNeur_1.y[(a_2)*max_nLayers_ + a_1 - 7] 1019 #define ww_ref(a_1,a_2) fNeur_1.ww[(a_2)*max_nLayers_ + a_1 - 7] 1020 #define xx_ref(a_1,a_2) fVarn3_1(a_1,a_2) 1025 Int_t i__1, i__2, i__3;
1032 for (i__ = 1; i__ <= i__1; ++i__) {
1036 for (layer = 1; layer <= i__1; ++layer) {
1038 for (j = 1; j <= i__2; ++j) {
1039 x_ref(layer + 1, j) = 0.;
1040 i__3 =
fNeur_1.neuron[layer - 1];
1041 for (i__ = 1; i__ <= i__3; ++i__) {
1043 *
w_ref(layer + 1, j, i__);
void Foncf(Int_t *i__, Double_t *u, Double_t *f)
struct TMVA::MethodCFMlpANN_Utils::@183 fDel_1
#define w_ref(a_1, a_2, a_3)
MsgLogger & Endl(MsgLogger &ml)
static const Int_t fg_max_nVar_
Double_t Fdecroi(Int_t *i__)
#define del_ref(a_1, a_2)
void Entree_new(Int_t *, char *, Int_t *ntrain, Int_t *ntest, Int_t *numlayer, Int_t *nodes, Int_t *numcycle, Int_t)
void DrawProgressBar(Int_t, const TString &comment="")
draws progress bar in color or B&W caution:
virtual Int_t DataInterface(Double_t *, Double_t *, Int_t *, Int_t *, Int_t *, Int_t *, Double_t *, Int_t *, Int_t *)=0
void En_avant(Int_t *ievent)
void Cout(Int_t *, Double_t *xxx)
void Out(Int_t *iii, Int_t *maxcycle)
void En_arriere(Int_t *ievent)
#define xeev_ref(a_1, a_2)
void Cout2(Int_t *, Double_t *yyy)
void GraphNN(Int_t *ilearn, Double_t *, Double_t *, char *, Int_t)
void Train_nn(Double_t *tin2, Double_t *tout2, Int_t *ntrain, Int_t *ntest, Int_t *nvar2, Int_t *nlayer, Int_t *nodes, Int_t *ncycle)
struct TMVA::MethodCFMlpANN_Utils::@184 fCost_1
#define delta_ref(a_1, a_2, a_3)
struct TMVA::MethodCFMlpANN_Utils::@182 fNeur_1
void Leclearn(Int_t *ktest, Double_t *tout2, Double_t *tin2)
void En_avant2(Int_t *ievent)
void Create(Int_t nevt, Int_t nvar)
void Lecev2(Int_t *ktest, Double_t *tout2, Double_t *tin2)
static const Int_t fg_max_nNodes_
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
void Innit(char *det, Double_t *tout2, Double_t *tin2, Int_t)
void Arret(const char *mot)
class TMVA::MethodCFMlpANN_Utils::VARn2 fVarn3_1
double f2(const double *x)
class TMVA::MethodCFMlpANN_Utils::VARn2 fVarn2_1
struct TMVA::MethodCFMlpANN_Utils::@181 fVarn_1
#define delw_ref(a_1, a_2, a_3)
virtual ~MethodCFMlpANN_Utils()
struct TMVA::MethodCFMlpANN_Utils::@180 fParam_1
void CollectVar(Int_t *nvar, Int_t *class__, Double_t *xpg)
#define deltaww_ref(a_1, a_2)
#define delww_ref(a_1, a_2)
static const char *const fg_MethodName