485 data->Draw(
Form(
">>fTestList_%zu",(
size_t)
this),(
const char *)
testcut,
"goff");
491 Warning(
"TMultiLayerPerceptron::TMultiLayerPerceptron",
"Data not set. Cannot define datasets");
568 data->Draw(
Form(
">>fTestList_%zu",(
size_t)
this),(
const char *)
testcut,
"goff");
574 Warning(
"TMultiLayerPerceptron::TMultiLayerPerceptron",
"Data not set. Cannot define datasets");
601 std::cerr <<
"Error: data already defined." << std::endl;
663 fData->
Draw(
Form(
">>fTrainingList_%zu",(
size_t)
this),train,
"goff");
667 Warning(
"TMultiLayerPerceptron::TMultiLayerPerceptron",
"Data not set. Cannot define datasets");
691 Warning(
"TMultiLayerPerceptron::TMultiLayerPerceptron",
"Data not set. Cannot define datasets");
831 Error(
"Train",
"Training/Test samples still not defined. Cannot train the neural network");
834 Info(
"Train",
"Using %d train and %d test entries.",
838 std::cout <<
"Training the Neural Network" << std::endl;
842 canvas =
new TCanvas(
"NNtraining",
"Neural Net training");
845 if(!canvas) canvas =
new TCanvas(
"NNtraining",
"Neural Net training");
866 for (i = 0; i <
els; i++)
904 for (i = 0; i <
els; i++)
905 onorm += dir[i] * dir[i];
913 prod -= dir[idx++] * neuron->
GetDEDw();
919 prod -= dir[idx++] *
synapse->GetDEDw();
936 for (i = 0; i <
els; i++)
937 onorm += dir[i] * dir[i];
978 Error(
"TMultiLayerPerceptron::Train()",
"Line search fail");
988 Error(
"TMultiLayerPerceptron::Train()",
"Stop.");
998 std::cout <<
"Epoch: " <<
iepoch
1009 for (i = 1; i <
nEpoch; i++) {
1030 std::cout <<
"Training done." << std::endl;
1034 "Training sample",
"L");
1036 "Test sample",
"L");
1094 Int_t nEvents = list->GetN();
1095 for (i = 0; i < nEvents; i++) {
1096 error +=
GetError(list->GetEntry(i));
1100 for (i = 0; i < nEvents; i++) {
1117 return (error / 2.);
1142 if (output == 0.0 || output == 1.0)
1193 for (i = 0; i < nEvents; i++) {
1220 for (i = 0; i < nEvents; i++) {
1282 Bool_t normalize =
false;
1352 if(
f.GetMultiplicity()==1 &&
f.GetNdata()>1) {
1353 Warning(
"TMultiLayerPerceptron::ExpandStructure()",
"Variable size arrays cannot be used to build implicitly an input layer. The index 0 will be assumed.");
1360 else if(
f.GetNdata()>1) {
1393 hidden(hidden.
Last(
':') + 1,
1395 if (
input.Length() == 0) {
1396 Error(
"BuildNetwork()",
"malformed structure. No input layer.");
1399 if (output.
Length() == 0) {
1400 Error(
"BuildNetwork()",
"malformed structure. No output layer.");
1458 Error(
"BuildOneHiddenLayer",
1459 "The specification '%s' for hidden layer %d must contain only numbers!",
1463 for (
Int_t i = 0; i < num; i++) {
1551 Error(
"DrawResult()",
"no such output.");
1556 new TCanvas(
"NNresult",
"Neural Net output");
1568 if ((!
fData) || (!events)) {
1569 Error(
"DrawResult()",
"no dataset.");
1574 TString title =
"Neural Net Output control. ";
1582 for (i = 0; i < nEvents; i++) {
1589 TString title =
"Neural Net Output. ";
1597 for (i = 0; i < nEvents; i++)
1607 nEvents = events->
GetN();
1608 for (i = 0; i < nEvents; i++)
1622 std::ostream * output;
1624 Error(
"TMultiLayerPerceptron::DumpWeights()",
"Invalid file name");
1628 output = &std::cout;
1630 output =
new std::ofstream(
filen.Data());
1632 *output <<
"#input normalization" << std::endl;
1640 *output <<
"#output normalization" << std::endl;
1647 *output <<
"#neurons weights" << std::endl;
1650 *output << neuron->
GetWeight() << std::endl;
1654 *output <<
"#synapses weights" << std::endl;
1656 *output <<
synapse->GetWeight() << std::endl;
1659 ((std::ofstream *) output)->close();
1674 Error(
"TMultiLayerPerceptron::LoadWeights()",
"Invalid file name");
1677 char *
buff =
new char[100];
1756 Warning(
"TMultiLayerPerceptron::Export",
"Request to export a network using an external function");
1772 headerfile <<
"class " << classname <<
" { " << std::endl;
1774 headerfile <<
" " << classname <<
"() {}" << std::endl;
1775 headerfile <<
" ~" << classname <<
"() {}" << std::endl;
1776 sourcefile <<
"#include \"" << header <<
"\"" << std::endl;
1777 sourcefile <<
"#include <cmath>" << std::endl << std::endl;
1779 sourcefile <<
"double " << classname <<
"::Value(int index";
1787 sourcefile <<
" input" << i <<
" = (in" << i <<
" - "
1791 sourcefile <<
" switch(index) {" << std::endl;
1796 sourcefile <<
" case " << idx++ <<
":" << std::endl
1797 <<
" return neuron" << neuron <<
"();" << std::endl;
1799 <<
" return 0.;" << std::endl <<
" }"
1802 headerfile <<
" double Value(int index, double* input);" << std::endl;
1803 sourcefile <<
"double " << classname <<
"::Value(int index, double* input) {" << std::endl;
1805 sourcefile <<
" input" << i <<
" = (input[" << i <<
"] - "
1809 sourcefile <<
" switch(index) {" << std::endl;
1814 sourcefile <<
" case " << idx++ <<
":" << std::endl
1815 <<
" return neuron" << neuron <<
"();" << std::endl;
1817 <<
" return 0.;" << std::endl <<
" }"
1822 headerfile <<
" double input" << i <<
";" << std::endl;
1827 if (!neuron->
GetPre(0)) {
1828 headerfile <<
" double neuron" << neuron <<
"();" << std::endl;
1829 sourcefile <<
"double " << classname <<
"::neuron" << neuron
1830 <<
"() {" << std::endl;
1831 sourcefile <<
" return input" << idx++ <<
";" << std::endl;
1834 headerfile <<
" double input" << neuron <<
"();" << std::endl;
1835 sourcefile <<
"double " << classname <<
"::input" << neuron
1836 <<
"() {" << std::endl;
1838 <<
";" << std::endl;
1842 sourcefile <<
" input += synapse" <<
syn <<
"();" << std::endl;
1847 headerfile <<
" double neuron" << neuron <<
"();" << std::endl;
1848 sourcefile <<
"double " << classname <<
"::neuron" << neuron <<
"() {" << std::endl;
1849 sourcefile <<
" double input = input" << neuron <<
"();" << std::endl;
1853 sourcefile <<
" return ((input < -709. ? 0. : (1/(1+exp(-input)))) * ";
1868 sourcefile <<
" return (exp(-input*input) * ";
1878 sourcefile <<
" + exp(input" << side <<
"())";
1897 sourcefile <<
"double " << classname <<
"::synapse"
1898 <<
synapse <<
"() {" << std::endl;
1900 <<
"()*" <<
synapse->GetWeight() <<
");" << std::endl;
1904 headerfile <<
"};" << std::endl << std::endl;
1908 std::cout << header <<
" and " <<
source <<
" created." << std::endl;
1910 else if(
lg ==
"FORTRAN") {
1912 std::ofstream
sigmoid(
"sigmoid.f");
1913 sigmoid <<
" double precision FUNCTION SIGMOID(X)" << std::endl
1915 <<
" IF(X.GT.37.) THEN" << std::endl
1916 <<
" SIGMOID = 1." << std::endl
1917 <<
" ELSE IF(X.LT.-709.) THEN" << std::endl
1918 <<
" SIGMOID = 0." << std::endl
1919 <<
" ELSE" << std::endl
1920 <<
" SIGMOID = 1./(1.+EXP(-X))" << std::endl
1921 <<
" ENDIF" << std::endl
1922 <<
" END" << std::endl;
1930 <<
"(x, index)" << std::endl;
1936 sourcefile <<
"C --- Last Layer" << std::endl;
1944 <<
"=neuron" << neuron <<
"(x);" << std::endl;
1948 <<
" " <<
filename <<
"=0.d0" << std::endl
1949 <<
" endif" << std::endl;
1953 sourcefile <<
"C --- First and Hidden layers" << std::endl;
1958 sourcefile <<
" double precision function neuron"
1959 << neuron <<
"(x)" << std::endl
1963 if (!neuron->
GetPre(0)) {
1965 <<
" = (x(" << idx+1 <<
") - "
1969 <<
"d0" << std::endl;
1973 <<
" = " << neuron->
GetWeight() <<
"d0" << std::endl;
1978 <<
" = neuron" << neuron
1979 <<
" + synapse" <<
syn <<
"(x)" << std::endl;
1984 <<
"= (sigmoid(neuron" << neuron <<
")*";
1994 <<
"= (tanh(neuron" << neuron <<
")*";
2000 <<
"= (exp(-neuron" << neuron <<
"*neuron"
2008 sourcefile <<
" div = exp(neuron" << side <<
"())" << std::endl;
2010 sourcefile <<
" div = div + exp(neuron" << side <<
"())" << std::endl;
2012 sourcefile <<
"= (exp(neuron" << neuron <<
") / div * ";
2017 sourcefile <<
" neuron " << neuron <<
"= 0.";
2032 sourcefile <<
" double precision function " <<
"synapse"
2037 <<
"=neuron" <<
synapse->GetPre()
2038 <<
"(x)*" <<
synapse->GetWeight() <<
"d0" << std::endl;
2039 sourcefile <<
" end" << std::endl << std::endl;
2043 std::cout <<
source <<
" created." << std::endl;
2045 else if(
lg ==
"PYTHON") {
2050 pythonfile <<
"from math import exp" << std::endl << std::endl;
2051 pythonfile <<
"from math import tanh" << std::endl << std::endl;
2052 pythonfile <<
"class " << classname <<
":" << std::endl;
2059 pythonfile <<
"\t\tself.input" << i <<
" = (in" << i <<
" - "
2067 <<
": return self.neuron" << neuron <<
"();" << std::endl;
2073 pythonfile <<
"\tdef neuron" << neuron <<
"(self):" << std::endl;
2075 pythonfile <<
"\t\treturn self.input" << idx++ << std::endl;
2081 pythonfile <<
"\t\tinput = input + self.synapse"
2082 <<
syn <<
"()" << std::endl;
2087 pythonfile <<
"\t\treturn ((1/(1+exp(-input)))*";
2102 pythonfile <<
"\t\treturn (exp(-input*input)*";
2110 pythonfile <<
"exp(self.neuron" << side <<
"())";
2112 pythonfile <<
" + exp(self.neuron" << side <<
"())";
2131 <<
"()*" <<
synapse->GetWeight() <<
")" << std::endl;
2135 std::cout <<
pyfile <<
" created." << std::endl;
2157 for (
Int_t i = 0; i <
n; i++) {
2175 for (i = 0; i < nEvents; i++)
2181 for (i = 0; i < nEvents; i++) {
2272 dir[idx++] = -neuron->
GetDEDw();
2276 dir[idx++] = -
synapse->GetDEDw();
2400 dir[idx] = -neuron->
GetDEDw() + beta * dir[idx];
2406 dir[idx] = -
synapse->GetDEDw() + beta * dir[idx];
2454 gamma[idx++][0] = -neuron->
GetDEDw();
2459 gamma[idx++][0] = -
synapse->GetDEDw();
2462 delta[i].Assign(buffer[i]);
2469 gamma[idx++][0] += neuron->
GetDEDw();
2474 gamma[idx++][0] +=
synapse->GetDEDw();
2492 output += neuron->
GetDEDw() * dir[idx++];
2497 output +=
synapse->GetDEDw() * dir[idx++];
2538#define NeuronSize 2.5
2658 if (neuron && neuron->
GetName()) {
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
TMatrixT< Double_t > TMatrixD
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual void SetLeftMargin(Float_t leftmargin)
Set Pad left margin in fraction of the pad width.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TDirectory::TContext keeps track and restore the current directory.
<div class="legacybox"><h2>Legacy Code</h2> TEventList is a legacy interface: there will be no bug fi...
virtual Long64_t GetEntry(Int_t index) const
Return value of entry at index in the list.
virtual Int_t GetN() const
virtual void SetDirectory(TDirectory *dir)
Remove reference to this EventList from current directory and add reference to new directory dir.
A TGraph is an object made of two arrays X and Y with npoints each.
1-D histogram with a double per channel (see TH1 documentation)
void Reset(Option_t *option="") override
Reset.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
2-D histogram with a double per channel (see TH1 documentation)
void Reset(Option_t *option="") override
Reset this histogram: contents, errors, etc.
Int_t Fill(Double_t) override
Invalid Fill method.
This class displays a legend box (TPaveText) containing several legend entries.
Use the TLine constructor to create a simple line.
void Draw(Option_t *option="") override
Draw this marker with its current attributes.
A TMultiGraph is a collection of TGraph (or derived) objects.
This class describes a neural network.
TTreeFormula * fEventWeight
! formula representing the event weight
void BuildOneHiddenLayer(const TString &sNumNodes, Int_t &layer, Int_t &prevStart, Int_t &prevStop, Bool_t lastLayer)
Builds a hidden layer, updates the number of layers.
void SteepestDir(Double_t *)
Sets the search direction to steepest descent.
void BuildNetwork()
Instantiates the network from the description.
TObjArray fNetwork
Collection of all the neurons in the network.
Double_t Evaluate(Int_t index, Double_t *params) const
Returns the Neural Net for a given set of input parameters #parameters must equal #input neurons.
TEventList * fTest
! EventList defining the events in the test dataset
bool GetBFGSH(TMatrixD &, TMatrixD &, TMatrixD &)
Computes the hessian matrix using the BFGS update algorithm.
void BuildHiddenLayers(TString &)
Builds hidden layers.
void BuildFirstLayer(TString &)
Instantiates the neurons in input Inputs are normalised and the type is set to kOff (simple forward o...
void SetTau(Double_t tau)
Sets Tau - used in line search (look at the constructor for the complete description of learning meth...
TMultiLayerPerceptron()
Default constructor.
Double_t GetSumSquareError() const
Error on the output for a given event.
void ConjugateGradientsDir(Double_t *, Double_t)
Sets the search direction to conjugate gradient direction beta should be:
Double_t fTau
! Tau - used in line search - Default=3.
TTree * fData
! pointer to the tree used as datasource
Double_t Result(Int_t event, Int_t index=0) const
Computes the output for a given event.
void SetGammaDelta(TMatrixD &, TMatrixD &, Double_t *)
Sets the gamma and delta vectors Gamma is computed here, so ComputeDEDw cannot have been called bef...
TEventList * fTraining
! EventList defining the events in the training dataset
TString fStructure
String containing the network structure.
Int_t fReset
! number of epochs between two resets of the search direction to the steepest descent - Default=50
Bool_t LoadWeights(Option_t *filename="")
Loads the weights from a text file conforming to the format defined by DumpWeights.
void MLP_Batch(Double_t *)
One step for the batch (stochastic) method.
TNeuron::ENeuronType fOutType
Type of output neurons.
Double_t fCurrentTreeWeight
! weight of the current tree in a chain
ELearningMethod fLearningMethod
! The Learning Method
Double_t fLastAlpha
! internal parameter used in line search
Int_t fCurrentTree
! index of the current tree in a chain
void Export(Option_t *filename="NNfunction", Option_t *language="C++") const
Exports the NN as a function for any non-ROOT-dependant code Supported languages are: only C++ ,...
Double_t fEpsilon
! Epsilon - used in stochastic minimisation - Default=0.
void Train(Int_t nEpoch, Option_t *option="text", Double_t minE=0)
Train the network.
TNeuron::ENeuronType GetType() const
void BFGSDir(TMatrixD &, Double_t *)
Computes the direction for the BFGS algorithm as the product between the Hessian estimate (bfgsh) and...
void SetTestDataSet(TEventList *test)
Sets the Test dataset.
Bool_t fTrainingOwner
! internal flag whether one has to delete fTraining or not
void SetLearningMethod(TMultiLayerPerceptron::ELearningMethod method)
Sets the learning method.
void SetTrainingDataSet(TEventList *train)
Sets the Training dataset.
void BuildLastLayer(TString &, Int_t)
Builds the output layer Neurons are linear combinations of input, by default.
Double_t fDelta
! Delta - used in stochastic minimisation - Default=0.
TTreeFormulaManager * fManager
! TTreeFormulaManager for the weight and neurons
void Randomize() const
Randomize the weights.
Bool_t LineSearch(Double_t *, Double_t *)
Search along the line defined by direction.
void ExpandStructure()
Expand the structure of the first layer.
Double_t fEta
! Eta - used in stochastic minimisation - Default=0.1
Double_t GetError(Int_t event) const
Error on the output for a given event.
Double_t fEtaDecay
! EtaDecay - Eta *= EtaDecay at each epoch - Default=1.
void SetEtaDecay(Double_t ed)
Sets EtaDecay - Eta *= EtaDecay at each epoch (look at the constructor for the complete description o...
void AttachData()
Connects the TTree to Neurons in input and output layers.
void SetData(TTree *)
Set the data source.
void SetEventWeight(const char *)
Set the event weight.
Bool_t DumpWeights(Option_t *filename="-") const
Dumps the weights to a text file.
TString fWeight
String containing the event weight.
void SetDelta(Double_t delta)
Sets Delta - used in stochastic minimisation (look at the constructor for the complete description of...
~TMultiLayerPerceptron() override
Destructor.
Double_t GetCrossEntropy() const
Cross entropy error for a softmax output neuron, for a given event.
void SetReset(Int_t reset)
Sets number of epochs between two resets of the search direction to the steepest descent.
Bool_t fTestOwner
! internal flag whether one has to delete fTest or not
void Shuffle(Int_t *, Int_t) const
Shuffle the Int_t index[n] in input.
Double_t DerivDir(Double_t *)
scalar product between gradient and direction = derivative along direction
void MLP_Stochastic(Double_t *)
One step for the stochastic method buffer should contain the previous dw vector and will be updated.
void Draw(Option_t *option="") override
Draws the network structure.
TObjArray fSynapses
Collection of all the synapses in the network.
void MLP_Line(Double_t *, Double_t *, Double_t)
Sets the weights to a point along a line Weights are set to [origin + (dist * dir)].
TNeuron::ENeuronType fType
Type of hidden neurons.
TObjArray fLastLayer
Collection of the output neurons; subset of fNetwork.
TString fextD
String containing the derivative name.
void ComputeDEDw() const
Compute the DEDw = sum on all training events of dedw for each weight normalized by the number of eve...
Double_t GetCrossEntropyBinary() const
Cross entropy error for sigmoid output neurons, for a given event.
void DrawResult(Int_t index=0, Option_t *option="test") const
Draws the neural net output It produces an histogram with the output for the two datasets.
void SetEta(Double_t eta)
Sets Eta - used in stochastic minimisation (look at the constructor for the complete description of l...
TObjArray fFirstLayer
Collection of the input neurons; subset of fNetwork.
void GetEntry(Int_t) const
Load an entry into the network.
void SetEpsilon(Double_t eps)
Sets Epsilon - used in stochastic minimisation (look at the constructor for the complete description ...
TString fextF
String containing the function name.
const char * GetName() const override
Returns name of object.
This class describes an elementary neuron, which is the basic element for a Neural Network.
Double_t GetWeight() const
void SetWeight(Double_t w)
Sets the neuron weight to w.
Double_t GetValue() const
Computes the output using the appropriate function and all the weighted inputs, or uses the branch as...
void SetDEDw(Double_t in)
Sets the derivative of the total error wrt the neuron weight.
Double_t GetDeDw() const
Computes the derivative of the error wrt the neuron weight.
Double_t GetBranch() const
Returns the formula value.
TNeuron * GetInLayer(Int_t n) const
Double_t GetError() const
Computes the error for output neurons.
TTreeFormula * UseBranch(TTree *, const char *)
Sets a formula that can be used to make the neuron an input.
TSynapse * GetPre(Int_t n) const
void ForceExternalValue(Double_t value)
Uses the branch type to force an external value.
Double_t GetTarget() const
Computes the normalized target pattern for output neurons.
const Double_t * GetNormalisation() const
ENeuronType GetType() const
Returns the neuron type.
void SetNewEvent() const
Inform the neuron that inputs of the network have changed, so that the buffered values have to be rec...
void SetNormalisation(Double_t mean, Double_t RMS)
Sets the normalization variables.
void AddInLayer(TNeuron *)
Tells a neuron which neurons form its layer (including itself).
Iterator of object array.
TObject * Next() override
Return next object in array. Returns 0 when no more objects in array.
Int_t GetEntriesFast() const
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Returns an array iterator.
TObject * At(Int_t idx) const override
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
TObject * UncheckedAt(Int_t i) const
Collectable string class.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Random number generator class based on M.
Regular expression class.
void ToLower()
Change string to lower-case.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
This is a simple weighted bidirectional connection between two neurons.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Base class for several text objects.
The TTimeStamp encapsulates seconds and ns since EPOCH.
A TTree represents a columnar dataset.
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
virtual Double_t GetWeight() const
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Long64_t GetEntries() const
virtual Int_t GetTreeNumber() const
TVirtualPad is an abstract base class for the Pad and Canvas classes.
virtual void Modified(Bool_t flag=1)=0
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.