#include <nn_mlp_tool.h>
Inheritance diagram for mimas::nn_mlp_tool:
Public Types | |
typedef boost::numeric::ublas::matrix< double > | Matrix |
typedef boost::numeric::ublas::vector< double > | Vector |
Public Member Functions | |
nn_mlp_tool (void) | |
constructor | |
~nn_mlp_tool (void) | |
destructor | |
void | init (int nodes,...) throw (mimasexception) |
initialise network with number of nodes in each layer. List must be NULL terminated! | |
void | clear (void) |
delete the whole network | |
void | showConfig (void) |
show network configuration | |
Matrix | feedForward (Matrix &pat) throw (mimasexception) |
feedforward patterns and return a matrix containing the results. | |
void | save (const char *fn) throw (mimasexception) |
save neural network weights to a file. Note that transfer function information are not saved! | |
void | load (const char *fn) throw (mimasexception) |
load neural network from a file. Note that transfer function information are not loaded! | |
void | setIterations (int i) throw (mimasexception) |
set number of iterations to train for | |
int | getIterations (void) |
get number of iterations to train for | |
Matrix | trainOnline (Matrix &pat, double learningRate=0.3, double momentum=0.05, double weightDecay=0.0) throw (mimasexception) |
online training of network on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values. | |
Matrix | trainBatch (Matrix &pat, double learningRate=0.3, double momentum=0.05, double weightDecay=0.0) throw (mimasexception) |
batch training of network on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values. | |
Matrix | trainQprop (Matrix &pat, double learningRate=0.0005, double momentum=0.05, double maxFactor=2.0) throw (mimasexception) |
batch training using Quickprop on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values. | |
Matrix | trainRprop (Matrix &pat, double etapos=1.2, double etaneg=0.5) throw (mimasexception) |
batch training using RProp on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values. | |
void | setTransferFuncLayer (ptrToFuncType newfunc, int layer) throw (mimasexception) |
set transfer function for layer. Note that first hidden layer is layer 2. Must be set together with setTransferFuncDerivLayer() | |
void | setTransferFuncDerivLayer (ptrToFuncType newfunc, int layer) throw (mimasexception) |
set derivative of transfer function for layer. Note that first hidden layer is layer 2. Must be set together with setTransferFuncLayer() | |
virtual double | transferFunc (double val) |
a transfer function that is overwritable by the user | |
virtual double | transferFuncDeriv (double val) |
the derivative of a transfer function that is overwritable by the user | |
double | transferFuncTanh (double val) |
the hyperbolic tangent transfer function | |
double | transferFuncDerivTanh (double val) |
the derivative of hyperbolic tangent the transfer function | |
double | transferFuncLinear (double val) |
the linear transfer function | |
double | transferFuncDerivLinear (double val) |
the derivative of linear the transfer function | |
void | setDebug (bool val) |
set/unset debugging flag. When set, training informaiton will be displayed |
Definition at line 28 of file nn_mlp_tool.h.
typedef boost::numeric::ublas::matrix< double > mimas::nn_mlp_tool::Matrix |
Definition at line 31 of file nn_mlp_tool.h.
typedef boost::numeric::ublas::vector< double > mimas::nn_mlp_tool::Vector |
Definition at line 32 of file nn_mlp_tool.h.
mimas::nn_mlp_tool::nn_mlp_tool | ( | void | ) |
constructor
mimas::nn_mlp_tool::~nn_mlp_tool | ( | void | ) |
destructor
void mimas::nn_mlp_tool::init | ( | int | nodes, | |
... | ||||
) | throw (mimasexception) |
initialise network with number of nodes in each layer. List must be NULL terminated!
void mimas::nn_mlp_tool::clear | ( | void | ) |
delete the whole network
void mimas::nn_mlp_tool::showConfig | ( | void | ) |
show network configuration
Matrix mimas::nn_mlp_tool::feedForward | ( | Matrix & | pat | ) | throw (mimasexception) |
feedforward patterns and return a matrix containing the results.
void mimas::nn_mlp_tool::save | ( | const char * | fn | ) | throw (mimasexception) |
save neural network weights to a file. Note that transfer function information are not saved!
void mimas::nn_mlp_tool::load | ( | const char * | fn | ) | throw (mimasexception) |
load neural network from a file. Note that transfer function information are not loaded!
void mimas::nn_mlp_tool::setIterations | ( | int | i | ) | throw (mimasexception) |
set number of iterations to train for
int mimas::nn_mlp_tool::getIterations | ( | void | ) |
get number of iterations to train for
Matrix mimas::nn_mlp_tool::trainOnline | ( | Matrix & | pat, | |
double | learningRate = 0.3 , |
|||
double | momentum = 0.05 , |
|||
double | weightDecay = 0.0 | |||
) | throw (mimasexception) |
online training of network on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values.
Matrix mimas::nn_mlp_tool::trainBatch | ( | Matrix & | pat, | |
double | learningRate = 0.3 , |
|||
double | momentum = 0.05 , |
|||
double | weightDecay = 0.0 | |||
) | throw (mimasexception) |
batch training of network on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values.
Matrix mimas::nn_mlp_tool::trainQprop | ( | Matrix & | pat, | |
double | learningRate = 0.0005 , |
|||
double | momentum = 0.05 , |
|||
double | maxFactor = 2.0 | |||
) | throw (mimasexception) |
batch training using Quickprop on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values.
Matrix mimas::nn_mlp_tool::trainRprop | ( | Matrix & | pat, | |
double | etapos = 1.2 , |
|||
double | etaneg = 0.5 | |||
) | throw (mimasexception) |
batch training using RProp on input/output dataset pat. Note that the number of columns that are the input patters and target patters are determined by the number of inputs and outputs of the network during the init() call. Returns 2-column matrix of sum-squared-error (SSE) values.
void mimas::nn_mlp_tool::setTransferFuncLayer | ( | ptrToFuncType | newfunc, | |
int | layer | |||
) | throw (mimasexception) |
set transfer function for layer. Note that first hidden layer is layer 2. Must be set together with setTransferFuncDerivLayer()
void mimas::nn_mlp_tool::setTransferFuncDerivLayer | ( | ptrToFuncType | newfunc, | |
int | layer | |||
) | throw (mimasexception) |
set derivative of transfer function for layer. Note that first hidden layer is layer 2. Must be set together with setTransferFuncLayer()
a transfer function that is overwritable by the user
the derivative of a transfer function that is overwritable by the user
the derivative of hyperbolic tangent the transfer function
the derivative of linear the transfer function
void mimas::nn_mlp_tool::setDebug | ( | bool | val | ) |
set/unset debugging flag. When set, training informaiton will be displayed