#ifndef ROOT_TMVA_TNeuron
#define ROOT_TMVA_TNeuron
#include "TString.h"
#include "TObjArray.h"
#include "TFormula.h"
#ifndef ROOT_TMVA_TSynapse
#include "TMVA/TSynapse.h"
#endif
#ifndef ROOT_TMVA_TActivation
#include "TMVA/TActivation.h"
#endif
#ifndef ROOT_TMVA_MsgLogger
#include "TMVA/MsgLogger.h"
#endif
namespace TMVA {
class TNeuronInput;
class TNeuron : public TObject {
public:
TNeuron();
virtual ~TNeuron();
void ForceValue(Double_t value);
void CalculateValue();
void CalculateActivationValue();
void CalculateDelta();
void SetActivationEqn(TActivation* activation);
void SetInputCalculator(TNeuronInput* calculator);
void AddPreLink(TSynapse* pre);
void AddPostLink(TSynapse* post);
void DeletePreLinks();
void SetError(Double_t error);
void UpdateSynapsesBatch();
void UpdateSynapsesSequential();
void AdjustSynapseWeights();
void InitSynapseDeltas();
void PrintActivationEqn();
Double_t GetValue() const { return fValue; }
Double_t GetActivationValue() const { return fActivationValue; }
Double_t GetDelta() const { return fDelta; }
Int_t NumPreLinks() const { return NumLinks(fLinksIn); }
Int_t NumPostLinks() const { return NumLinks(fLinksOut); }
TSynapse* PreLinkAt ( Int_t index ) const { return (TSynapse*)fLinksIn->At(index); }
TSynapse* PostLinkAt( Int_t index ) const { return (TSynapse*)fLinksOut->At(index); }
void SetInputNeuron() { NullifyLinks(fLinksIn); }
void SetOutputNeuron() { NullifyLinks(fLinksOut); }
void SetBiasNeuron() { NullifyLinks(fLinksIn); }
Bool_t IsInputNeuron() const { return fLinksIn == NULL; }
Bool_t IsOutputNeuron() const { return fLinksOut == NULL; }
void PrintPreLinks() { PrintLinks(fLinksIn); return; }
void PrintPostLinks() { PrintLinks(fLinksOut); return; }
private:
void InitNeuron();
void DeleteLinksArray( TObjArray*& links );
void PrintLinks ( TObjArray* links );
void PrintMessage ( EMsgType, TString message );
Int_t NumLinks(TObjArray* links) const {
if (links == NULL) return 0; return links->GetEntriesFast();
}
void NullifyLinks(TObjArray*& links) {
if (links != NULL) delete links; links = NULL;
}
TObjArray* fLinksIn;
TObjArray* fLinksOut;
Double_t fValue;
Double_t fActivationValue;
Double_t fDelta;
Double_t fError;
Bool_t fForcedValue;
TActivation* fActivation;
TNeuronInput* fInputCalculator;
mutable MsgLogger fLogger;
ClassDef(TNeuron,0)
};
}
#endif
Last change: Wed Jun 25 08:48:51 2008
Last generated: 2008-06-25 08:48
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.