32 #ifndef ROOT_TMVA_MsgLogger
35 #ifndef ROOT_TMVA_TActivation
38 #ifndef ROOT_TMVA_Tools
41 #ifndef ROOT_TMVA_TNeuronInput
83 fInputCalculator =
NULL;
100 if (fForcedValue)
return;
101 fValue = fInputCalculator->GetInput(
this);
109 if (fActivation ==
NULL) {
110 PrintMessage(
kWARNING ,
"No activation equation specified." );
114 fActivationValue = fActivation->Eval(
fValue);
124 if (IsInputNeuron()) {
133 if (IsOutputNeuron()) error = fError;
146 if (synapse ==
NULL)
break;
152 fDelta = error * fActivation->EvalDerivative(GetValue());
160 if (fInputCalculator !=
NULL)
delete fInputCalculator;
161 fInputCalculator = calculator;
169 if (fActivation !=
NULL)
delete fActivation;
170 fActivation = activation;
178 if (IsInputNeuron())
return;
187 if (IsOutputNeuron())
return;
188 fLinksOut->Add(post);
196 DeleteLinksArray(fLinksIn);
204 if (links ==
NULL)
return;
208 for (
Int_t i=0; i<numLinks; i++) {
210 if (synapse !=
NULL)
delete synapse;
221 if (!IsOutputNeuron())
222 PrintMessage(
kWARNING,
"Warning! Setting an error on a non-output neuron is probably not what you want to do." );
233 if (IsInputNeuron())
return;
239 if (synapse ==
NULL)
break;
251 if (IsInputNeuron())
return;
258 if (synapse ==
NULL)
break;
272 if (IsInputNeuron())
return;
280 if (synapse ==
NULL)
break;
293 if (IsInputNeuron())
return;
301 if (synapse ==
NULL)
break;
320 for (
Int_t i = 0; i < numLinks; i++) {
323 "\t\t\tweighta: " << synapse->
GetWeight()
336 if (fActivation !=
NULL)
Log() <<
kDEBUG << fActivation->GetExpression() <<
Endl;
345 Log() << type << message <<
Endl;
MsgLogger & Endl(MsgLogger &ml)
void ForceValue(Double_t value)
force the value, typically for input and bias neurons
void PrintLinks(TObjArray *links) const
print an array of TSynapses, for debugging
Iterator of object array.
void AdjustWeight()
adjust the weight based on the error field all ready calculated by CalculateDelta ...
Int_t GetEntriesFast() const
void SetActivationEqn(TActivation *activation)
set activation equation
void InitSynapseDeltas()
initialize the error fields of all pre-neurons this method should only be called in batch mode ...
void DeleteLinksArray(TObjArray *&links)
delete an array of TSynapses
void AdjustSynapseWeights()
adjust the pre-synapses' weights for each neuron (input neuron has no pre-synapse) this method should...
void CalculateDelta()
calculate/adjust the error field for this synapse
TObject * Next()
Return next object in array. Returns 0 when no more objects in array.
static const Int_t UNINITIALIZED
void PrintActivationEqn()
print activation equation, for debugging
void SetError(Double_t error)
set error, this should only be done for an output neuron
void CalculateValue()
calculate neuron input
Double_t GetLearningRate()
void PrintMessage(EMsgType, TString message)
print message, for debugging
void UpdateSynapsesSequential()
update the pre-synapses for each neuron (input neuron has no pre-synapse) this method should only be ...
void UpdateSynapsesBatch()
update and adjust the pre-synapses for each neuron (input neuron has no pre-synapse) this method shou...
void CalculateActivationValue()
calculate neuron activation/output
void AddPostLink(TSynapse *post)
add synapse as a post-link to this neuron
Double_t GetWeightedDelta()
get error field of post-neuron weighted by synapse weight
Double_t GetWeightedValue()
get output of pre-neuron weighted by synapse weight
TObject * At(Int_t idx) const
void AddPreLink(TSynapse *pre)
add synapse as a pre-link to this neuron
void DeletePreLinks()
delete all pre-links
void CalculateDelta()
calculate error field
void SetInputCalculator(TNeuronInput *calculator)
set input calculator