Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

Interface Class Reference

#include <Interface.h>

Inheritance diagram for Interface:

SnnsKrui PatternManager List of all members.

Public Member Functions

 Interface ()
 Interface (std::string trName, std::string dirName, std::string fileName)
 ~Interface ()
void SetInputVariableAt (Int_t index, TVariable var)
void SetTargetVariableAt (Int_t index, TVariable var)
TVariable & GetInputVariable (Int_t index)
TVariable & GetTargetVariable (Int_t index)
std::string getTreeName () const
std::string getNetName ()
TFile * GetOutFile ()
Double_t getAverageValidError () const
Double_t getMinimumValidError () const
Int_t getMinimumValidErrorEpoch () const
void SetMaximumEpochs (Int_t i)
void SetUpdateEpochs (Int_t i)
void setTreeName (std::string name)
void setNetName (std::string name)
void setOutDirectory (std::string name)
void WriteMasterTree (Bool_t flag)
void WritePerformanceTree (Bool_t flag)
void WritePatternTree (Bool_t flag)
void WriteErrorHistograms (Bool_t flag)
Bool_t WriteMasterTree ()
Bool_t WritePerformanceTree ()
Bool_t WritePatternTree ()
Bool_t WriteErrorHistograms ()
void setMinimumValidError (Double_t value)
Int_t PrintVariables ()
 Prints out definitions of input and target variables.

void AddInputVariable (TString formula, TString name, Double_t defValue=0.0)
 Adds a variable to the vector of input variables .

void AddInputVariable (TString formula, Double_t defValue=0.0)
 Adds a variable to the vector of input variables .

void AddTargetVariable (TString formula, TString name, Double_t defValue=0.0)
 Adds a variable to the vector of target variables .

void AddTargetVariable (TString formula, Double_t defValue=0.0)
 Adds a variable to the vector of target variables .

Int_t AllocatePatternSet (std::string type="")
 Creates a new SNNS pattern set in memory by setting activations of input and output NN units.

void SetSelection (std::string selection="")
void FillPatternSet (std::string fileName, Int_t startEvent=0, Int_t nOfEvents=-1, std::string type="")
 Fills the pattern set vector with values from an input file given by .

void savePatternSets ()
 Saves the input, target, and output values of each pattern to a tree in the output file.

std::string runtimeInput2string ()
std::string CreateNN (std::vector< Int_t > numHiddenNodes)
 Creates a file containing NN definition in SNNS format with the given number of hidden units.

void InitializeNN (std::vector< Float_t > initParams=0, std::string initFunc="Randomize_Weights", Int_t randomSeed=12345)
 Initializes the neural network with different initialization functions and corresponding parameters.

void TrainValidate (std::string trainType, std::string validType, std::vector< Double_t > learnParams)
 The main training proceedure with online validation of the neural network using the pattern set.

void TrainValidateApply (std::string trainType, std::string validType, std::vector< Double_t > learnParams, std::string genErrType)
void PropagatePatterns (std::string type="")
 Using this method user can propagate the whole pattern set or its subset specified by through the ANN.

void ActivateInputs (Pattern pattern)
void FillPerformanceTree ()
void CalculateError (std::string type)
 Calculats an error defined as the difference between an actual NN output and a desired target value.

Int_t AllocNewPatternSet ()
void LoadNN ()
 Loads a neural network definition from the file and makes it the currently active one.

void LoadNN (char *filename, char **netname)
 Loads a neural network definition from the file and makes it the currently active one.

void SaveNN (char *filename, char *netname)
 Saves the currently active neural network to the file.

void SetSeedNo (long seed)
void SetLearnFunc (char *learning_func)
char * GetLearnFunc ()
void Finalize ()
void PrintProgress (Int_t i, Int_t iMax)
Int_t Timer (Int_t i)
std::string TimeStoHMS (UInt_t diffTime)

Protected Attributes

std::vector< TVariable > fInputVariables
std::vector< TVariable > fTargetVariables
std::string _pathto_ff_bignet
std::string fNetFilePrefix
std::string fNetFileSuffix
std::string fNetName
 The name of a currently active NN.

std::string fTreeName
std::string fDirName
std::string fSelection
TObjArray * fInputTrees
TFile * fOutFile
TTree * fMasterTree
TTree * fPatternTree
TTree * fPerformaceTree
Bool_t fWriteMasterTree
Bool_t fWritePerformanceTree
Bool_t fWritePatternTree
Bool_t fWriteErrorHistograms
Bool_t fBannerPrinted
Int_t fMaxEpochs
Int_t fUpdEpochs
Double_t averageValidError
Double_t minimumValidError
Int_t minimumValidErrorEpoch
Double_t RMSTestError
Int_t hiddenLayerSize
Int_t fRandomSeed

Constructor & Destructor Documentation

Interface::Interface (   ) 
 

Interface::Interface (  std::string  trName,
std::string  dirName,
std::string  fileName
) 
 

Interface::~Interface (   ) 
 


Member Function Documentation

void Interface::ActivateInputs (  Pattern  pattern  ) 
 

void Interface::AddInputVariable (  TString  formula,
Double_t  defValue = 0.0
) 
 

Adds a variable to the vector of input variables .

void Interface::AddInputVariable (  TString  formula,
TString  name,
Double_t  defValue = 0.0
) 
 

Adds a variable to the vector of input variables .

void Interface::AddTargetVariable (  TString  formula,
Double_t  defValue = 0.0
) 
 

Adds a variable to the vector of target variables .

void Interface::AddTargetVariable (  TString  formula,
TString  name,
Double_t  defValue = 0.0
) 
 

Adds a variable to the vector of target variables .

Int_t Interface::AllocatePatternSet (  std::string  type = ""  ) 
 

Creates a new SNNS pattern set in memory by setting activations of input and output NN units.

Input and target values of each pattern are selected from the pattern set vector where type is . If equals "" then all patterns are selected into memory resident SNNS pattern set. NN must be loaded before calling this function.

Int_t Interface::AllocNewPatternSet (   ) 
 

void Interface::CalculateError (  std::string  type  ) 
 

Calculats an error defined as the difference between an actual NN output and a desired target value.

The differences are summed in quadrature for all NN outputs and the final value is normalized as:

$ \sqrt{\frac{SSE}{N_{subpat}}} $

Reimplemented from PatternManager.

string Interface::CreateNN (  std::vector< Int_t >  numHiddenNodes  ) 
 

Creates a file containing NN definition in SNNS format with the given number of hidden units.

void Interface::FillPatternSet (  std::string  fileName,
Int_t  startEvent = 0,
Int_t  noOfEvents = -1,
std::string  type = ""
) 
 

Fills the pattern set vector with values from an input file given by .

void Interface::FillPerformanceTree (   ) 
 

void Interface::Finalize (   ) 
 

Double_t Interface::getAverageValidError (   )  const [inline]
 

TVariable & Interface::GetInputVariable (  Int_t  index  )  [inline]
 

char * Interface::GetLearnFunc (   ) 
 

Double_t Interface::getMinimumValidError (   )  const [inline]
 

Int_t Interface::getMinimumValidErrorEpoch (   )  const [inline]
 

std::string Interface::getNetName (   )  [inline]
 

TFile* Interface::GetOutFile (   )  [inline]
 

TVariable & Interface::GetTargetVariable (  Int_t  index  )  [inline]
 

std::string Interface::getTreeName (   )  const [inline]
 

void Interface::InitializeNN (  std::vector< Float_t >  initParams = 0,
std::string  initFunc = "Randomize_Weights",
Int_t  randomSeed = 12345
) 
 

Initializes the neural network with different initialization functions and corresponding parameters.

Since initialization is usually random in nature, a random seed number can be provided by the user.

void Interface::LoadNN (  char *  filename,
char **  netname
) 
 

Loads a neural network definition from the file and makes it the currently active one.

void Interface::LoadNN (   ) 
 

Loads a neural network definition from the file and makes it the currently active one.

void Interface::PrintProgress (  Int_t  i,
Int_t  iMax
) 
 

Int_t Interface::PrintVariables (   ) 
 

Prints out definitions of input and target variables.

void Interface::PropagatePatterns (  std::string  type = ""  ) 
 

Using this method user can propagate the whole pattern set or its subset specified by through the ANN.

A memory-resident SNNS pattern set is not created due to very slow and inefficient memory allocation for SNNS pattern sets with a large number of patterns, instead the inputs are taken directly from the pattern set. The inputs from each pattern in this pattern (sub)set are then propagated through the current ANN and outputs are caluclated and saved to the pattern.

string Interface::runtimeInput2string (   ) 
 

void Interface::SaveNN (  char *  filename,
char *  netname
) 
 

Saves the currently active neural network to the file.

void Interface::savePatternSets (   ) 
 

Saves the input, target, and output values of each pattern to a tree in the output file.

void Interface::SetInputVariableAt (  Int_t  index,
TVariable  var
)  [inline]
 

void Interface::SetLearnFunc (  char *  learnFuncName  ) 
 

void Interface::SetMaximumEpochs (  Int_t  i  )  [inline]
 

void Interface::setMinimumValidError (  Double_t  value  )  [inline]
 

void Interface::setNetName (  std::string  name  )  [inline]
 

void Interface::setOutDirectory (  std::string  name  )  [inline]
 

void Interface::SetSeedNo (  long  seed  ) 
 

void Interface::SetSelection (  std::string  selection = ""  ) 
 

void Interface::SetTargetVariableAt (  Int_t  index,
TVariable  var
)  [inline]
 

void Interface::setTreeName (  std::string  name  )  [inline]
 

void Interface::SetUpdateEpochs (  Int_t  i  )  [inline]
 

Int_t Interface::Timer (  Int_t  i  ) 
 

string Interface::TimeStoHMS (  UInt_t  diffTime  ) 
 

void Interface::TrainValidate (  std::string  trainType,
std::string  validType,
std::vector< Double_t >  learnParams
) 
 

The main training proceedure with online validation of the neural network using the pattern set.

The training and validation subsets (samples) are defined by and strings. The learning parameters is used for online validation of the training.

void Interface::TrainValidateApply (  std::string  trainType,
std::string  validType,
std::vector< Double_t >  learnParams,
std::string  genErrType
) 
 

Bool_t Interface::WriteErrorHistograms (   )  [inline]
 

void Interface::WriteErrorHistograms (  Bool_t  flag  )  [inline]
 

Bool_t Interface::WriteMasterTree (   )  [inline]
 

void Interface::WriteMasterTree (  Bool_t  flag  )  [inline]
 

Bool_t Interface::WritePatternTree (   )  [inline]
 

void Interface::WritePatternTree (  Bool_t  flag  )  [inline]
 

Bool_t Interface::WritePerformanceTree (   )  [inline]
 

void Interface::WritePerformanceTree (  Bool_t  flag  )  [inline]
 


Member Data Documentation

std::string Interface::_pathto_ff_bignet [protected]
 

Double_t Interface::averageValidError [protected]
 

Bool_t Interface::fBannerPrinted [protected]
 

std::string Interface::fDirName [protected]
 

TObjArray* Interface::fInputTrees [protected]
 

std::vector<TVariable> Interface::fInputVariables [protected]
 

TTree* Interface::fMasterTree [protected]
 

Int_t Interface::fMaxEpochs [protected]
 

std::string Interface::fNetFilePrefix [protected]
 

std::string Interface::fNetFileSuffix [protected]
 

std::string Interface::fNetName [protected]
 

The name of a currently active NN.

TFile* Interface::fOutFile [protected]
 

TTree* Interface::fPatternTree [protected]
 

TTree* Interface::fPerformaceTree [protected]
 

Int_t Interface::fRandomSeed [protected]
 

std::string Interface::fSelection [protected]
 

std::vector<TVariable> Interface::fTargetVariables [protected]
 

std::string Interface::fTreeName [protected]
 

Int_t Interface::fUpdEpochs [protected]
 

Bool_t Interface::fWriteErrorHistograms [protected]
 

Bool_t Interface::fWriteMasterTree [protected]
 

Bool_t Interface::fWritePatternTree [protected]
 

Bool_t Interface::fWritePerformanceTree [protected]
 

Int_t Interface::hiddenLayerSize [protected]
 

Double_t Interface::minimumValidError [protected]
 

Int_t Interface::minimumValidErrorEpoch [protected]
 

Double_t Interface::RMSTestError [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 15 17:06:36 2006 for ROOTSNNS by doxygen 1.3.6