Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes in interactive training in jupyter integration layer
  • Loading branch information
qati committed Sep 19, 2016
commit 81acead5f2dfff54c8b9627040d85c71962bf201
4 changes: 2 additions & 2 deletions tmva/tmva/inc/TMVA/FitterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ namespace TMVA {
TString fClassName; // remove TMVA:: from TObject name

// variables needed by JsMVA
UInt_t *fIPyCurrentIter=nullptr, *fIPyMaxIter=nullptr;
bool* fExitFromTraining;
UInt_t *fIPyCurrentIter = nullptr, *fIPyMaxIter = nullptr;
bool* fExitFromTraining = nullptr;

ClassDef(FitterBase,0); // Baseclass for fitters
};
Expand Down
4 changes: 2 additions & 2 deletions tmva/tmva/inc/TMVA/SVWorkingSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ namespace TMVA {
mutable MsgLogger* fLogger; //! message logger

// variables for JsMVA
UInt_t *fIPyCurrentIter=nullptr;
bool * fExitFromTraining;
UInt_t *fIPyCurrentIter = nullptr;
bool * fExitFromTraining = nullptr;

void SetIndex( TMVA::SVEvent* );
};
Expand Down
4 changes: 2 additions & 2 deletions tmva/tmva/inc/TMVA/SimulatedAnnealing.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ namespace TMVA {
Double_t fProgress;

// variables for JsMVA
UInt_t *fIPyCurrentIter=nullptr;
bool * fExitFromTraining;
UInt_t *fIPyCurrentIter = nullptr;
bool * fExitFromTraining = nullptr;

ClassDef(SimulatedAnnealing,0); // Base class for Simulated Annealing fitting
};
Expand Down
1 change: 0 additions & 1 deletion tmva/tmva/src/MethodCFMlpANN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ void TMVA::MethodCFMlpANN::Train( void )
Int_t *nodes = new Int_t[nlayers];
Int_t ncycles(fNcycles);


for (Int_t i=0; i<nlayers; i++) nodes[i] = fNodes[i]; // full copy of class member

if (fYNN != 0) {
Expand Down
2 changes: 1 addition & 1 deletion tmva/tmva/src/MethodCuts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ void TMVA::MethodCuts::Train( void )
Log() << kFATAL << "Wrong fit method: " << fFitMethod << Endl;
}

fitter->SetIPythonInteractive(&fExitFromTraining, &fIPyMaxIter, &fIPyCurrentIter);
if (fInteractive) fitter->SetIPythonInteractive(&fExitFromTraining, &fIPyMaxIter, &fIPyCurrentIter);

fitter->CheckForUnusedOptions();

Expand Down
8 changes: 4 additions & 4 deletions tmva/tmva/src/MethodDNN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,10 @@ void TMVA::MethodDNN::Train()

Log() << kINFO << "Using Standard Implementation.";

if (fInteractive && fInteractive->NotInitialized()){
std::vector<TString> titles = {"Error on training set", "Error on test set"};
fInteractive->Init(titles);
}
if (fInteractive && fInteractive->NotInitialized()){
std::vector<TString> titles = {"Error on training set", "Error on test set"};
fInteractive->Init(titles);
}

std::vector<Pattern> trainPattern;
std::vector<Pattern> testPattern;
Expand Down
2 changes: 1 addition & 1 deletion tmva/tmva/src/MethodSVM.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void TMVA::MethodSVM::Train()
Timer timer( GetName() );
Log() << kINFO << "Sorry, no computing time forecast available for SVM, please wait ..." << Endl;

fWgSet->SetIPythonInteractive(&fExitFromTraining, &fIPyCurrentIter);
if (fInteractive) fWgSet->SetIPythonInteractive(&fExitFromTraining, &fIPyCurrentIter);

fWgSet->Train(fMaxIter);

Expand Down
2 changes: 1 addition & 1 deletion tmva/tmva/src/SVWorkingSet.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ void TMVA::SVWorkingSet::Train(UInt_t nMaxIter)

while ((numChanged > 0) || (examineAll > 0)) {
if (fIPyCurrentIter) *fIPyCurrentIter = numit;
if (*fExitFromTraining) break;
if (fExitFromTraining && *fExitFromTraining) break;
numChanged = 0;
if (examineAll) {
for (idIter = fInputData->begin(); idIter!=fInputData->end(); idIter++){
Expand Down
6 changes: 4 additions & 2 deletions tmva/tmva/src/SimulatedAnnealingFitter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ Double_t TMVA::SimulatedAnnealingFitter::Run( std::vector<Double_t>& pars )
fTemperatureScale, fAdaptiveSpeed, fTemperatureAdaptiveStep,
fUseDefaultScale, fUseDefaultTemperature );

if (fIPyMaxIter) *fIPyMaxIter = fMaxCalls;
sa.SetIPythonInteractive(fExitFromTraining, fIPyCurrentIter);
if (fIPyMaxIter){
*fIPyMaxIter = fMaxCalls;
sa.SetIPythonInteractive(fExitFromTraining, fIPyCurrentIter);
}
// minimise
Double_t fcn = sa.Minimize( pars );

Expand Down