#include <TrainingSet.h>
Public Methods | |
| TrainingSet (int in, int out) | |
| TrainingSet (const char *filename, int file_type=TEXT_FILE) | |
| virtual | ~TrainingSet () |
| void | addIOpair (real *input, real *output) |
| Add an input and correspoding output vector. More... | |
| void | addIOpair (VECTOR input, VECTOR output) |
| virtual void | initialize () |
| virtual bool | epochOver () |
| virtual int | getSize () |
| The number of input/desired-output vector pairs in the training set. More... | |
| virtual int | getInputSize () |
| The size of an input vector. More... | |
| virtual int | getOutputSize () |
| The size of an output vector. More... | |
| virtual void | getNextPair (VECTOR &input, VECTOR &desired) |
| virtual void | save (const char *filename, int file_type=TEXT_FILE) |
| virtual const char * | getClassName () |
| Returns "TrainingSet". More... | |
Protected Methods | |
| void | save_binary (const char *filename) |
| Save the training set in binary format to the given filename. More... | |
| void | save_text (const char *filename) |
| Save the file in text format to the given filename. More... | |
| void | load_binary (const char *filename) |
| Load from a binary file. More... | |
| void | load_text (const char *filename) |
| Load from a text file. More... | |
Protected Attributes | |
| std::vector< VECTOR > | _inputs |
| The set of input vectors. More... | |
| std::vector< VECTOR > | _outputs |
| The set of corresponding desired output vectors. More... | |
| std::vector< VECTOR >::iterator | _inputIter |
| An iterator through the input vectors. More... | |
| std::vector< VECTOR >::iterator | _outputIter |
| Iterator through the output vectors. More... | |
| int | _nInputs |
| Size of an input vector. More... | |
| int | _nOutputs |
| Size of an output vector. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &s, TrainingSet &T) |
| Allows you to print the TrainingSet onto a stream. More... | |
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.
|
|
|
|
|
||||||||||||
|
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.
|
|
||||||||||||
|
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.
|
|
||||||||||||
|
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.
|
1.2.14 written by Dimitri van Heesch,
© 1997-2002