Stores a set of training examples for a neural net. More...
#include <corpus.h>
Public Member Functions | |
Corpus (string file="") | |
Construction, destruction. | |
Corpus (int dim) | |
Constructor, creating an empty corpus of dimension dim. | |
Corpus (const Corpus &c, unsigned int keepOnly=-1) | |
Copy constructor. | |
~Corpus () | |
Frees the memory. | |
void | erase (int dimension=0) |
Erases the corpus and start a new one with the given dimension. | |
bool | load (string file, bool verbose=false) |
Input, output. | |
void | write (string file) |
Write the corpus to a file. | |
void | display () const |
Writes to the standard output the set of elements. | |
unsigned int | size () const |
Accessors. | |
unsigned int | dimension () const |
Returns the number of inputs of each training example (i.e. the number of coordinates of each vector) | |
double * | elem (unsigned int index) const |
Returns the elem pointed by the given index. | |
std::string | name (unsigned int index) const |
Returns the name of the elem pointed by the given index. | |
void | addElem (double *elem, std::string name="") |
Add a sample to the corpus. | |
std::vector< double > | bounds () const |
Retuns the bounds of the corpus (the vector is : min_1 max_1 min_2 max_2 ... min_n max_n) |
Stores a set of training examples for a neural net.
Corpus::Corpus | ( | string | file = "" | ) |
Construction, destruction.
Default constructor. Loads a file if specified.
void Corpus::display | ( | ) | const |
Writes to the standard output the set of elements.
bool Corpus::load | ( | string | file, |
bool | verbose = false |
||
) |
Input, output.
Loads the corpus from an XMLÂ file
unsigned int Corpus::size | ( | ) | const |
Accessors.
Returns the number of elements (i.e. vectors) contained in the corpus