HOG2
|
#include <Perceptron.h>
Public Member Functions | |
perceptron (int inputs, int outputs, double learnrate) | |
perceptron (perceptron *) | |
perceptron (char *) | |
perceptron (FunctionApproximator *) | |
~perceptron () | |
void | save (const char *) |
void | save (FILE *) |
void | load (const char *) |
void | load (FILE *) |
void | load (const FunctionApproximator *fa) |
void | load (const perceptron *) |
double | train (std::vector< double > &input, std::vector< double > &output2) |
double * | test (const std::vector< double > &input) |
double | train (std::vector< unsigned int > &input, std::vector< double > &output2) |
double * | test (const std::vector< unsigned int > &input) |
void | Print () |
int | getNumInputs () |
double | getInputWeight (int inp, int outp=0) |
Public Member Functions inherited from FunctionApproximator | |
FunctionApproximator () | |
virtual | ~FunctionApproximator () |
virtual double | GetInput (std::vector< double > &input, const std::vector< double > &target)=0 |
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 () |
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 | error (double *output) |
Private Attributes | |
std::vector< std::vector< double > > | weight |
std::vector< double > | output |
int | inputs |
int | outputs |
Additional Inherited Members | |
Protected Attributes inherited from FunctionApproximator | |
double | rate |
tActivation | outputActivation |
Definition at line 14 of file Perceptron.h.
perceptron::perceptron | ( | int | inputs, |
int | outputs, | ||
double | learnrate | ||
) |
Definition at line 18 of file Perceptron.cpp.
References allocateMemory(), inputs, kLinear, FunctionApproximator::outputActivation, outputs, FunctionApproximator::rate, and weight.
perceptron::perceptron | ( | perceptron * | perp | ) |
Definition at line 29 of file Perceptron.cpp.
References allocateMemory(), inputs, FunctionApproximator::outputActivation, outputs, FunctionApproximator::rate, and weight.
perceptron::perceptron | ( | char * | f | ) |
perceptron::perceptron | ( | FunctionApproximator * | fa | ) |
Definition at line 48 of file Perceptron.cpp.
References allocateMemory(), inputs, load(), FunctionApproximator::outputActivation, outputs, FunctionApproximator::rate, and weight.
perceptron::~perceptron | ( | ) |
Definition at line 61 of file Perceptron.cpp.
References freeMemory().
|
private |
Definition at line 66 of file Perceptron.cpp.
References inputs, output, outputs, and weight.
Referenced by load(), and perceptron().
|
private |
|
private |
|
private |
Definition at line 82 of file Perceptron.cpp.
References weight.
Referenced by load(), and ~perceptron().
|
private |
|
inlinevirtual |
Reimplemented from FunctionApproximator.
Definition at line 38 of file Perceptron.h.
References weight.
|
inlinevirtual |
Reimplemented from FunctionApproximator.
Definition at line 37 of file Perceptron.h.
References inputs.
|
virtual |
Implements FunctionApproximator.
Definition at line 95 of file Perceptron.cpp.
Referenced by perceptron().
|
inlinevirtual |
Implements FunctionApproximator.
Definition at line 26 of file Perceptron.h.
References load().
Referenced by load().
void perceptron::load | ( | const perceptron * | p | ) |
Definition at line 148 of file Perceptron.cpp.
References allocateMemory(), freeMemory(), inputs, FunctionApproximator::outputActivation, outputs, and weight.
|
virtual |
Implements FunctionApproximator.
Definition at line 115 of file Perceptron.cpp.
References allocateMemory(), freeMemory(), inputs, outputs, VERSION, and weight.
|
private |
Definition at line 230 of file Perceptron.cpp.
Referenced by train().
|
virtual |
Implements FunctionApproximator.
Definition at line 306 of file Perceptron.cpp.
|
virtual |
Implements FunctionApproximator.
Definition at line 191 of file Perceptron.cpp.
|
virtual |
Implements FunctionApproximator.
Definition at line 204 of file Perceptron.cpp.
|
virtual |
Implements FunctionApproximator.
Definition at line 272 of file Perceptron.cpp.
References inputs, kStep, output, FunctionApproximator::outputActivation, outputs, and weight.
Referenced by train().
|
virtual |
Implements FunctionApproximator.
Definition at line 293 of file Perceptron.cpp.
|
virtual |
Implements FunctionApproximator.
Definition at line 237 of file Perceptron.cpp.
References inputs, output, outputerr(), outputs, FunctionApproximator::rate, test(), and weight.
|
virtual |
Implements FunctionApproximator.
Definition at line 254 of file Perceptron.cpp.
References inputs, output, outputerr(), outputs, FunctionApproximator::rate, test(), and weight.
|
static |
Definition at line 168 of file Perceptron.cpp.
References VERSION.
|
private |
Definition at line 52 of file Perceptron.h.
Referenced by allocateMemory(), getNumInputs(), load(), perceptron(), Print(), save(), test(), and train().
|
private |
Definition at line 49 of file Perceptron.h.
Referenced by allocateMemory(), test(), and train().
|
private |
Definition at line 52 of file Perceptron.h.
Referenced by allocateMemory(), load(), perceptron(), Print(), save(), test(), and train().
|
private |
Definition at line 48 of file Perceptron.h.
Referenced by allocateMemory(), freeMemory(), getInputWeight(), load(), perceptron(), Print(), save(), test(), and train().