test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Erl_mlp.h
Go to the documentation of this file.
1 #ifndef ERL_MLP_H_
2 #define ERL_MLP_H_
3 #include <cmath>
4 #include <iostream>
5 namespace pftools {
6 
7 #define THISALGORITHMBECOMINGSKYNETCOST = 9999;
8 
9 class Erl_mlp {
10 public:
11  Erl_mlp();
12 
13  virtual ~Erl_mlp();
14 
15  void setOffsetAndSlope(const double offset, const double slope) {
16  offset_ = offset;
17  slope_ = slope;
18  }
19 
20  double evaluate(const double t1 = 0.0, const double t2 = 0.0,
21  const double t3 = 0.0, const double t4 = 0.0,
22  const double t5 = 0.0, const double t6 = 0.0, const double t7 = 0.0) {
23  t1_ = t1;
24  t2_ = t2;
25  t3_ = t3;
26  t4_ = t4;
27  t5_ = t5;
28  t6_ = t6;
29  t7_ = t7;
30 
31  return output();
32  }
33 
34  double ecalFraction(const double t1 = 0.0, const double t2 = 0.0,
35  const double t3 = 0.0, const double t4 = 0.0,
36  const double t5 = 0.0, const double t6 = 0.0, const double t7 = 0.0) {
37  t1_ = t1;
38  t2_ = t2;
39  t3_ = t3;
40  t4_ = t4;
41  t5_ = t5;
42  t6_ = t6;
43  t7_ = t7;
44 
45  return ecalOutput();
46  }
47 
48 private:
49  double t1_, t2_, t3_, t4_, t5_, t6_, t7_;
50  double offset_, slope_;
51 
52  inline double transform(const double k) {
53  return tanh(k);
54  //return k/2.0;
55  }
56 
57  double output() {
58  return ((80 * neuron_01190()) - offset_) / slope_;
59  //return 0;
60  }
61 
62  double ecalOutput() {
63  return neuron_01200() * 8.0/5.0;
64  }
65 
66  double neuron_01190() { return 5.06272330366805203838e-02 * neuron_01110() + 7.27249962994314103071e-02 * neuron_01100() + 6.87531379353593874448e-01 * neuron_01090() + 5.90999649535358523300e-02 * neuron_01170() + 5.11852363238117641364e-02 * neuron_01160() + 4.49943694412880193512e-02 * neuron_01150() + 4.07425660324388025368e-02 * neuron_01140() + 3.93358734274708785050e-02 * neuron_01130() + 4.19854685691317813800e-02 * neuron_01120(); }
67  double neuron_01200() { return 2.45908500608800761889e-01 * neuron_01110() + 2.87953657915926142241e-01 * neuron_01100() + 1.12104946100116772967e-01 * neuron_01090() + -2.48512814545735039040e-01 * neuron_01170() + -1.73640293653000848950e-01 * neuron_01160() + -9.57729315919204349239e-02 * neuron_01150() + -1.34634120232926899480e-02 * neuron_01140() + 7.33600499895466356959e-02 * neuron_01130() + 1.62882613167782547281e-01 * neuron_01120(); }
68 
69  //Hidden layer: <0.118.0>
70  double neuron_01090() { return transform(1.77006431112942702599e-01 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + 2.14497710612496367277e-01 * neuron_01050() + 1.43625191299545074131e+00 * neuron_01040() + 1.35895192827592214968e+00 * neuron_01030() + 3.42315251134937381661e-01 * neuron_01020() + 2.12812599023514514851e-01 * neuron_01010()) ; }
71  double neuron_01100() { return transform(2.43335108048174653117e-02 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -1.54265303752188047415e-02 * neuron_01050() + 5.31887393676174879964e-01 * neuron_01040() + 1.29700229375154463263e+00 * neuron_01030() + -2.51855201382369053853e-01 * neuron_01020() + -5.06439475438290737097e-02 * neuron_01010()) ; }
72  double neuron_01110() { return transform(2.26240107787991917565e-02 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -5.41830867221511913723e-02 * neuron_01050() + 5.34848607670024622784e-01 * neuron_01040() + 1.31149902444579002925e+00 * neuron_01030() + -2.64338982863860205708e-01 * neuron_01020() + -4.06486696831378502281e-02 * neuron_01010()) ; }
73  double neuron_01120() { return transform(3.53971299195493110945e-02 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -8.37804537629018991618e-02 * neuron_01050() + 6.07782495555854840319e-01 * neuron_01040() + 1.18563130862724230852e+00 * neuron_01030() + -2.68121286212209153366e-01 * neuron_01020() + -6.12015780590782140780e-02 * neuron_01010()) ; }
74  double neuron_01130() { return transform(5.69937856406597387338e-02 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -1.00016140981091974926e-01 * neuron_01050() + 7.03662421839865714901e-01 * neuron_01040() + 9.52968317012650611986e-01 * neuron_01030() + -2.73076926608740555569e-01 * neuron_01020() + -7.68552378252462947694e-02 * neuron_01010()) ; }
75  double neuron_01140() { return transform(8.30357728126230598686e-02 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -1.03499741661745067733e-01 * neuron_01050() + 8.06348739275546733118e-01 * neuron_01040() + 6.38758549749190884803e-01 * neuron_01030() + -2.80508796980343866334e-01 * neuron_01020() + -7.87991143999155069233e-02 * neuron_01010()) ; }
76  double neuron_01150() { return transform(1.09487813610100057082e-01 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -9.70768580095677652286e-02 * neuron_01050() + 9.10591921032660733815e-01 * neuron_01040() + 2.66241721261271546695e-01 * neuron_01030() + -2.89724454229762784507e-01 * neuron_01020() + -6.80058450136514086592e-02 * neuron_01010()) ; }
77  double neuron_01160() { return transform(1.32909925381862498162e-01 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -8.45644764303960794205e-02 * neuron_01050() + 1.01870729141489779757e+00 * neuron_01040() + -1.39709767812830482070e-01 * neuron_01030() + -3.01085409364046208136e-01 * neuron_01020() + -4.85758323472233188856e-02 * neuron_01010()) ; }
78  double neuron_01170() { return transform(1.50514730336528679278e-01 * neuron_01070() + 2.00000000000000011102e-01 * neuron_01060() + -7.16821794819610530469e-02 * neuron_01050() + 1.14442797677888430385e+00 * neuron_01040() + -5.53609997511943840998e-01 * neuron_01030() + -3.18164032162814081062e-01 * neuron_01020() + -2.52943742434275434250e-02 * neuron_01010()) ; }
79 
80  //Input layer: <0.108.0>
81  double neuron_01010() { return t1_; }
82  double neuron_01020() { return t2_; }
83  double neuron_01030() { return t3_; }
84  double neuron_01040() { return t4_; }
85  double neuron_01050() { return t5_; }
86  double neuron_01060() { return t6_; }
87  double neuron_01070() { return t7_; }
88 };
89 }
90 
91 #endif /*ERL_MLP_H_*/
double neuron_01190()
Definition: Erl_mlp.h:66
double neuron_01010()
Definition: Erl_mlp.h:81
double offset_
Definition: Erl_mlp.h:50
double t7_
Definition: Erl_mlp.h:49
double neuron_01170()
Definition: Erl_mlp.h:78
double output()
Definition: Erl_mlp.h:57
double t1_
Definition: Erl_mlp.h:49
static const double slope[3]
double neuron_01040()
Definition: Erl_mlp.h:84
void setOffsetAndSlope(const double offset, const double slope)
Definition: Erl_mlp.h:15
double ecalFraction(const double t1=0.0, const double t2=0.0, const double t3=0.0, const double t4=0.0, const double t5=0.0, const double t6=0.0, const double t7=0.0)
Definition: Erl_mlp.h:34
double ecalOutput()
Definition: Erl_mlp.h:62
double neuron_01060()
Definition: Erl_mlp.h:86
double neuron_01020()
Definition: Erl_mlp.h:82
double neuron_01070()
Definition: Erl_mlp.h:87
double t3_
Definition: Erl_mlp.h:49
double neuron_01110()
Definition: Erl_mlp.h:72
double neuron_01090()
Definition: Erl_mlp.h:70
double neuron_01200()
Definition: Erl_mlp.h:67
double neuron_01150()
Definition: Erl_mlp.h:76
double evaluate(const double t1=0.0, const double t2=0.0, const double t3=0.0, const double t4=0.0, const double t5=0.0, const double t6=0.0, const double t7=0.0)
Definition: Erl_mlp.h:20
virtual ~Erl_mlp()
Definition: Erl_mlp.cc:12
double neuron_01050()
Definition: Erl_mlp.h:85
double neuron_01160()
Definition: Erl_mlp.h:77
double neuron_01120()
Definition: Erl_mlp.h:73
double t5_
Definition: Erl_mlp.h:49
double t2_
Definition: Erl_mlp.h:49
double neuron_01140()
Definition: Erl_mlp.h:75
double transform(const double k)
Definition: Erl_mlp.h:52
double t6_
Definition: Erl_mlp.h:49
double neuron_01100()
Definition: Erl_mlp.h:71
double neuron_01130()
Definition: Erl_mlp.h:74
double t4_
Definition: Erl_mlp.h:49
double neuron_01030()
Definition: Erl_mlp.h:83
double slope_
Definition: Erl_mlp.h:50