Warning, file /include/root/TMVA/TNeuronInputChooser.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef ROOT_TMVA_TNeuronInputChooser
0026 #define ROOT_TMVA_TNeuronInputChooser
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #include <vector>
0037 #ifndef ROOT_TString
0038 #include "TString.h"
0039 #endif
0040
0041 #ifndef ROOT_TMVA_TActivation
0042 #ifndef ROOT_TNeuronInput
0043 #include "TNeuronInput.h"
0044 #endif
0045 #endif
0046 #ifndef ROOT_TMVA_TNeuronInputSum
0047 #ifndef ROOT_TNeuronInputSum
0048 #include "TNeuronInputSum.h"
0049 #endif
0050 #endif
0051 #ifndef ROOT_TMVA_TNeuronInputSqSum
0052 #ifndef ROOT_TNeuronInputSqSum
0053 #include "TNeuronInputSqSum.h"
0054 #endif
0055 #endif
0056 #ifndef ROOT_TMVA_TNeuronInputAbs
0057 #ifndef ROOT_TNeuronInputAbs
0058 #include "TNeuronInputAbs.h"
0059 #endif
0060 #endif
0061
0062 namespace TMVA {
0063
0064 class TNeuron;
0065
0066 class TNeuronInputChooser {
0067
0068 public:
0069
0070 TNeuronInputChooser()
0071 {
0072 fSUM = "sum";
0073 fSQSUM = "sqsum";
0074 fABSSUM = "abssum";
0075 }
0076 virtual ~TNeuronInputChooser() {}
0077
0078 enum ENeuronInputType { kSum = 0,
0079 kSqSum,
0080 kAbsSum
0081 };
0082
0083 TNeuronInput* CreateNeuronInput(ENeuronInputType type) const
0084 {
0085 switch (type) {
0086 case kSum: return new TNeuronInputSum();
0087 case kSqSum: return new TNeuronInputSqSum();
0088 case kAbsSum: return new TNeuronInputAbs();
0089 default: return nullptr;
0090 }
0091 return nullptr;
0092 }
0093
0094 TNeuronInput* CreateNeuronInput(const TString type) const
0095 {
0096 if (type == fSUM) return CreateNeuronInput(kSum);
0097 else if (type == fSQSUM) return CreateNeuronInput(kSqSum);
0098 else if (type == fABSSUM) return CreateNeuronInput(kAbsSum);
0099 else return nullptr;
0100 }
0101
0102 std::vector<TString>* GetAllNeuronInputNames() const
0103 {
0104 std::vector<TString>* names = new std::vector<TString>();
0105 names->push_back(fSUM);
0106 names->push_back(fSQSUM);
0107 names->push_back(fABSSUM);
0108 return names;
0109 }
0110
0111 private:
0112
0113 TString fSUM;
0114 TString fSQSUM;
0115 TString fABSSUM;
0116
0117 ClassDef(TNeuronInputChooser,0);
0118 };
0119
0120 }
0121
0122 #endif