32 #ifndef ROOT_TMVA_MsgLogger
35 #ifndef ROOT_TMVA_TActivation
38 #ifndef ROOT_TMVA_Tools
41 #ifndef ROOT_TMVA_TNeuronInput
81 fInputCalculator =
NULL;
98 if (fForcedValue)
return;
99 fValue = fInputCalculator->GetInput(
this);
107 if (fActivation ==
NULL) {
108 PrintMessage(
kWARNING ,
"No activation equation specified." );
112 fActivationValue = fActivation->Eval(
fValue);
122 if (IsInputNeuron()) {
131 if (IsOutputNeuron()) error = fError;
144 if (synapse ==
NULL)
break;
150 fDelta = error * fActivation->EvalDerivative(GetValue());
158 if (fInputCalculator !=
NULL)
delete fInputCalculator;
159 fInputCalculator = calculator;
167 if (fActivation !=
NULL)
delete fActivation;
168 fActivation = activation;
176 if (IsInputNeuron())
return;
185 if (IsOutputNeuron())
return;
186 fLinksOut->Add(post);
194 DeleteLinksArray(fLinksIn);
202 if (links ==
NULL)
return;
206 for (
Int_t i=0; i<numLinks; i++) {
208 if (synapse !=
NULL)
delete synapse;
219 if (!IsOutputNeuron())
220 PrintMessage(
kWARNING,
"Warning! Setting an error on a non-output neuron is probably not what you want to do." );
231 if (IsInputNeuron())
return;
237 if (synapse ==
NULL)
break;
249 if (IsInputNeuron())
return;
256 if (synapse ==
NULL)
break;
270 if (IsInputNeuron())
return;
278 if (synapse ==
NULL)
break;
291 if (IsInputNeuron())
return;
299 if (synapse ==
NULL)
break;
318 for (
Int_t i = 0; i < numLinks; i++) {
321 "\t\t\tweighta: " << synapse->
GetWeight()
334 if (fActivation !=
NULL)
Log() <<
kDEBUG << fActivation->GetExpression() <<
Endl;
343 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...
std::map< std::string, std::string >::const_iterator iter
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
ClassImp(TNeuron) TNeuron
Usual constructor.