HOG2
|
#include <NN.h>
Public Member Functions | |
NN (int inputs, int hiddens, int outputs, double learnrate) | |
NN (NN *) | |
NN (FunctionApproximator *) | |
NN (char *) | |
~NN () | |
void | load (const char *) |
void | load (FILE *) |
void | load (const NN *) |
void | load (const FunctionApproximator *fa) |
void | save (const char *) |
void | save (FILE *) |
double | train (std::vector< double > &input, std::vector< double > &target) |
double * | test (const std::vector< double > &input) |
double | GetInput (std::vector< double > &input, const std::vector< double > &target) |
double | train (std::vector< unsigned int > &input, std::vector< double > &target) |
double * | test (const std::vector< unsigned int > &input) |
int | getNumInputs () |
double | getInputWeight (int inp, int outp=0) |
void | Print () |
Public Member Functions inherited from FunctionApproximator | |
FunctionApproximator () | |
virtual | ~FunctionApproximator () |
virtual void | setLearnRate (double) |
virtual double | getLearnRate () |
void | setOutputActivation (tActivation t) |
tActivation | getOutputActivation () |
Static Public Member Functions | |
static bool | validSaveFile (char *fname) |
Private Member Functions | |
void | allocateMemory (const NN *nn=0) |
void | freeMemory () |
double | g (double a) |
double | dg (double a) |
double | outputerr (const std::vector< double > &output, const std::vector< double > &expected, int which) |
double | internalerr (const std::vector< double > &output, const std::vector< double > &expected, int which) |
double | internalinputerr (const std::vector< double > &output, const std::vector< double > &expected, int which) |
double | error (const std::vector< double > &outputs) |
Private Attributes | |
std::vector< std::vector< std::vector< double > > > | weights |
std::vector< std::vector< std::vector< double > > > | updatedweights |
std::vector< std::vector< std::vector< double > > > | errors |
std::vector< double > | hidden |
std::vector< double > | output |
int | inputs |
int | hiddens |
int | outputs |
Additional Inherited Members | |
Protected Attributes inherited from FunctionApproximator | |
double | rate |
tActivation | outputActivation |
NN::NN | ( | int | inputs, |
int | hiddens, | ||
int | outputs, | ||
double | learnrate | ||
) |
Definition at line 22 of file NN.cpp.
References allocateMemory(), kExponential, FunctionApproximator::outputActivation, and FunctionApproximator::rate.
NN::NN | ( | NN * | nn | ) |
Definition at line 35 of file NN.cpp.
References allocateMemory(), hiddens, inputs, FunctionApproximator::outputActivation, outputs, and FunctionApproximator::rate.
NN::NN | ( | FunctionApproximator * | fa | ) |
Definition at line 52 of file NN.cpp.
References allocateMemory(), hiddens, inputs, FunctionApproximator::outputActivation, outputs, and FunctionApproximator::rate.
NN::~NN | ( | ) |
Definition at line 30 of file NN.cpp.
References freeMemory().
|
private |
|
private |
Definition at line 297 of file NN.cpp.
Referenced by internalerr(), internalinputerr(), and outputerr().
|
private |
|
private |
|
virtual |
Implements FunctionApproximator.
Definition at line 413 of file NN.cpp.
References error(), hiddens, inputs, internalinputerr(), output, test(), and weights.
|
inlinevirtual |
|
inlinevirtual |
|
private |
|
private |
Definition at line 323 of file NN.cpp.
References dg(), hidden, outputerr(), outputs, and weights.
Referenced by GetInput().
|
virtual |
|
inlinevirtual |
Implements FunctionApproximator.
Definition at line 17 of file NN.h.
References load().
Referenced by load().
void NN::load | ( | const NN * | nn | ) |
Definition at line 144 of file NN.cpp.
References allocateMemory(), errors, freeMemory(), hiddens, inputs, FunctionApproximator::outputActivation, outputs, and weights.
|
virtual |
Implements FunctionApproximator.
Definition at line 208 of file NN.cpp.
References allocateMemory(), errors, freeMemory(), hiddens, inputs, outputs, VERSION, and weights.
|
private |
Definition at line 303 of file NN.cpp.
References dg(), kExponential, and FunctionApproximator::outputActivation.
Referenced by internalerr(), internalinputerr(), and train().
|
virtual |
|
virtual |
Implements FunctionApproximator.
|
virtual |
|
virtual |
Implements FunctionApproximator.
Definition at line 429 of file NN.cpp.
References g(), hidden, hiddens, inputs, kExponential, kStep, output, FunctionApproximator::outputActivation, outputs, and weights.
Referenced by GetInput(), and train().
|
virtual |
Implements FunctionApproximator.
Definition at line 466 of file NN.cpp.
References g(), hidden, hiddens, kExponential, kStep, output, FunctionApproximator::outputActivation, outputs, and weights.
|
virtual |
Implements FunctionApproximator.
Definition at line 344 of file NN.cpp.
References error(), errors, hidden, hiddens, inputs, internalerr(), output, outputerr(), outputs, FunctionApproximator::rate, test(), updatedweights, and weights.
|
virtual |
Implements FunctionApproximator.
Definition at line 377 of file NN.cpp.
References error(), errors, hidden, hiddens, internalerr(), output, outputerr(), outputs, FunctionApproximator::rate, test(), and weights.
|
static |
|
private |
Definition at line 38 of file NN.h.
Referenced by allocateMemory(), load(), and train().
|
private |
Definition at line 39 of file NN.h.
Referenced by allocateMemory(), internalerr(), internalinputerr(), test(), and train().
|
private |
Definition at line 41 of file NN.h.
Referenced by allocateMemory(), GetInput(), load(), NN(), Print(), save(), test(), and train().
|
private |
Definition at line 41 of file NN.h.
Referenced by allocateMemory(), GetInput(), getNumInputs(), load(), NN(), save(), test(), and train().
|
private |
Definition at line 40 of file NN.h.
Referenced by allocateMemory(), error(), GetInput(), test(), and train().
|
private |
Definition at line 41 of file NN.h.
Referenced by allocateMemory(), error(), internalerr(), internalinputerr(), load(), NN(), Print(), save(), test(), and train().
|
private |
Definition at line 37 of file NN.h.
Referenced by allocateMemory(), and train().
|
private |
Definition at line 36 of file NN.h.
Referenced by allocateMemory(), GetInput(), getInputWeight(), internalerr(), internalinputerr(), load(), Print(), save(), test(), and train().