#ifndef ROOT_TMVA_TActivationChooser
#define ROOT_TMVA_TActivationChooser
#include <vector>
#include "TString.h"
#ifndef ROOT_TMVA_TActivation
#include "TActivation.h"
#endif
#ifndef ROOT_TMVA_TActivationIdentity
#include "TActivationIdentity.h"
#endif
#ifndef ROOT_TMVA_TActivationSigmoid
#include "TActivationSigmoid.h"
#endif
#ifndef ROOT_TMVA_TActivationTanh
#include "TActivationTanh.h"
#endif
#ifndef ROOT_TMVA_TActivationRadial
#include "TActivationRadial.h"
#endif
#ifndef ROOT_TMVA_MsgLogger
#include "TMVA/MsgLogger.h"
#endif
namespace TMVA {
class TActivationChooser {
public:
TActivationChooser()
: fLogger( "TActivationChooser" )
{
fLINEAR = "linear";
fSIGMOID = "sigmoid";
fTANH = "tanh";
fRADIAL = "radial";
}
virtual ~TActivationChooser() {}
enum EActivationType { kLinear = 0,
kSigmoid,
kTanh,
kRadial
};
TActivation* CreateActivation(EActivationType type) const
{
switch (type) {
case kLinear: return new TActivationIdentity();
case kSigmoid: return new TActivationSigmoid();
case kTanh: return new TActivationTanh();
case kRadial: return new TActivationRadial();
default:
fLogger << kFATAL << "no Activation function of type " << type << " found" << Endl;
return 0;
}
return NULL;
}
TActivation* CreateActivation(const TString type) const
{
if (type == fLINEAR) return CreateActivation(kLinear);
else if (type == fSIGMOID) return CreateActivation(kSigmoid);
else if (type == fTANH) return CreateActivation(kTanh);
else if (type == fRADIAL) return CreateActivation(kRadial);
else {
fLogger << kFATAL << "no Activation function of type " << type << " found" << Endl;
return 0;
}
}
vector<TString>* GetAllActivationNames() const
{
vector<TString>* names = new vector<TString>();
names->push_back(fLINEAR);
names->push_back(fSIGMOID);
names->push_back(fTANH);
names->push_back(fRADIAL);
return names;
}
private:
TString fLINEAR;
TString fSIGMOID;
TString fTANH;
TString fRADIAL;
mutable MsgLogger fLogger;
ClassDef(TActivationChooser,0)
;
};
}
#endif
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.