Training parameters for trainSGD(). This structure holds the parameters for the trainSGD() method, and serves as a better way of passing them than a long parameter list. All values have defaults set up by the constructor, which are given as constants. You can set parameters by hand, but there are fluent (chainable) setters for many members.
More...
#include <net.hpp>
|
SGDParams & | crossValidationManual (int slices, int nperslice, int interval) |
| fluent setter for cross-validation parameters manually; consider using crossValidation instead More...
|
|
SGDParams & | setShuffle (ExampleSet::ShuffleMode m) |
| fluent setter for preserveHAlternation More...
|
|
SGDParams & | setSelectBestWithCV (bool v=true) |
| fluent setter for selectBestWithCV More...
|
|
SGDParams & | setCVShuffle (bool v=true) |
| fluent setter for cvShuffle More...
|
|
SGDParams & | setInitRange (double range=-1) |
| fluent setter for initrange More...
|
|
SGDParams & | setSeed (long v) |
| fluent setter for seed More...
|
|
| SGDParams (double _eta, int _iters) |
| Constructor which sets up defaults with no information about examples - cross-validation is not set up by default, but can be done by calling crossValidation() or crossValidationManual(). More...
|
|
| SGDParams (double _eta, const ExampleSet &examples, int _iters) |
|
| ~SGDParams () |
| Destructor. More...
|
|
SGDParams & | crossValidation (const ExampleSet &examples, double propCV, int cvCount, int cvSlices, bool cvShuf=true) |
| Set up the cross-validation parameters given the full training set, the proportion to be used for CV, the number of CV events in the training run, and the number of CV slices to use. More...
|
|
SGDParams & | storeBest () |
| set up a "best net buffer" to store the best network found, to which the network will be set on completion of training. More...
|
|
|
int | iterations |
| number of iterations to run: an iteration is the presentation of a single example, NOT an epoch (or occasionally pair-presentation) as is the case in the thesis when discussing the modulatory network types. More...
|
|
double | eta |
|
int | nSlices |
| The number of cross-validation slices to use. More...
|
|
int | nPerSlice |
| the number of example per cross-validation slice More...
|
|
int | cvInterval |
| how often to cross-validate given as the interval between CV events: 1 is every iteration, 2 is every other iteration and so on. More...
|
|
ExampleSet::ShuffleMode | shuffleMode |
| The shuffle mode to use - see the ExampleSet::ShuffleMode enum for details. More...
|
|
bool | selectBestWithCV |
| if true, use the minimum CV error to find the best net, otherwise use the training error. Note that if true, networks will only be tested when the cross-validation runs. More...
|
|
bool | cvShuffle |
| if true, shuffle the entire CV data set when all slices have been done so that the cross-validation has (effectively) a new set of slices each time. More...
|
|
int | initrange |
| range of initial weights/biases [-n,n], or -1 for Bishop's rule. More...
|
|
long | seed |
| seed for random number generator used to initialise weights and also perform shuffling More...
|
|
double * | bestNetBuffer |
| a buffer of at least getDataSize() bytes for the best network. If NULL, the best network is not saved. More...
|
|
bool | storeBestNet |
| true if we should store the best net data More...
|
|
Training parameters for trainSGD(). This structure holds the parameters for the trainSGD() method, and serves as a better way of passing them than a long parameter list. All values have defaults set up by the constructor, which are given as constants. You can set parameters by hand, but there are fluent (chainable) setters for many members.
Definition at line 173 of file net.hpp.
Net::SGDParams::SGDParams |
( |
double |
_eta, |
|
|
int |
_iters |
|
) |
| |
|
inline |
Constructor which sets up defaults with no information about examples - cross-validation is not set up by default, but can be done by calling crossValidation() or crossValidationManual().
- Parameters
-
_eta | learning rate to use |
_iters | number of iterations to run: an iteration is the presentation of a single example, NOT a pair-presentation as is the case in the thesis when discussing the modulatory network types. |
Definition at line 323 of file net.hpp.
Net::SGDParams::SGDParams |
( |
double |
_eta, |
|
|
const ExampleSet & |
examples, |
|
|
int |
_iters |
|
) |
| |
|
inline |
Alternative constructor which uses the examples to calculate the number of iterations from an epoch count
Definition at line 332 of file net.hpp.
Net::SGDParams::~SGDParams |
( |
| ) |
|
|
inline |
Destructor.
Definition at line 340 of file net.hpp.
SGDParams& Net::SGDParams::crossValidation |
( |
const ExampleSet & |
examples, |
|
|
double |
propCV, |
|
|
int |
cvCount, |
|
|
int |
cvSlices, |
|
|
bool |
cvShuf = true |
|
) |
| |
|
inline |
Set up the cross-validation parameters given the full training set, the proportion to be used for CV, the number of CV events in the training run, and the number of CV slices to use.
- Parameters
-
examples | the example set we will train with |
propCV | the proportion of the training set to use for cross-validation |
cvCount | the desired number of cross-validation events across the training run |
cvSlices | the desired number of cross-validation slices |
cvShuf | should cvShuffle be true? |
- Returns
- a reference to this, so we can do fluent chains.
Definition at line 356 of file net.hpp.
SGDParams& Net::SGDParams::crossValidationManual |
( |
int |
slices, |
|
|
int |
nperslice, |
|
|
int |
interval |
|
) |
| |
|
inline |
fluent setter for cross-validation parameters manually; consider using crossValidation instead
- Parameters
-
slices | number of slices |
nperslice | number of examples per slice |
interval | iteration interval for cross-validation events |
Definition at line 210 of file net.hpp.
SGDParams& Net::SGDParams::setCVShuffle |
( |
bool |
v = true | ) |
|
|
inline |
fluent setter for cvShuffle
Definition at line 252 of file net.hpp.
SGDParams& Net::SGDParams::setInitRange |
( |
double |
range = -1 | ) |
|
|
inline |
fluent setter for initrange
Definition at line 263 of file net.hpp.
fluent setter for seed
Definition at line 275 of file net.hpp.
SGDParams& Net::SGDParams::setSelectBestWithCV |
( |
bool |
v = true | ) |
|
|
inline |
fluent setter for selectBestWithCV
Definition at line 239 of file net.hpp.
fluent setter for preserveHAlternation
Definition at line 224 of file net.hpp.
set up a "best net buffer" to store the best network found, to which the network will be set on completion of training.
- Returns
- a reference to this, so we can do fluent chains.
Definition at line 394 of file net.hpp.
double* Net::SGDParams::bestNetBuffer |
a buffer of at least getDataSize() bytes for the best network. If NULL, the best network is not saved.
Definition at line 284 of file net.hpp.
int Net::SGDParams::cvInterval |
how often to cross-validate given as the interval between CV events: 1 is every iteration, 2 is every other iteration and so on.
Definition at line 203 of file net.hpp.
bool Net::SGDParams::cvShuffle |
if true, shuffle the entire CV data set when all slices have been done so that the cross-validation has (effectively) a new set of slices each time.
Definition at line 249 of file net.hpp.
double Net::SGDParams::eta |
The learning rate to use
Definition at line 186 of file net.hpp.
int Net::SGDParams::initrange |
range of initial weights/biases [-n,n], or -1 for Bishop's rule.
Definition at line 260 of file net.hpp.
int Net::SGDParams::iterations |
number of iterations to run: an iteration is the presentation of a single example, NOT an epoch (or occasionally pair-presentation) as is the case in the thesis when discussing the modulatory network types.
Definition at line 181 of file net.hpp.
int Net::SGDParams::nPerSlice |
the number of example per cross-validation slice
Definition at line 197 of file net.hpp.
int Net::SGDParams::nSlices |
The number of cross-validation slices to use.
Definition at line 192 of file net.hpp.
long Net::SGDParams::seed |
seed for random number generator used to initialise weights and also perform shuffling
Definition at line 272 of file net.hpp.
bool Net::SGDParams::selectBestWithCV |
if true, use the minimum CV error to find the best net, otherwise use the training error. Note that if true, networks will only be tested when the cross-validation runs.
Definition at line 236 of file net.hpp.
bool Net::SGDParams::storeBestNet |
true if we should store the best net data
Definition at line 289 of file net.hpp.
The documentation for this struct was generated from the following file:
- /home/travis/build/jimfinnis/uesmanncpp/net.hpp