UESMANN CPP  1.0
Reference implementation of UESMANN
Public Member Functions | Public Attributes | Friends | List of all members
Net::SGDParams Struct Reference

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>

Public Member Functions

SGDParamscrossValidationManual (int slices, int nperslice, int interval)
 fluent setter for cross-validation parameters manually; consider using crossValidation instead More...
 
SGDParamssetShuffle (ExampleSet::ShuffleMode m)
 fluent setter for preserveHAlternation More...
 
SGDParamssetSelectBestWithCV (bool v=true)
 fluent setter for selectBestWithCV More...
 
SGDParamssetCVShuffle (bool v=true)
 fluent setter for cvShuffle More...
 
SGDParamssetInitRange (double range=-1)
 fluent setter for initrange More...
 
SGDParamssetSeed (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...
 
SGDParamscrossValidation (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...
 
SGDParamsstoreBest ()
 set up a "best net buffer" to store the best network found, to which the network will be set on completion of training. More...
 

Public Attributes

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...
 

Friends

class Net
 

Detailed Description

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.

Constructor & Destructor Documentation

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
_etalearning rate to use
_itersnumber 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.

Member Function Documentation

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
examplesthe example set we will train with
propCVthe proportion of the training set to use for cross-validation
cvCountthe desired number of cross-validation events across the training run
cvSlicesthe desired number of cross-validation slices
cvShufshould 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
slicesnumber of slices
nperslicenumber of examples per slice
intervaliteration 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.

SGDParams& Net::SGDParams::setSeed ( long  v)
inline

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.

SGDParams& Net::SGDParams::setShuffle ( ExampleSet::ShuffleMode  m)
inline

fluent setter for preserveHAlternation

Definition at line 224 of file net.hpp.

SGDParams& Net::SGDParams::storeBest ( )
inline

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.

Friends And Related Function Documentation

friend class Net
friend

Definition at line 174 of file net.hpp.

Member Data Documentation

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.

ExampleSet::ShuffleMode Net::SGDParams::shuffleMode

The shuffle mode to use - see the ExampleSet::ShuffleMode enum for details.

Definition at line 221 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: