// @(#)root/tmva $Id: TNeuronInputChooser.h 20882 2007-11-19 11:31:26Z rdm $ // Author: Matt Jachowski /********************************************************************************** * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * * Package: TMVA * * Class : TMVA::TNeuronInputChooser * * Web : http://tmva.sourceforge.net * * * * Description: * * Class for easily choosing neuron input functions. * * * * Authors (alphabetical): * * Matt Jachowski - Stanford University, USA * * * * Copyright (c) 2005: * * CERN, Switzerland * * * * Redistribution and use in source and binary forms, with or without * * modification, are permitted according to the terms listed in LICENSE * * (http://tmva.sourceforge.net/LICENSE) * **********************************************************************************/ #ifndef ROOT_TMVA_TNeuronInputChooser #define ROOT_TMVA_TNeuronInputChooser ////////////////////////////////////////////////////////////////////////// // // // TNeuronInputChooser // // // // Class for easily choosing neuron input functions // // // ////////////////////////////////////////////////////////////////////////// #include #include "TString.h" #ifndef ROOT_TMVA_TActivation #include "TNeuronInput.h" #endif #ifndef ROOT_TMVA_TNeuronInputSum #include "TNeuronInputSum.h" #endif #ifndef ROOT_TMVA_TNeuronInputSqSum #include "TNeuronInputSqSum.h" #endif #ifndef ROOT_TMVA_TNeuronInputAbs #include "TNeuronInputAbs.h" #endif namespace TMVA { class TNeuron; class TNeuronInputChooser { public: TNeuronInputChooser() { fSUM = "sum"; fSQSUM = "sqsum"; fABSSUM = "abssum"; } virtual ~TNeuronInputChooser() {} enum ENeuronInputType { kSum = 0, kSqSum, kAbsSum }; TNeuronInput* CreateNeuronInput(ENeuronInputType type) const { switch (type) { case kSum: return new TNeuronInputSum(); case kSqSum: return new TNeuronInputSqSum(); case kAbsSum: return new TNeuronInputAbs(); default: return NULL; } return NULL; } TNeuronInput* CreateNeuronInput(const TString type) const { if (type == fSUM) return CreateNeuronInput(kSum); else if (type == fSQSUM) return CreateNeuronInput(kSqSum); else if (type == fABSSUM) return CreateNeuronInput(kAbsSum); else return NULL; } std::vector* GetAllNeuronInputNames() const { std::vector* names = new std::vector(); names->push_back(fSUM); names->push_back(fSQSUM); names->push_back(fABSSUM); return names; } private: TString fSUM; // neuron input type name TString fSQSUM; // neuron input type name TString fABSSUM; // neuron input type name ClassDef(TNeuronInputChooser,0) // Class for choosing neuron input functions }; } // namespace TMVA #endif