Logo ROOT   6.10/09
Reference Guide
TActivationReLU.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::TActivationReLU *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Tanh 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_TActivationReLU
25 #define ROOT_TMVA_TActivationReLU
26 
27 //////////////////////////////////////////////////////////////////////////
28 // //
29 // TActivationReLU //
30 // //
31 // Rectified Linear Unit activation function for TNeuron //
32 // //
33 //////////////////////////////////////////////////////////////////////////
34 
35 #include "TFormula.h"
36 #include "TString.h"
37 
38 #include "TMVA/TActivation.h"
39 
40 namespace TMVA {
41 
42  class TActivationReLU : public TActivation {
43 
44  public:
45 
48 
49  // evaluate the activation function
50  Double_t Eval(Double_t arg) { return arg>0 ? arg : 0;}
51 
52  // evaluate the derivative of the activation function
53  Double_t EvalDerivative(Double_t arg) { return arg>0 ? 1 : 0;}
54 
55  // minimum of the range of the activation function
56  Double_t GetMin() { return -1; }
57 
58  // maximum of the range of the activation function
59  Double_t GetMax() { return 1; }
60 
61  // expression for the activation function
63 
64  // writer of function code
65  virtual void MakeFunction(std::ostream& fout, const TString& fncName);
66 
67  private:
68 
69  ClassDef(TActivationReLU,0); // Tanh sigmoid activation function for TNeuron
70  };
71 
72 } // namespace TMVA
73 
74 #endif
Double_t Eval(Double_t arg)
~TActivationReLU()
destructor
Basic string class.
Definition: TString.h:129
#define ClassDef(name, id)
Definition: Rtypes.h:297
TString GetExpression()
get expressions for the tanh and its derivative
Rectified Linear Unit activation function for TNeuron.
TActivationReLU()
constructor for ReLU
Double_t EvalDerivative(Double_t arg)
double Double_t
Definition: RtypesCore.h:55
virtual void MakeFunction(std::ostream &fout, const TString &fncName)
writes the sigmoid activation function source code
Abstract ClassifierFactory template that handles arbitrary types.
Interface for TNeuron activation function classes.
Definition: TActivation.h:42