#include <TrainingSet.h>
Public Member Functions | |||
TrainingSet (uint in, uint out) | |||
Create an empty training set. | |||
TrainingSet (const std::string &filename, int file_type=TEXT_FILE) | |||
Create a tranining set from a file. | |||
virtual | ~TrainingSet () | ||
void | addIOpair (real *input, real *output) | ||
Add an input and correspoding output vector. | |||
void | addIOpair (const Vector &input, const Vector &output) | ||
Add an input and corresponding output vector
| |||
void | addIOpair (const Vector &input) | ||
version without output - for unsipervised architectures.. Uses output dim 0 | |||
virtual void | initialize () | ||
Initialize the training set so that the first call to getNextPair() gives the first I/O pair stored. | |||
virtual bool | epochOver () const | ||
Has a cycle through all input/output pairs been completed? | |||
virtual uint | getSize () const | ||
The number of input/desired-output vector pairs in the training set. | |||
virtual uint | getInputSize () const | ||
The size of an input vector. | |||
virtual uint | getOutputSize () const | ||
The size of an output vector. | |||
virtual void | getNextPair (Vector &input, Vector &desired) | ||
Returns the next input/output vector pair. | |||
virtual void | save (const std::string &filename, int file_type=TEXT_FILE) | ||
Saves the training set to a file. | |||
operator std::string () const | |||
debugging info - not to be confused with operator<< ! | |||
virtual const char * | getClassName () const | ||
Returns "TrainingSet". | |||
void | shuffle () | ||
Randomly changes order of stored pairs. | |||
TrainingSet | operator+ (const TrainingSet &ts) const | ||
Weird TrainingSet arithmetics. | |||
TrainingSet & | operator+= (const TrainingSet &ts) | ||
TrainingSet | xform (XformFunction ix, XformFunction ox, uint resI, uint resO) | ||
TrainingSet | xform (XformFunction ix, XformFunction ox) | ||
TrainingSet | xform (XformFunction ix, uint resI) | ||
only the input part | |||
TrainingSet | xform (XformFunction ix) | ||
keep dimensions | |||
TrainingSet | mixedXform (const TSTransformer &xf) | ||
The transformer functions get. | |||
Protected Member Functions | |||
void | save_binary (const std::string &filename) | ||
Save the training set in binary format to the given filename. | |||
void | save_text (const std::string &filename) | ||
Save the file in text format to the given filename. | |||
void | load_binary (const std::string &filename) | ||
Load from a binary file. | |||
void | load_text (const std::string &filename) | ||
Load from a text file. | |||
Protected Attributes | |||
std::vector< Vector > | _inputs | ||
The set of input vectors. | |||
std::vector< Vector > | _outputs | ||
The set of corresponding desired output vectors. | |||
std::vector< Vector >::iterator | _inputIter | ||
An iterator through the input vectors. | |||
std::vector< Vector >::iterator | _outputIter | ||
Iterator through the output vectors. | |||
uint | _nInputs | ||
Size of an input vector. | |||
uint | _nOutputs | ||
Size of an output vector. | |||
Friends | |||
std::ostream & | operator<< (std::ostream &s, TrainingSet &T) | ||
Allows you to print the TrainingSet onto a stream. |
It will contain sets of input and corresponding desired-output vectors which will be used by the training algorithms of supervised networks, such as the MultiLayerNetwork and RadialBasisNetwork
You can save TrainingSets into a file. The file can be text, a simple format so that you can construct the file from other programs as well, or the file can be a binary file which is understood only by this library. Binary files are generally smaller and quicker to load.
You can use utilities provided with the library distribution to convert from one format to the other.
|
Create an empty training set.
|
|
Create a tranining set from a file.
|
|
|
|
version without output - for unsipervised architectures.. Uses output dim 0
|
|
Add an input and corresponding output vector
|
|
Add an input and correspoding output vector.
|
|
Has a cycle through all input/output pairs been completed?
|
|
Returns "TrainingSet".
|
|
The size of an input vector.
|
|
Returns the next input/output vector pair. You would typically use this in a fashion somewhat like: TrainingSet T("trset_file"); T.initialize(); Vector in,out; while (!T.epochOver()) { T.getNextPair(in,out); // do what you need to with in and out }
|
|
The size of an output vector.
|
|
The number of input/desired-output vector pairs in the training set.
|
|
Initialize the training set so that the first call to getNextPair() gives the first I/O pair stored.
|
|
Load from a binary file.
|
|
Load from a text file.
|
|
The transformer functions get.
|
|
debugging info - not to be confused with operator<< !
|
|
Weird TrainingSet arithmetics. Is not supposed to be effective: the only purpose is ease of use (at least for now) OPT: passing by value |
|
|
|
Saves the training set to a file.
|
|
Save the training set in binary format to the given filename.
|
|
Save the file in text format to the given filename.
|
|
Randomly changes order of stored pairs.
|
|
keep dimensions
|
|
only the input part
|
|
|
Here is the call graph for this function:
|
|
|
Allows you to print the TrainingSet onto a stream.
|
|
An iterator through the input vectors.
|
|
The set of input vectors.
|
|
Size of an input vector.
|
|
Size of an output vector.
|
|
Iterator through the output vectors.
|
|
The set of corresponding desired output vectors.
|