|
ATLAS Offline Software
|
#include <TJetNet.h>
|
| TJetNet (void) |
|
| TJetNet (Int_t aTestCount, Int_t aTrainCount, const Int_t aLayersCnt, const Int_t *aLayers) |
|
virtual | ~TJetNet (void) |
|
void | Print (void) |
|
Int_t | GetTrainSetCnt (void) const |
|
Int_t | GetTestSetCnt (void) const |
|
Int_t | GetInputDim (void) const |
|
Int_t | GetHiddenLayerDim (void) const |
|
Int_t | GetHiddenLayerSize (Int_t number) const |
|
Int_t | GetOutputDim (void) const |
|
void | SetInputTrainSet (Int_t aPatternInd, Int_t aInputInd, Double_t aValue) |
|
void | SetOutputTrainSet (Int_t aPatternInd, Int_t aOutputInd, Double_t aValue) |
|
void | SetInputTestSet (Int_t aPatternInd, Int_t aInputInd, Double_t aValue) |
|
void | SetOutputTestSet (Int_t aPatternInd, Int_t aOutputInd, Double_t aValue) |
|
void | SetEventWeightTrainSet (Int_t aPatternInd, Double_t aValue) |
|
void | SetEventWeightTestSet (Int_t aPatternInd, Double_t aValue) |
|
Double_t | GetInputTrainSet (Int_t aPatternInd, Int_t aInputInd) |
|
Double_t | GetOutputTrainSet (Int_t aPatternInd, Int_t aOutputInd) |
|
Double_t | GetInputTestSet (Int_t aPatternInd, Int_t aInputInd) |
|
Double_t | GetOutputTestSet (Int_t aPatternInd, Int_t aOutputInd) |
|
Double_t | GetEventWeightTrainSet (Int_t aPatternInd) |
|
Double_t | GetEventWeightTestSet (Int_t aPatternInd) |
|
Double_t | GetWeight (Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd) const |
|
Double_t | GetThreshold (Int_t aLayerInd, Int_t aNodeInd) const |
|
Int_t | GetEpochs (void) |
|
void | SetEpochs (const Int_t aEpochs) |
|
void | Init (void) |
|
Double_t | Train (void) |
|
Int_t | Epoch (void) |
|
Double_t | Test (void) |
|
Double_t | TestBTAG (void) |
|
void | Shuffle (Bool_t aShuffleTrainSet=true, Bool_t aShuffleTestSet=true) |
|
void | SaveDataAscii (TString aFileName="jndata.dat") |
|
void | SaveDataRoot (TString aFileName="jndata.root") |
|
void | LoadDataAscii (TString aFileName="jndata.dat") |
|
void | LoadDataRoot (TString aFileName="jndata.root") |
|
void | DumpToFile (TString aFileName="fort.8") |
|
void | ReadFromFile (TString aFileName="fort.8") |
|
Double_t | GetOutput (Int_t aIndex=0) |
|
void | SetInputs (Int_t aIndex=0, Double_t aValue=0.0) |
|
void | Evaluate (Int_t aPattern) |
|
void | Evaluate () |
|
void | writeNetworkInfo (Int_t typeOfInfo=0) |
|
Int_t | GetLayerCount (void) |
|
Int_t | GetUnitCount (Int_t aLayer) |
|
void | SelectiveFields (Int_t aLayerA, Int_t aNodeA1, Int_t aNodeA2, Int_t aNodeB1, Int_t aNodeB2, Int_t aSwitch=0) |
|
void | SetUpdatesPerEpoch (Int_t aValue) |
|
void | SetUpdatingProcedure (Int_t aValue) |
|
void | SetErrorMeasure (Int_t aValue) |
|
void | SetActivationFunction (Int_t aValue) |
|
void | SetActivationFunction (Int_t aValue, Int_t layerN) |
|
void | SetPatternsPerUpdate (Int_t aValue) |
|
void | SetLearningRate (Double_t aValue) |
|
void | SetMomentum (Double_t aValue) |
|
void | SetInitialWeightsWidth (Double_t aValue) |
|
void | SetLearningRateDecrease (Double_t aValue) |
|
void | SetPottsUnits (Int_t aValue) |
|
Int_t | GetUpdatesPerEpoch (void) |
|
Int_t | GetUpdatingProcedure (void) |
|
Int_t | GetErrorMeasure (void) |
|
Int_t | GetActivationFunction (void) const |
|
Int_t | GetActivationFunction (Int_t layerN) const |
|
Int_t | GetPatternsPerUpdate (void) |
|
Double_t | GetLearningRate (void) |
|
Double_t | GetMomentum (void) |
|
Double_t | GetInitialWeightsWidth (void) |
|
Double_t | GetLearningRateDecrease (void) |
|
Int_t | GetPottsUnits () |
|
void | LockInit (void) |
|
void | UnlockInit (void) |
|
Int_t | GetMSTJN (Int_t aIndex) |
|
Double_t | GetPARJN (Int_t aIndex) |
|
void | SetMSTJN (Int_t aIndex, Int_t aValue) |
|
void | SetPARJN (Int_t aIndex, Double_t aValue) |
|
void | Normalize (void) |
|
void | Randomize (void) |
|
TTrainedNetwork * | createTrainedNetwork () const |
|
void | readBackTrainedNetwork (const TTrainedNetwork *) |
|
void | NormalizeOutput (bool isTrue=true) |
|
Definition at line 40 of file TJetNet.h.
◆ TActivationFunction
Enumerator |
---|
afSigmoid | |
afTanh | |
afExp | |
afLinear | |
afSigmoidEntropy | |
Definition at line 150 of file TJetNet.h.
◆ TJetNet() [1/2]
TJetNet::TJetNet |
( |
void |
| ) |
|
◆ TJetNet() [2/2]
TJetNet::TJetNet |
( |
Int_t |
aTestCount, |
|
|
Int_t |
aTrainCount, |
|
|
const Int_t |
aLayersCnt, |
|
|
const Int_t * |
aLayers |
|
) |
| |
Definition at line 38 of file TJetNet.cxx.
53 if(
m_Debug ){ std::cout <<
"=====> Entering TJetNet::TJetNet(...)" << std::endl; }
88 if(
m_Debug ){ std::cout <<
"=====> Leaving TJetNet::TJetNet(...)" << std::endl; }
◆ ~TJetNet()
TJetNet::~TJetNet |
( |
void |
| ) |
|
|
virtual |
Definition at line 91 of file TJetNet.cxx.
94 if(
m_Debug ){ std::cout <<
"=====> Entering TJetNet::~TJetNet(...)" << std::endl; }
100 if(
m_Debug ){ std::cout <<
"=====> Leaving TJetNet::~TJetNet(...)" << std::endl; }
◆ CopyFile()
Int_t TJetNet::CopyFile |
( |
TString |
aSrcFile, |
|
|
TString |
aDestFile |
|
) |
| |
|
private |
◆ createTrainedNetwork()
Definition at line 104 of file TJetNet.cxx.
109 std::vector<Int_t> nHiddenLayerSize;
112 for (Int_t o=0;o<nHidden;++o)
118 std::vector<TVectorD*> thresholdVectors;
119 std::vector<TMatrixD*> weightMatrices;
121 for (Int_t o=0;o<nHidden+1;++o)
123 int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
124 int sizePreviousLayer=(o==0)?nInput:nHiddenLayerSize[o-1];
125 thresholdVectors.push_back(
new TVectorD(sizeActualLayer));
126 weightMatrices.push_back(
new TMatrixD(sizePreviousLayer,sizeActualLayer));
129 for (Int_t o=0;o<nHidden+1;++o)
135 cout <<
" Iterating on hidden layer n.: " << o << endl;
139 cout <<
" Considering output layer " << endl;
142 int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
144 for (Int_t
s=0;
s<sizeActualLayer;++
s)
149 cout <<
" To hidden node: " <<
s << endl;
154 cout <<
" To output node: " <<
s << endl;
158 for (Int_t
p=0;
p<nInput;++
p)
161 cout <<
" W from inp nod: " <<
p <<
"weight: " <<
163 weightMatrices[o]->operator() (
p,
s) =
GetWeight(o+1,
s+1,
p+1);
168 for (Int_t
p=0;
p<nHiddenLayerSize[o-1];++
p)
171 cout <<
" W from lay : " << o-1 <<
" nd: " <<
178 cout <<
" Threshold for node " <<
s <<
" : " <<
184 bool linearOutput=
false;
202 return trainedNetwork;
◆ DumpToFile()
void TJetNet::DumpToFile |
( |
TString |
aFileName = "fort.8" | ) |
|
Definition at line 954 of file TJetNet.cxx.
958 std::cout << close( 8 ) << std::endl;
959 rename(
"./fort.8", aFileName );
◆ Epoch()
Int_t TJetNet::Epoch |
( |
void |
| ) |
|
Definition at line 696 of file TJetNet.cxx.
700 Double_t aTrain, aTest;
715 std::cout <<
"[ " <<
m_CurrentEpoch <<
" ] Train: " << aTrain << std::endl;
722 std::cout <<
"Test: " << aTest << std::endl;
◆ Evaluate() [1/2]
void TJetNet::Evaluate |
( |
| ) |
|
◆ Evaluate() [2/2]
void TJetNet::Evaluate |
( |
Int_t |
aPattern | ) |
|
◆ GetActivationFunction() [1/2]
Int_t TJetNet::GetActivationFunction |
( |
Int_t |
layerN | ) |
const |
◆ GetActivationFunction() [2/2]
Int_t TJetNet::GetActivationFunction |
( |
void |
| ) |
const |
◆ GetEpochs()
Int_t TJetNet::GetEpochs |
( |
void |
| ) |
|
|
inline |
◆ GetErrorMeasure()
Int_t TJetNet::GetErrorMeasure |
( |
void |
| ) |
|
◆ GetEventWeightTestSet()
Double_t TJetNet::GetEventWeightTestSet |
( |
Int_t |
aPatternInd | ) |
|
|
inline |
◆ GetEventWeightTrainSet()
Double_t TJetNet::GetEventWeightTrainSet |
( |
Int_t |
aPatternInd | ) |
|
|
inline |
◆ GetHiddenLayerDim()
Int_t TJetNet::GetHiddenLayerDim |
( |
void |
| ) |
const |
|
inline |
Definition at line 55 of file TJetNet.h.
55 {
return mHiddenLayerDim; };
◆ GetHiddenLayerSize()
Int_t TJetNet::GetHiddenLayerSize |
( |
Int_t |
number | ) |
const |
|
inline |
◆ GetInitialWeightsWidth()
Double_t TJetNet::GetInitialWeightsWidth |
( |
void |
| ) |
|
◆ GetInputDim()
Int_t TJetNet::GetInputDim |
( |
void |
| ) |
const |
|
inline |
◆ GetInputTestSet()
Double_t TJetNet::GetInputTestSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aInputInd |
|
) |
| |
◆ GetInputTrainSet()
Double_t TJetNet::GetInputTrainSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aInputInd |
|
) |
| |
|
inline |
◆ GetLayerCount()
Int_t TJetNet::GetLayerCount |
( |
void |
| ) |
|
|
inline |
◆ GetLearningRate()
Double_t TJetNet::GetLearningRate |
( |
void |
| ) |
|
◆ GetLearningRateDecrease()
Double_t TJetNet::GetLearningRateDecrease |
( |
void |
| ) |
|
◆ GetMomentum()
Double_t TJetNet::GetMomentum |
( |
void |
| ) |
|
◆ GetMSTJN()
Int_t TJetNet::GetMSTJN |
( |
Int_t |
aIndex | ) |
|
◆ GetOutput()
Double_t TJetNet::GetOutput |
( |
Int_t |
aIndex = 0 | ) |
|
◆ GetOutputDim()
Int_t TJetNet::GetOutputDim |
( |
void |
| ) |
const |
|
inline |
◆ GetOutputTestSet()
Double_t TJetNet::GetOutputTestSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aOutputInd |
|
) |
| |
◆ GetOutputTrainSet()
Double_t TJetNet::GetOutputTrainSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aOutputInd |
|
) |
| |
◆ GetPARJN()
Double_t TJetNet::GetPARJN |
( |
Int_t |
aIndex | ) |
|
◆ GetPatternsPerUpdate()
Int_t TJetNet::GetPatternsPerUpdate |
( |
void |
| ) |
|
◆ GetPottsUnits()
Int_t TJetNet::GetPottsUnits |
( |
| ) |
|
◆ GetTestSetCnt()
Int_t TJetNet::GetTestSetCnt |
( |
void |
| ) |
const |
|
inline |
◆ GetThreshold()
Double_t TJetNet::GetThreshold |
( |
Int_t |
aLayerInd, |
|
|
Int_t |
aNodeInd |
|
) |
| const |
◆ GetTrainSetCnt()
Int_t TJetNet::GetTrainSetCnt |
( |
void |
| ) |
const |
|
inline |
◆ GetUnitCount()
Int_t TJetNet::GetUnitCount |
( |
Int_t |
aLayer | ) |
|
◆ GetUpdatesPerEpoch()
Int_t TJetNet::GetUpdatesPerEpoch |
( |
void |
| ) |
|
◆ GetUpdatingProcedure()
Int_t TJetNet::GetUpdatingProcedure |
( |
void |
| ) |
|
◆ GetWeight()
Double_t TJetNet::GetWeight |
( |
Int_t |
aLayerInd, |
|
|
Int_t |
aNodeInd, |
|
|
Int_t |
aConnectedNodeInd |
|
) |
| const |
Definition at line 972 of file TJetNet.cxx.
975 return Double_t (
JNINT1.W[
JNINDX( aLayerInd, aNodeInd, aConnectedNodeInd )-1 ] );
◆ Init()
void TJetNet::Init |
( |
void |
| ) |
|
Definition at line 670 of file TJetNet.cxx.
679 if (
m_Debug ) std::cout <<
"Layer " <<
i + 1 <<
" has " <<
m_pLayers[
i ] <<
" units." << std::endl;
683 cout <<
" calling JNINIT " << endl;
688 std::cout <<
" Setting to normalize output nodes: POTT nodes " << std::endl;
692 cout <<
" finishing calling JNINIT " << endl;
◆ LoadDataAscii()
void TJetNet::LoadDataAscii |
( |
TString |
aFileName = "jndata.dat" | ) |
|
Definition at line 815 of file TJetNet.cxx.
823 Int_t iPatternLength;
825 in.open( aFileName );
826 bFlag = Bool_t( in.is_open() );
836 if(
m_Debug ){ std::cout <<
"Updating the Layers Nodes Counters..." << std::endl; }
840 if(
m_Debug ){ std::cout <<
"Layer [ " <<
i + 1 <<
" ] has " <<
m_pLayers[
i ] <<
" units" << std::endl; }
850 if(
m_Debug ){ std::cout <<
"Patterns per line = " << iPatternLength << std::endl; }
854 if(
m_Debug ){ std::cout <<
"Test Set has " <<
m_TestSetCnt <<
" patterns." << std::endl; }
872 while( ( j < iPatternLength ) && ( !in.eof() ) )
◆ LoadDataRoot()
void TJetNet::LoadDataRoot |
( |
TString |
aFileName = "jndata.root" | ) |
|
◆ LockInit()
void TJetNet::LockInit |
( |
void |
| ) |
|
|
inline |
◆ mSetThreshold()
void TJetNet::mSetThreshold |
( |
Double_t |
threshold, |
|
|
Int_t |
aLayerInd, |
|
|
Int_t |
aNodeInd |
|
) |
| |
|
private |
◆ mSetWeight()
void TJetNet::mSetWeight |
( |
Double_t |
weight, |
|
|
Int_t |
aLayerInd, |
|
|
Int_t |
aNodeInd, |
|
|
Int_t |
aConnectedNodeInd |
|
) |
| |
|
private |
◆ Normalize()
void TJetNet::Normalize |
( |
void |
| ) |
|
◆ NormalizeOutput()
void TJetNet::NormalizeOutput |
( |
bool |
isTrue = true | ) |
|
◆ Print()
void TJetNet::Print |
( |
void |
| ) |
|
Definition at line 295 of file TJetNet.cxx.
300 std::cout <<
"TJetNet" << std::endl;
301 std::cout <<
"Number of layers: " <<
m_LayerCount << std::endl;
305 std::cout <<
"\t\tNumber of units in layer " <<
i <<
" : " <<
m_pLayers[
i ] << std::endl;
308 std::cout <<
"Epochs: " <<
GetEpochs() << std::endl;
314 std::cout <<
"Momentum: " <<
GetMomentum() << std::endl;
◆ Randomize()
void TJetNet::Randomize |
( |
void |
| ) |
|
◆ readBackTrainedNetwork()
Definition at line 207 of file TJetNet.cxx.
212 std::vector<Int_t> nHiddenLayerSize;
216 cout <<
" Network doesn't match.. not loading.." << endl;
220 for (Int_t o=0;o<nHidden;++o)
225 cout <<
" Network doesn't match... not loading..." << endl;
233 cout <<
" Network doesn't match... not loading.." << endl;
240 cout <<
" Network doesn't match.. not loading.." << endl;
247 std::vector<TMatrixD*> weightMatrices=trainedNetwork->
weightMatrices();
250 for (Int_t o=0;o<nHidden+1;++o)
252 int sizeActualLayer=(o<nHidden)?nHiddenLayerSize[o]:nOutput;
253 int sizePreviousLayer=(o==0)?nInput:nHiddenLayerSize[o-1];
255 for (Int_t
s=0;
s<sizeActualLayer;++
s)
257 Double_t nodeValue=0.;
260 for (Int_t
p=0;
p<nInput;++
p)
267 for (Int_t
p=0;
p<nHiddenLayerSize[o-1];++
p)
277 cout <<
" Setting linear output function " << endl;
281 cout <<
" Successfully read back Trained Network " << endl;
◆ ReadFromFile()
void TJetNet::ReadFromFile |
( |
TString |
aFileName = "fort.8" | ) |
|
Definition at line 962 of file TJetNet.cxx.
965 rename( aFileName,
"./fort.12" );
968 rename(
"./fort.12", aFileName );
◆ Reinitialize()
void TJetNet::Reinitialize |
( |
void |
| ) |
|
|
private |
◆ SaveDataAscii()
void TJetNet::SaveDataAscii |
( |
TString |
aFileName = "jndata.dat" | ) |
|
◆ SaveDataRoot()
void TJetNet::SaveDataRoot |
( |
TString |
aFileName = "jndata.root" | ) |
|
◆ SelectiveFields()
void TJetNet::SelectiveFields |
( |
Int_t |
aLayerA, |
|
|
Int_t |
aNodeA1, |
|
|
Int_t |
aNodeA2, |
|
|
Int_t |
aNodeB1, |
|
|
Int_t |
aNodeB2, |
|
|
Int_t |
aSwitch = 0 |
|
) |
| |
Definition at line 986 of file TJetNet.cxx.
993 i1 = TMath::Abs( aNodeA1 );
994 i2 = TMath::Abs( aNodeA2 );
995 j1 = TMath::Abs( aNodeB1 );
996 j2 = TMath::Abs( aNodeB2 );
◆ SetActivationFunction() [1/2]
void TJetNet::SetActivationFunction |
( |
Int_t |
aValue | ) |
|
◆ SetActivationFunction() [2/2]
void TJetNet::SetActivationFunction |
( |
Int_t |
aValue, |
|
|
Int_t |
layerN |
|
) |
| |
◆ SetEpochs()
void TJetNet::SetEpochs |
( |
const Int_t |
aEpochs | ) |
|
|
inline |
◆ SetErrorMeasure()
void TJetNet::SetErrorMeasure |
( |
Int_t |
aValue | ) |
|
◆ SetEventWeightTestSet()
void TJetNet::SetEventWeightTestSet |
( |
Int_t |
aPatternInd, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetEventWeightTrainSet()
void TJetNet::SetEventWeightTrainSet |
( |
Int_t |
aPatternInd, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetInitialWeightsWidth()
void TJetNet::SetInitialWeightsWidth |
( |
Double_t |
aValue | ) |
|
◆ SetInputs()
void TJetNet::SetInputs |
( |
Int_t |
aIndex = 0 , |
|
|
Double_t |
aValue = 0.0 |
|
) |
| |
◆ SetInputTestSet()
void TJetNet::SetInputTestSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aInputInd, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetInputTrainSet()
void TJetNet::SetInputTrainSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aInputInd, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetLearningRate()
void TJetNet::SetLearningRate |
( |
Double_t |
aValue | ) |
|
◆ SetLearningRateDecrease()
void TJetNet::SetLearningRateDecrease |
( |
Double_t |
aValue | ) |
|
◆ SetMomentum()
void TJetNet::SetMomentum |
( |
Double_t |
aValue | ) |
|
◆ SetMSTJN()
void TJetNet::SetMSTJN |
( |
Int_t |
aIndex, |
|
|
Int_t |
aValue |
|
) |
| |
◆ SetOutputTestSet()
void TJetNet::SetOutputTestSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aOutputInd, |
|
|
Double_t |
aValue |
|
) |
| |
|
inline |
◆ SetOutputTrainSet()
void TJetNet::SetOutputTrainSet |
( |
Int_t |
aPatternInd, |
|
|
Int_t |
aOutputInd, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetPARJN()
void TJetNet::SetPARJN |
( |
Int_t |
aIndex, |
|
|
Double_t |
aValue |
|
) |
| |
◆ SetPatternsPerUpdate()
void TJetNet::SetPatternsPerUpdate |
( |
Int_t |
aValue | ) |
|
◆ SetPottsUnits()
void TJetNet::SetPottsUnits |
( |
Int_t |
aValue | ) |
|
◆ SetUpdatesPerEpoch()
void TJetNet::SetUpdatesPerEpoch |
( |
Int_t |
aValue | ) |
|
◆ SetUpdatingProcedure()
void TJetNet::SetUpdatingProcedure |
( |
Int_t |
aValue | ) |
|
◆ Shuffle()
void TJetNet::Shuffle |
( |
Bool_t |
aShuffleTrainSet = true , |
|
|
Bool_t |
aShuffleTestSet = true |
|
) |
| |
Definition at line 1222 of file TJetNet.cxx.
1226 Int_t
Seed =
ts.GetSec();
1227 if ( aShuffleTrainSet )
1234 if ( aShuffleTestSet )
◆ Test()
Double_t TJetNet::Test |
( |
void |
| ) |
|
Definition at line 320 of file TJetNet.cxx.
324 Double_t fMeanError = 0.0;
329 for( Int_t iPattern = 0; iPattern < NPatterns; iPattern++ )
349 if(
m_Debug ) std::cout <<
"Testing [ " << iPattern <<
" ] - " <<
JNDAT1.OIN[ 0 ]
350 <<
" => " <<
JNDAT1.OUT[ 0 ] << std::endl;
354 fMeanError/=2.*NPatterns;
357 std::cout <<
" Test error: " << fMeanError << endl;
◆ TestBTAG()
Double_t TJetNet::TestBTAG |
( |
void |
| ) |
|
Definition at line 362 of file TJetNet.cxx.
369 Double_t fMeanError = 0.0;
385 TString histoEffStringC(
"histoEffC");
386 TString histoEffStringL(
"histoEffL");
389 TString string1=histoEffStringC;
395 TString string2=histoEffStringL;
401 histoEfficienciesC.push_back(
histo);
402 histoEfficienciesL.push_back(histo2);
405 for( Int_t iPattern = 0; iPattern < NPatterns; iPattern++ )
474 std::cout <<
" Filled 0 " << std::endl;
475 histoEfficienciesC[
active]->Fill( 0 );
490 std::cout <<
" Filled 0 " << std::endl;
491 histoEfficienciesL[
active]->Fill( 0 );
494 if(
m_Debug ) std::cout <<
"Testing [ " << iPattern <<
" ] - " <<
JNDAT1.OIN[ 0 ]
495 <<
" => " <<
JNDAT1.OUT[ 0 ] << std::endl;
499 if (
m_Debug) std::cout <<
" Finished patterns... " << std::endl;
501 TFile* newFile=
new TFile(
"test.root",
"recreate");
502 histoEfficienciesL[0]->Write();
503 histoEfficienciesL[1]->Write();
504 histoEfficienciesL[2]->Write();
505 histoEfficienciesC[0]->Write();
506 histoEfficienciesC[1]->Write();
507 histoEfficienciesC[2]->Write();
513 for (
int u=0;
u<2;
u++)
518 std::cout <<
"c-rej --> ";
519 myVectorHistos=&histoEfficienciesC;
523 std::cout <<
"l-rej --> ";
524 myVectorHistos=&histoEfficienciesL;
528 if (
m_Debug) std::cout <<
" 1 " << std::endl;
530 Double_t allb=(*myVectorHistos)[0]->GetEntries();
531 Double_t allc=(*myVectorHistos)[1]->GetEntries();
532 Double_t allu=(*myVectorHistos)[2]->GetEntries();
534 if (
m_Debug) std::cout <<
" allb " << allb << std::endl;
536 Double_t allbsofar=0;
541 for (
int r=0;
r<
eff.size();
r++)
543 ok_eff.push_back(
false);
544 binN_Eff.push_back(0);
547 for (
int s=0;
s<(*myVectorHistos)[0]->GetNbinsX()+1;
s++) {
548 allbsofar+=(*myVectorHistos)[0]->GetBinContent((*myVectorHistos)[0]->GetNbinsX()+1-
s);
549 bool nothingMore(
true);
552 for (
int r=0;
r<
eff.size();
r++)
554 if (
m_Debug) std::cout <<
" actual eff: " << allbsofar / allb << std::endl;
556 if ((!ok_eff[
r]) && allbsofar / allb >
eff[
r])
560 if (
m_Debug) std::cout <<
" bin: " <<
s <<
" eff: " << allbsofar / allb << std::endl;
563 else if (allbsofar / allb <=
eff[
r])
568 if (nothingMore)
break;
572 for (
int r=0;
r<
eff.size();
r++)
575 std::cout <<
" " <<
eff[
r];
577 std::cout <<
" check: " << (
double)(*myVectorHistos)[0]->Integral((*myVectorHistos)[0]->GetNbinsX()-binN_Eff[
r],
578 (*myVectorHistos)[1]->GetNbinsX()+1)
581 double effc=(*myVectorHistos)[1]->Integral((*myVectorHistos)[0]->GetNbinsX()-binN_Eff[
r],
582 (*myVectorHistos)[1]->GetNbinsX()+1);
584 double effl=(*myVectorHistos)[2]->Integral((*myVectorHistos)[0]->GetNbinsX()-binN_Eff[
r],
585 (*myVectorHistos)[2]->GetNbinsX()+1);
590 std::cout <<
" c: " << 1/effc;
594 std::cout <<
" l: " << 1/effl;
598 std::cout << std::endl;
603 delete histoEfficienciesC[j];
604 delete histoEfficienciesL[j];
608 fMeanError/=2.*NPatterns;
611 std::cout <<
" Test error: " << fMeanError << endl;
◆ Train()
Double_t TJetNet::Train |
( |
void |
| ) |
|
Definition at line 618 of file TJetNet.cxx.
622 Double_t fMeanError = 0.0;
632 if (updatesPerEpoch*patternsPerUpdate<1./2.*NPatterns)
634 cout <<
"Using only: " << updatesPerEpoch*patternsPerUpdate <<
635 " patterns on available: " << NPatterns << endl;
636 }
else if (updatesPerEpoch*patternsPerUpdate>NPatterns)
638 cout <<
" Trying to use " << updatesPerEpoch*patternsPerUpdate <<
639 " patterns, but available: " << NPatterns << endl;
643 for( Int_t iPattern = 0; iPattern < updatesPerEpoch*patternsPerUpdate;
646 for( Int_t
i = 0;
i < inputDim;
i++ )
653 for( Int_t j = 0; j < outputDim; j++ )
◆ UnlockInit()
void TJetNet::UnlockInit |
( |
void |
| ) |
|
|
inline |
◆ writeNetworkInfo()
void TJetNet::writeNetworkInfo |
( |
Int_t |
typeOfInfo = 0 | ) |
|
Definition at line 664 of file TJetNet.cxx.
666 cout <<
" Invoking info of type: " << typeOfInfo << endl;
◆ m_CurrentEpoch
Int_t TJetNet::m_CurrentEpoch |
|
private |
◆ m_Debug
◆ m_enActFunction
◆ m_Epochs
◆ m_HiddenLayerDim
Int_t TJetNet::m_HiddenLayerDim |
|
private |
◆ m_InitLocked
Bool_t TJetNet::m_InitLocked |
|
private |
◆ m_InputDim
Int_t TJetNet::m_InputDim |
|
private |
◆ m_IsInitialized
Bool_t TJetNet::m_IsInitialized |
|
private |
◆ m_LayerCount
Int_t TJetNet::m_LayerCount |
|
private |
◆ m_NormalizeOutput
Bool_t TJetNet::m_NormalizeOutput |
|
private |
◆ m_OutputDim
Int_t TJetNet::m_OutputDim |
|
private |
◆ m_pInputTestSet
◆ m_pInputTrainSet
Array which contains the number of units in each layer.
Definition at line 175 of file TJetNet.h.
◆ m_pLayers
Int_t* TJetNet::m_pLayers |
|
private |
◆ m_pOutputTestSet
◆ m_pOutputTrainSet
◆ m_TestSetCnt
Int_t TJetNet::m_TestSetCnt |
|
private |
◆ m_TrainSetCnt
Int_t TJetNet::m_TrainSetCnt |
|
private |
The documentation for this class was generated from the following files:
TActivationFunction m_enActFunction
Int_t GetTestSetCnt(void) const
Int_t GetErrorMeasure(void)
Double_t GetLearningRate(void)
Double_t GetEventWeightTestSet(Int_t aPatternInd)
void SetData(const Int_t aPattern, const Int_t aIndex, Double_t aValue)
Double_t GetMomentum(void)
void SetOutputTestSet(Int_t aPatternInd, Int_t aOutputInd, Double_t aValue)
Double_t GetLearningRateDecrease(void)
Double_t GetData(const Int_t aPattern, const Int_t aIndex)
TNeuralDataSet * m_pInputTrainSet
Array which contains the number of units in each layer.
void Shuffle(Int_t aSeed=0)
Double_t GetOutputTrainSet(Int_t aPatternInd, Int_t aOutputInd)
const std::vector< Int_t > & getnHiddenLayerSize() const
Int_t GetUpdatesPerEpoch(void)
void SetEpochs(const Int_t aEpochs)
const std::vector< TMatrixD * > & weightMatrices() const
@ u
Enums for curvilinear frames.
Double_t GetInputTrainSet(Int_t aPatternInd, Int_t aInputInd)
void SetInputTestSet(Int_t aPatternInd, Int_t aInputInd, Double_t aValue)
void mSetThreshold(Double_t threshold, Int_t aLayerInd, Int_t aNodeInd)
TNeuralDataSet * m_pOutputTrainSet
#define JNSEFI(ILA, I1, I2, J1, J2, NO)
Double_t GetInputTestSet(Int_t aPatternInd, Int_t aInputInd)
Double_t GetWeight(Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd) const
Acts::Seed< xAOD::SpacePoint, 3ul > Seed
TNeuralDataSet * m_pInputTestSet
void SetOutputTrainSet(Int_t aPatternInd, Int_t aOutputInd, Double_t aValue)
void SetInputTrainSet(Int_t aPatternInd, Int_t aInputInd, Double_t aValue)
const std::vector< TVectorD * > & getThresholdVectors() const
Int_t GetPatternsPerUpdate(void)
void mSetWeight(Double_t weight, Int_t aLayerInd, Int_t aNodeInd, Int_t aConnectedNodeInd)
Int_t GetTrainSetCnt(void) const
Int_t GetActivationFunction(void) const
Int_t GetOutputDim(void) const
Double_t GetThreshold(Int_t aLayerInd, Int_t aNodeInd) const
Double_t GetInitialWeightsWidth(void)
void SetEventWeight(const Int_t aPattern, Double_t aValue)
void SetActivationFunction(Int_t aValue)
Double_t GetEventWeight(const Int_t aPattern)
Int_t GetInputDim(void) const
Int_t GetHiddenLayerSize(Int_t number) const
bool getIfLinearOutput() const
Double_t GetPARJN(Int_t aIndex)
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Double_t GetOutputTestSet(Int_t aPatternInd, Int_t aOutputInd)
TNeuralDataSet * m_pOutputTestSet
void SetPottsUnits(Int_t aValue)
constexpr int pow(int base, int exp) noexcept
Double_t GetEventWeightTrainSet(Int_t aPatternInd)
Int_t GetUpdatingProcedure(void)
Int_t GetHiddenLayerDim(void) const