Logo ROOT   6.12/07
Reference Guide
TNeuronInputChooser.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Matt Jachowski
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : TMVA::TNeuronInputChooser *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Class for easily choosing neuron input functions. *
12  * *
13  * Authors (alphabetical): *
14  * Matt Jachowski <jachowski@stanford.edu> - Stanford University, USA *
15  * *
16  * Copyright (c) 2005: *
17  * CERN, Switzerland *
18  * *
19  * Redistribution and use in source and binary forms, with or without *
20  * modification, are permitted according to the terms listed in LICENSE *
21  * (http://tmva.sourceforge.net/LICENSE) *
22  **********************************************************************************/
23 
24 
25 #ifndef ROOT_TMVA_TNeuronInputChooser
26 #define ROOT_TMVA_TNeuronInputChooser
27 
28 //////////////////////////////////////////////////////////////////////////
29 // //
30 // TNeuronInputChooser //
31 // //
32 // Class for easily choosing neuron input functions //
33 // //
34 //////////////////////////////////////////////////////////////////////////
35 
36 #include <vector>
37 #ifndef ROOT_TString
38 #include "TString.h"
39 #endif
40 
41 #ifndef ROOT_TMVA_TActivation
42 #ifndef ROOT_TNeuronInput
43 #include "TNeuronInput.h"
44 #endif
45 #endif
46 #ifndef ROOT_TMVA_TNeuronInputSum
47 #ifndef ROOT_TNeuronInputSum
48 #include "TNeuronInputSum.h"
49 #endif
50 #endif
51 #ifndef ROOT_TMVA_TNeuronInputSqSum
52 #ifndef ROOT_TNeuronInputSqSum
53 #include "TNeuronInputSqSum.h"
54 #endif
55 #endif
56 #ifndef ROOT_TMVA_TNeuronInputAbs
57 #ifndef ROOT_TNeuronInputAbs
58 #include "TNeuronInputAbs.h"
59 #endif
60 #endif
61 
62 namespace TMVA {
63 
64  class TNeuron;
65 
67 
68  public:
69 
71  {
72  fSUM = "sum";
73  fSQSUM = "sqsum";
74  fABSSUM = "abssum";
75  }
76  virtual ~TNeuronInputChooser() {}
77 
78  enum ENeuronInputType { kSum = 0,
81  };
82 
84  {
85  switch (type) {
86  case kSum: return new TNeuronInputSum();
87  case kSqSum: return new TNeuronInputSqSum();
88  case kAbsSum: return new TNeuronInputAbs();
89  default: return NULL;
90  }
91  return NULL;
92  }
93 
95  {
96  if (type == fSUM) return CreateNeuronInput(kSum);
97  else if (type == fSQSUM) return CreateNeuronInput(kSqSum);
98  else if (type == fABSSUM) return CreateNeuronInput(kAbsSum);
99  else return NULL;
100  }
101 
102  std::vector<TString>* GetAllNeuronInputNames() const
103  {
104  std::vector<TString>* names = new std::vector<TString>();
105  names->push_back(fSUM);
106  names->push_back(fSQSUM);
107  names->push_back(fABSSUM);
108  return names;
109  }
110 
111  private:
112 
113  TString fSUM; // neuron input type name
114  TString fSQSUM; // neuron input type name
115  TString fABSSUM; // neuron input type name
116 
117  ClassDef(TNeuronInputChooser,0); // Class for choosing neuron input functions
118  };
119 
120 } // namespace TMVA
121 
122 #endif
Basic string class.
Definition: TString.h:125
#define ClassDef(name, id)
Definition: Rtypes.h:320
TNeuron input calculator – calculates the weighted sum of inputs.
TNeuron input calculator – calculates the sum of the absolute values of the weighted inputs...
std::vector< TString > * GetAllNeuronInputNames() const
TNeuronInput * CreateNeuronInput(const TString type) const
TNeuronInput * CreateNeuronInput(ENeuronInputType type) const
Class for easily choosing neuron input functions.
int type
Definition: TGX11.cxx:120
TNeuron input calculator – calculates the squared weighted sum of inputs.
Abstract ClassifierFactory template that handles arbitrary types.
Interface for TNeuron input calculation classes.
Definition: TNeuronInput.h:42