Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TActivationIdentity.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Matt Jachowski
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : TMVA::TActivationIdentity *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Identity activation function for TNeuron *
12  * *
13  * Authors (alphabetical): *
14  * Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA *
15  * *
16  * Copyright (c) 2005: *
17  * CERN, Switzerland *
18  * *
19  * Redistribution and use in source and binary forms, with or without *
20  * modification, are permitted according to the terms listed in LICENSE *
21  * (http://tmva.sourceforge.net/LICENSE) *
22  **********************************************************************************/
23 
24 #ifndef ROOT_TMVA_TActivationIdentity
25 #define ROOT_TMVA_TActivationIdentity
26 
27 //////////////////////////////////////////////////////////////////////////
28 // //
29 // TActivationIdentity //
30 // //
31 // Identity activation function for TNeuron //
32 // //
33 //////////////////////////////////////////////////////////////////////////
34 
35 #include "TString.h"
36 
37 #include "TMVA/TActivation.h"
38 
39 namespace TMVA {
40 
41  class TActivationIdentity : public TActivation {
42 
43  public:
44 
45  TActivationIdentity() {}
46  ~TActivationIdentity() {}
47 
48  // evaluate the activation function
49  virtual Double_t Eval(Double_t arg) { return arg; } // f(x) = x
50 
51  // evaluate the derivative of the activation function
52  virtual Double_t EvalDerivative(Double_t) {
53  return 1; // f'(x) = 1
54  }
55 
56  // minimum of the range of the activation function
57  virtual Double_t GetMin() { return 0; } // these should never be called
58 
59  // maximum of the range of the activation function
60  virtual Double_t GetMax() { return 1; } // these should never be called
61 
62  // expression for activation function
63  virtual TString GetExpression() { return "x\t1"; }
64 
65  // writer of function code
66  virtual void MakeFunction(std::ostream& fout, const TString& fncName);
67 
68  private:
69 
70  ClassDef(TActivationIdentity,0); // Identity activation function for TNeuron
71  };
72 
73 } // namespace TMVA
74 
75 #endif