00001 // @(#)root/tmva $Id: TActivationIdentity.h 29122 2009-06-22 06:51:30Z brun $ 00002 // Author: Matt Jachowski 00003 00004 /********************************************************************************** 00005 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00006 * Package: TMVA * 00007 * Class : TMVA::TActivationIdentity * 00008 * Web : http://tmva.sourceforge.net * 00009 * * 00010 * Description: * 00011 * Identity activation function for TNeuron * 00012 * * 00013 * Authors (alphabetical): * 00014 * Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA * 00015 * * 00016 * Copyright (c) 2005: * 00017 * CERN, Switzerland * 00018 * * 00019 * Redistribution and use in source and binary forms, with or without * 00020 * modification, are permitted according to the terms listed in LICENSE * 00021 * (http://tmva.sourceforge.net/LICENSE) * 00022 **********************************************************************************/ 00023 00024 #ifndef ROOT_TMVA_TActivationIdentity 00025 #define ROOT_TMVA_TActivationIdentity 00026 00027 ////////////////////////////////////////////////////////////////////////// 00028 // // 00029 // TActivationIdentity // 00030 // // 00031 // Identity activation function for TNeuron // 00032 // // 00033 ////////////////////////////////////////////////////////////////////////// 00034 00035 #ifndef ROOT_TFormula 00036 #include "TFormula.h" 00037 #endif 00038 #ifndef ROOT_TString 00039 #include "TString.h" 00040 #endif 00041 00042 #ifndef ROOT_TMVA_TActivation 00043 #include "TMVA/TActivation.h" 00044 #endif 00045 00046 namespace TMVA { 00047 00048 class TActivationIdentity : public TActivation { 00049 00050 public: 00051 00052 TActivationIdentity() {} 00053 ~TActivationIdentity() {} 00054 00055 // evaluate the activation function 00056 virtual Double_t Eval(Double_t arg) { return arg; } // f(x) = x 00057 00058 // evaluate the derivative of the activation function 00059 virtual Double_t EvalDerivative(Double_t) { 00060 return 1; // f'(x) = 1 00061 } 00062 00063 // minimum of the range of the activation function 00064 virtual Double_t GetMin() { return 0; } // these should never be called 00065 00066 // maximum of the range of the activation function 00067 virtual Double_t GetMax() { return 1; } // these should never be called 00068 00069 // expression for activation function 00070 virtual TString GetExpression() { return "x\t1"; } 00071 00072 // writer of function code 00073 virtual void MakeFunction(std::ostream& fout, const TString& fncName); 00074 00075 private: 00076 00077 ClassDef(TActivationIdentity,0) // Identity activation function for TNeuron 00078 }; 00079 00080 } // namespace TMVA 00081 00082 #endif