#include <MLP.h>
Public Member Functions | |
void | clear () |
const double * | eval (double *data) const |
unsigned int | getEpoch () const |
int | getLayers () const |
const int * | getLayout () const |
void | init (unsigned int rows) |
void | load (const std::string file) |
MLP (unsigned int nIn, unsigned int nOut, const std::string layout) | |
void | save (const std::string file) const |
void | set (unsigned int row, double *data, double *target, double weight=1.0) |
double | train () |
~MLP () | |
Private Member Functions | |
void | setLearn (void) |
void | setNPattern (unsigned int size) |
Private Attributes | |
unsigned int | epoch |
bool | initialized |
int | layers |
int * | layout |
Static Private Attributes | |
static bool | inUse = false |
PhysicsTools::MLP::MLP | ( | unsigned int | nIn, |
unsigned int | nOut, | ||
const std::string | layout | ||
) |
Definition at line 45 of file MLP.cc.
References Exception, i, InitWeights(), makeLayoutFileForGui::layout, LearnAlloc(), MLP_SetNet(), and PhysicsTools::split().
{ if (inUse) throw cms::Exception("MLP") << "mlpfit doesn't support more than one instance." << std::endl; std::vector<std::string> parsed = split(layout_, ':'); if (parsed.size() < 1) throw cms::Exception("MLP") << "Invalid layout." << std::endl; layout = new int[parsed.size() + 2]; layers = parsed.size(); layout[0] = (int)nIn; for(int i = 0; i < layers; i++) { std::istringstream ss(parsed[i]); int nodes; ss >> nodes; if (nodes < 1) throw cms::Exception("MLP") << "Invalid layout." << std::endl; layout[i + 1] = nodes; } layout[layers + 1] = (int)nOut; layers += 2; inUse = true; MLP_SetNet(&layers, layout); setLearn(); LearnAlloc(); InitWeights(); } MLP::~MLP()
const double * PhysicsTools::MLP::eval | ( | double * | data | ) | const |
unsigned int PhysicsTools::MLP::getEpoch | ( | ) | const [inline] |
int PhysicsTools::MLP::getLayers | ( | ) | const [inline] |
const int* PhysicsTools::MLP::getLayout | ( | ) | const [inline] |
void PhysicsTools::MLP::save | ( | const std::string | file | ) | const |
void PhysicsTools::MLP::set | ( | unsigned int | row, |
double * | data, | ||
double * | target, | ||
double | weight = 1.0 |
||
) |
void PhysicsTools::MLP::setNPattern | ( | unsigned int | size | ) | [private] |
unsigned int PhysicsTools::MLP::epoch [private] |
Definition at line 31 of file MLP.h.
Referenced by getEpoch().
bool PhysicsTools::MLP::initialized [private] |
data refman pasoursint CMSSW_5_3_3 src PhysicsTools MVATrainer plugins MLP cc data refman pasoursint CMSSW_5_3_3 src PhysicsTools MVATrainer plugins MLP cc bool PhysicsTools::MLP::inUse = false [static, private] |
int PhysicsTools::MLP::layers [private] |
Definition at line 28 of file MLP.h.
Referenced by getLayers().
int* PhysicsTools::MLP::layout [private] |
Definition at line 29 of file MLP.h.
Referenced by getLayout().