Warning, file /include/root/TNeuron.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 #ifndef ROOT_TNeuron
0013 #define ROOT_TNeuron
0014
0015 #include "TNamed.h"
0016 #include "TObjArray.h"
0017
0018 class TTreeFormula;
0019 class TSynapse;
0020 class TBranch;
0021 class TTree;
0022 class TFormula;
0023
0024
0025 class TNeuron : public TNamed {
0026 friend class TSynapse;
0027
0028 public:
0029 enum ENeuronType { kOff, kLinear, kSigmoid, kTanh, kGauss, kSoftmax, kExternal };
0030
0031 TNeuron(ENeuronType type = kSigmoid,
0032 const char* name = "", const char* title = "",
0033 const char* extF = "", const char* extD = "" );
0034 ~TNeuron() override {}
0035 inline TSynapse* GetPre(Int_t n) const { return (TSynapse*) fpre.At(n); }
0036 inline TSynapse* GetPost(Int_t n) const { return (TSynapse*) fpost.At(n); }
0037 inline TNeuron* GetInLayer(Int_t n) const { return (TNeuron*) flayer.At(n); }
0038 TTreeFormula* UseBranch(TTree*, const char*);
0039 Double_t GetInput() const;
0040 Double_t GetValue() const;
0041 Double_t GetDerivative() const;
0042 Double_t GetError() const;
0043 Double_t GetTarget() const;
0044 Double_t GetDeDw() const;
0045 Double_t GetBranch() const;
0046 ENeuronType GetType() const;
0047 void SetWeight(Double_t w);
0048 inline Double_t GetWeight() const { return fWeight; }
0049 void SetNormalisation(Double_t mean, Double_t RMS);
0050 inline const Double_t* GetNormalisation() const { return fNorm; }
0051 void SetNewEvent() const;
0052 void SetDEDw(Double_t in);
0053 inline Double_t GetDEDw() const { return fDEDw; }
0054 void ForceExternalValue(Double_t value);
0055 void AddInLayer(TNeuron*);
0056
0057 protected:
0058 Double_t Sigmoid(Double_t x) const;
0059 Double_t DSigmoid(Double_t x) const;
0060 void AddPre(TSynapse*);
0061 void AddPost(TSynapse*);
0062
0063 private:
0064 TNeuron(const TNeuron&);
0065 TNeuron& operator=(const TNeuron&);
0066
0067 TObjArray fpre;
0068 TObjArray fpost;
0069 TObjArray flayer;
0070 Double_t fWeight;
0071 Double_t fNorm[2];
0072 ENeuronType fType;
0073 TFormula* fExtF;
0074 TFormula* fExtD;
0075 TTreeFormula* fFormula;
0076 Int_t fIndex;
0077 Bool_t fNewInput;
0078 Double_t fInput;
0079 Bool_t fNewValue;
0080 Double_t fValue;
0081 Bool_t fNewDeriv;
0082 Double_t fDerivative;
0083 Bool_t fNewDeDw;
0084 Double_t fDeDw;
0085 Double_t fDEDw;
0086
0087 ClassDefOverride(TNeuron, 4)
0088 };
0089
0090 #endif