diff --git a/mlp/inc/TMultiLayerPerceptron.h b/mlp/inc/TMultiLayerPerceptron.h index 0c23a108e563de05ff177ecc6a69abc22d0bbeff..f5fbf34a3b5b8a2fc67d0c505794eb67266df113 100644 --- a/mlp/inc/TMultiLayerPerceptron.h +++ b/mlp/inc/TMultiLayerPerceptron.h @@ -1,4 +1,4 @@ -// @(#)root/mlp:$Name: $:$Id: TMultiLayerPerceptron.h,v 1.10 2006/01/09 15:47:30 brun Exp $ +// @(#)root/mlp:$Name: $:$Id: TMultiLayerPerceptron.h,v 1.11 2006/05/26 15:13:02 rdm Exp $ // Author: Christophe.Delaere@cern.ch 20/07/03 /************************************************************************* @@ -59,31 +59,31 @@ class TMultiLayerPerceptron : public TObject { friend class TMLPAnalyzer; public: - enum LearningMethod { kStochastic, kBatch, kSteepestDescent, - kRibierePolak, kFletcherReeves, kBFGS }; - enum DataSet { kTraining, kTest }; + enum ELearningMethod { kStochastic, kBatch, kSteepestDescent, + kRibierePolak, kFletcherReeves, kBFGS }; + enum EDataSet { kTraining, kTest }; TMultiLayerPerceptron(); TMultiLayerPerceptron(const char* layout, TTree* data = 0, const char* training = "Entry$%2==0", const char* test = "", - TNeuron::NeuronType type = TNeuron::kSigmoid, + TNeuron::ENeuronType type = TNeuron::kSigmoid, const char* extF = "", const char* extD = ""); TMultiLayerPerceptron(const char* layout, const char* weight, TTree* data = 0, const char* training = "Entry$%2==0", const char* test = "", - TNeuron::NeuronType type = TNeuron::kSigmoid, + TNeuron::ENeuronType type = TNeuron::kSigmoid, const char* extF = "", const char* extD = ""); TMultiLayerPerceptron(const char* layout, TTree* data, TEventList* training, TEventList* test, - TNeuron::NeuronType type = TNeuron::kSigmoid, + TNeuron::ENeuronType type = TNeuron::kSigmoid, const char* extF = "", const char* extD = ""); TMultiLayerPerceptron(const char* layout, const char* weight, TTree* data, TEventList* training, TEventList* test, - TNeuron::NeuronType type = TNeuron::kSigmoid, + TNeuron::ENeuronType type = TNeuron::kSigmoid, const char* extF = "", const char* extD = ""); virtual ~TMultiLayerPerceptron(); void SetData(TTree*); @@ -91,12 +91,12 @@ class TMultiLayerPerceptron : public TObject { void SetTestDataSet(TEventList* test); void SetTrainingDataSet(const char* train); void SetTestDataSet(const char* test); - void SetLearningMethod(TMultiLayerPerceptron::LearningMethod method); + void SetLearningMethod(TMultiLayerPerceptron::ELearningMethod method); void SetEventWeight(const char*); void Train(Int_t nEpoch, Option_t* option = "text"); Double_t Result(Int_t event, Int_t index = 0) const; Double_t GetError(Int_t event) const; - Double_t GetError(TMultiLayerPerceptron::DataSet set) const; + Double_t GetError(TMultiLayerPerceptron::EDataSet set) const; void ComputeDEDw() const; void Randomize() const; void SetEta(Double_t eta); @@ -112,7 +112,7 @@ class TMultiLayerPerceptron : public TObject { inline Double_t GetTau() const { return fTau; } inline Int_t GetReset() const { return fReset; } inline TString GetStructure() const { return fStructure; } - inline TNeuron::NeuronType GetType() const { return fType; } + inline TNeuron::ENeuronType GetType() const { return fType; } void DrawResult(Int_t index = 0, Option_t* option = "test") const; void DumpWeights(Option_t* filename = "-") const; void LoadWeights(Option_t* filename = ""); @@ -155,13 +155,13 @@ class TMultiLayerPerceptron : public TObject { TObjArray fSynapses; // Collection of all the synapses in the network TString fStructure; // String containing the network structure TString fWeight; // String containing the event weight - TNeuron::NeuronType fType; // Type of hidden neurons - TNeuron::NeuronType fOutType; // Type of output neurons + TNeuron::ENeuronType fType; // Type of hidden neurons + TNeuron::ENeuronType fOutType; // Type of output neurons TString fextF; // String containing the function name TString fextD; // String containing the derivative name TEventList *fTraining; //! EventList defining the events in the training dataset TEventList *fTest; //! EventList defining the events in the test dataset - LearningMethod fLearningMethod; //! The Learning Method + ELearningMethod fLearningMethod; //! The Learning Method TTreeFormula* fEventWeight; //! formula representing the event weight TTreeFormulaManager* fManager; //! TTreeFormulaManager for the weight and neurons Double_t fEta; //! Eta - used in stochastic minimisation - Default=0.1 diff --git a/mlp/inc/TNeuron.h b/mlp/inc/TNeuron.h index bf6a8acecb250a7c7e83e7747671f05506e26442..dbfedc9a77ee453830ab3ec2554009b67f99f1ef 100644 --- a/mlp/inc/TNeuron.h +++ b/mlp/inc/TNeuron.h @@ -1,4 +1,4 @@ -// @(#)root/mlp:$Name: $:$Id: TNeuron.h,v 1.9 2006/01/09 15:47:30 brun Exp $ +// @(#)root/mlp:$Name: $:$Id: TNeuron.h,v 1.10 2006/01/09 18:05:57 pcanal Exp $ // Author: Christophe.Delaere@cern.ch 20/07/03 /************************************************************************* @@ -49,9 +49,9 @@ class TNeuron : public TNamed { friend class TSynapse; public: - enum NeuronType { kOff, kLinear, kSigmoid, kTanh, kGauss, kSoftmax, kExternal }; + enum ENeuronType { kOff, kLinear, kSigmoid, kTanh, kGauss, kSoftmax, kExternal }; - TNeuron(NeuronType type = kSigmoid, + TNeuron(ENeuronType type = kSigmoid, const char* name = "", const char* title = "", const char* extF = "", const char* extD = "" ); virtual ~ TNeuron() {} @@ -66,7 +66,7 @@ class TNeuron : public TNamed { Double_t GetTarget() const; Double_t GetDeDw() const; Double_t GetBranch() const; - NeuronType GetType() const; + ENeuronType GetType() const; void SetWeight(Double_t w); inline Double_t GetWeight() const { return fWeight; } void SetNormalisation(Double_t mean, Double_t RMS); @@ -89,7 +89,7 @@ class TNeuron : public TNamed { TObjArray flayer; // pointers to the current level in a network (neurons, not synapses) Double_t fWeight; // weight used for computation Double_t fNorm[2]; // normalisation to mean=0, RMS=1. - NeuronType fType; // neuron type + ENeuronType fType; // neuron type TFormula* fExtF; // function (external mode) TFormula* fExtD; // derivative (external mode) //buffers diff --git a/mlp/src/TMultiLayerPerceptron.cxx b/mlp/src/TMultiLayerPerceptron.cxx index 9f58c86beeead88e182f982b16eee86854c623a7..f5893188eadd3a947a73d313bd5d5929c537677a 100644 --- a/mlp/src/TMultiLayerPerceptron.cxx +++ b/mlp/src/TMultiLayerPerceptron.cxx @@ -1,4 +1,4 @@ -// @(#)root/mlp:$Name: $:$Id: TMultiLayerPerceptron.cxx,v 1.37 2006/05/26 15:13:02 rdm Exp $ +// @(#)root/mlp:$Name: $:$Id: TMultiLayerPerceptron.cxx,v 1.38 2006/10/08 15:28:01 brun Exp $ // Author: Christophe.Delaere@cern.ch 20/07/03 /************************************************************************* @@ -306,7 +306,7 @@ TMultiLayerPerceptron::TMultiLayerPerceptron() TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, TTree * data, TEventList * training, TEventList * test, - TNeuron::NeuronType type, + TNeuron::ENeuronType type, const char* extF, const char* extD) { // The network is described by a simple string: @@ -363,7 +363,7 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, const char * weight, TTree * data, TEventList * training, TEventList * test, - TNeuron::NeuronType type, + TNeuron::ENeuronType type, const char* extF, const char* extD) { // The network is described by a simple string: @@ -418,7 +418,7 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, TTree * data, const char * training, const char * test, - TNeuron::NeuronType type, + TNeuron::ENeuronType type, const char* extF, const char* extD) { // The network is described by a simple string: @@ -483,7 +483,7 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, const char * weight, TTree * data, const char * training, const char * test, - TNeuron::NeuronType type, + TNeuron::ENeuronType type, const char* extF, const char* extD) { // The network is described by a simple string: @@ -635,7 +635,7 @@ void TMultiLayerPerceptron::SetTestDataSet(const char * test) } //______________________________________________________________________________ -void TMultiLayerPerceptron::SetLearningMethod(TMultiLayerPerceptron::LearningMethod method) +void TMultiLayerPerceptron::SetLearningMethod(TMultiLayerPerceptron::ELearningMethod method) { // Sets the learning method. // Available methods are: kStochastic, kBatch, @@ -1007,7 +1007,7 @@ Double_t TMultiLayerPerceptron::GetError(Int_t event) const } //______________________________________________________________________________ -Double_t TMultiLayerPerceptron::GetError(TMultiLayerPerceptron::DataSet set) const +Double_t TMultiLayerPerceptron::GetError(TMultiLayerPerceptron::EDataSet set) const { // Error on the whole dataset TEventList *list = diff --git a/mlp/src/TNeuron.cxx b/mlp/src/TNeuron.cxx index 11ab7fecd848ee8b7ff44480db661fd878a86f78..b657b0ad5ad28748f5977ea2cb7e010e36c9b374 100644 --- a/mlp/src/TNeuron.cxx +++ b/mlp/src/TNeuron.cxx @@ -1,4 +1,4 @@ -// @(#)root/mlp:$Name: $:$Id: TNeuron.cxx,v 1.19 2006/05/12 08:19:02 brun Exp $ +// @(#)root/mlp:$Name: $:$Id: TNeuron.cxx,v 1.20 2006/05/26 15:13:02 rdm Exp $ // Author: Christophe.Delaere@cern.ch 20/07/03 /************************************************************************* @@ -45,7 +45,7 @@ ClassImp(TNeuron) //______________________________________________________________________________ -TNeuron::TNeuron(TNeuron::NeuronType type /*= kSigmoid*/, +TNeuron::TNeuron(TNeuron::ENeuronType type /*= kSigmoid*/, const char* name /*= ""*/, const char* title /*= ""*/, const char* extF /*= ""*/, const char* extD /*= ""*/ ) :TNamed(name, title) @@ -855,7 +855,7 @@ void TNeuron::AddInLayer(TNeuron * nearP) } //______________________________________________________________________________ -TNeuron::NeuronType TNeuron::GetType() const +TNeuron::ENeuronType TNeuron::GetType() const { // Returns the neuron type. return fType; diff --git a/tmva/src/MethodTMlpANN.cxx b/tmva/src/MethodTMlpANN.cxx index 298c2fb8ab843e8efd5a9a688011708d325a7700..4be3c3ddd1634bb02d1165146b870f04f038d0f2 100644 --- a/tmva/src/MethodTMlpANN.cxx +++ b/tmva/src/MethodTMlpANN.cxx @@ -1,4 +1,4 @@ -// @(#)root/tmva $Id: MethodTMlpANN.cxx,v 1.34 2006/11/17 00:21:35 stelzer Exp $ +// @(#)root/tmva $Id: MethodTMlpANN.cxx,v 1.10 2006/11/20 15:35:28 brun Exp $ // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss /********************************************************************************** * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * @@ -59,8 +59,8 @@ // some additional TMlpANN options const Bool_t EnforceNormalization__=kTRUE; -const TMultiLayerPerceptron::LearningMethod LearningMethod__= TMultiLayerPerceptron::kStochastic; -// const TMultiLayerPerceptron::LearningMethod LearningMethod__= TMultiLayerPerceptron::kBatch; +const TMultiLayerPerceptron::ELearningMethod LearningMethod__= TMultiLayerPerceptron::kStochastic; +// const TMultiLayerPerceptron::ELearningMethod LearningMethod__= TMultiLayerPerceptron::kBatch; ClassImp(TMVA::MethodTMlpANN) ;