#include <patternset.h>
Inheritance diagram for PatternSet:
Public Methods | |
PatternSet (int patts, int ins, int outs) | |
PatternSet (const String &fname, int ins=0, int outs=0) | |
PatternSet (const Matrix &m, int ins=-1, int outs=0) | |
PatternSet (const PatternSet &orig) | |
void | make (int patts=0, int ins=0, int outs=0) |
virtual void | load (const char *filename) |
virtual void | load (TextIStream &in, const String &extension=".raw") |
void | save (const String &filename, int filetype=FT_SNNS) |
virtual void | print (FILE *out=stdout) const |
virtual double | input (int p, int i) const |
virtual double | output (int p, int j) const |
virtual void | set_input (int p, int i, double value) |
virtual void | set_output (int p, int j, double value) |
Ref< Matrix > | getMatrix () const |
void | mutate (int errcnt) |
void | recombine (int startp=-1, int endp=-1) |
void | recombine2 (int startp=-1, int endp=-1) |
virtual void | copy (const PatternSet &orig, int start=-1, int end=-1) |
void | check () const |
Protected Methods | |
void | calc_means () |
void | calc_stddevs () |
Protected Attributes | |
Matrix | mInps |
Matrix | mOutps |
Definition at line 181 of file patternset.h.
|
Constructs an empty pattern set of the given dimensions.
Definition at line 231 of file patternset.cc. References PatternSource::inputs, make(), PatternSource::outputs, and PatternSource::patterns. |
|
Constructs and loads a pattern set from a file. The file must be in SNNS pattern file format. If the dimensions of the training set have not been set, load tries to deduce them from the file. If the dimensions of the file differ from the values that may have been given in the construction, an exception is thrown.
Definition at line 248 of file patternset.cc. References PatternSource::inputs, load(), PatternSource::outputs, and PatternSource::patterns. |
|
Copy constructor.
Definition at line 259 of file patternset.cc. References make(), set_input(), and set_output(). |
|
Copy constructor.
Definition at line 273 of file patternset.cc. References check(). |
|
Calculates the averages of each input and output field.
|
|
Calculates the standard deviations of each input and output field.
|
|
Checks internal consistency of the object.
Reimplemented from PatternSource. Definition at line 404 of file patternset.cc. References PatternSource::check(). Referenced by PatternSet(). |
|
Implementation for PatternSource. Copies a range from another training set.
Definition at line 409 of file patternset.cc. References PatternSource::copy(). |
|
Returns all the patterns (both input and output variables) as a Matrix.
Definition at line 413 of file patternset.cc. References input(), PatternSource::inputs, output(), PatternSource::outputs, and PatternSource::patterns. |
|
Returns the input value of the given pattern.
Reimplemented from PatternSource. Definition at line 220 of file patternset.h. References mInps. Referenced by getMatrix(), and BackpropTrainer::trainPattern(). |
|
Loads a pattern set from a pattern input stream.
Definition at line 298 of file patternset.cc. References DataFormatLib::load(). |
|
Loads a pattern set from a pattern file. Supports SNNS file format (.pat), Proben1 (.dt), and matrix file format (other suffixes). Overloadable to allow implementations of other formats. Definition at line 289 of file patternset.cc. References DataFormatLib::load(). Referenced by PatternSet(). |
|
Constructs an empty pattern set with the given dimensions.
Reimplemented from PatternSource. Definition at line 277 of file patternset.cc. Referenced by SNNSDataFormat::load(), and PatternSet(). |
|
Mutates the inputs of the training set by given number of errors. The number of errors equals to the hamming distance between normal and mutated patterns. Definition at line 330 of file patternset.cc. References mInps. |
|
Returns the output value of the given pattern.
Reimplemented from PatternSource. Definition at line 223 of file patternset.h. References mOutps. Referenced by getMatrix(), and BackpropTrainer::trainPattern(). |
|
Outputs the patternset to a C-style FILE stream.
Reimplemented from PatternSource. Definition at line 313 of file patternset.cc. |
|
Permutates a set of patterns to a random configuration. If range is specified, only those patterns are reshuffled. Reimplemented from PatternSource. Definition at line 350 of file patternset.cc. References PatternSource::inputs, mInps, mOutps, PatternSource::outputs, and PatternSource::patterns. |
|
As above, except ...
Reimplemented from PatternSource. Definition at line 375 of file patternset.cc. References PatternSource::inputs, mInps, mOutps, PatternSource::outputs, and PatternSource::patterns. |
|
Saves the pattern set. The pattern set is saved with the given output format.
Definition at line 307 of file patternset.cc. References DataFormatLib::save(). |
|
Sets the input value of the given pattern.
Reimplemented from PatternSource. Definition at line 226 of file patternset.h. References mInps. Referenced by SNNSDataFormat::load(), AbsoluteNeuralPrediction::makeSet(), and PatternSet(). |
|
Sets the input value of the given pattern.
Reimplemented from PatternSource. Definition at line 229 of file patternset.h. References mOutps. Referenced by SNNSDataFormat::load(), AbsoluteNeuralPrediction::makeSet(), and PatternSet(). |
|
Input patterns.
Definition at line 261 of file patternset.h. Referenced by input(), make(), mutate(), print(), recombine(), recombine2(), and set_input(). |
|
Output patterns.
Definition at line 264 of file patternset.h. Referenced by make(), output(), print(), recombine(), recombine2(), and set_output(). |