Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:10

0001 // @(#)root/tmva $Id$
0002 // Author: Matt Jachowski
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : TMVA::TActivationChooser                                              *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Class for easily choosing activation functions.                           *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Matt Jachowski  <jachowski@stanford.edu> - Stanford University, USA       *
0015  *                                                                                *
0016  * Copyright (c) 2005:                                                            *
0017  *      CERN, Switzerland                                                         *
0018  *                                                                                *
0019  * Redistribution and use in source and binary forms, with or without             *
0020  * modification, are permitted according to the terms listed in LICENSE           *
0021  * (see tmva/doc/LICENSE)                                          *
0022  **********************************************************************************/
0023 
0024 
0025 #ifndef ROOT_TMVA_TActivationChooser
0026 #define ROOT_TMVA_TActivationChooser
0027 
0028 //////////////////////////////////////////////////////////////////////////
0029 //                                                                      //
0030 // TActivationChooser                                                   //
0031 //                                                                      //
0032 // Class for easily choosing activation functions                       //
0033 //                                                                      //
0034 //////////////////////////////////////////////////////////////////////////
0035 
0036 #include <vector>
0037 #include "TString.h"
0038 
0039 namespace TMVA {
0040 
0041    class TActivation;
0042    class MsgLogger;
0043 
0044    class TActivationChooser {
0045    public:
0046 
0047       enum EActivationType { kLinear = 0,
0048                              kSigmoid,
0049                              kTanh,
0050                              kReLU,
0051                              kRadial
0052       };
0053 
0054       TActivationChooser();
0055       virtual ~TActivationChooser();
0056 
0057       TActivation* CreateActivation(EActivationType type) const;
0058       TActivation* CreateActivation(const TString& type) const;
0059       std::vector<TString>* GetAllActivationNames() const;
0060 
0061    private:
0062 
0063       TString fLINEAR;  ///< activation function name
0064       TString fSIGMOID; ///< activation function name
0065       TString fTANH;    ///< activation function name
0066       TString fRELU;    ///< activation function name
0067       TString fRADIAL;  ///< activation function name
0068 
0069       mutable MsgLogger* fLogger;                     ///<! message logger
0070       MsgLogger& Log() const { return *fLogger; }
0071 
0072       ClassDef(TActivationChooser,0); // Class for choosing activation functions
0073    };
0074 
0075 } // namespace TMVA
0076 
0077 #endif