34 Layer(
int _nNeurons,
int _nInputs,
int _subject,
string _trial);
67 void setInputs(
const double *_inputs,
const double scale = 1.0,
const unsigned int offset = 0,
const int n = -1);
132 double getWeights(
int _neuronIndex,
int _weightIndex);
170 void snapWeights(
string prefix,
string _trial,
int _subject);
172 void snapWeightsMatrixFormat(
string prefix);
183 double learningRate = 0;
184 int myLayerIndex = 0;
187 int layerHasReported = 0;
190 double backwardError = 0;
193 double averageError = 0;
201 double weightChange=0;
actMethod
Options for activation functions of the neuron 0 for using the logistic function 1 for using the hype...
Definition: Neuron.h:62
void snapWeights(string prefix, string _trial, int _subject)
Snaps the final distribution of weights in a specific layer, this is overwritten every time the funct...
void setlearningRate(double _w_learningRate, double _b_learningRate)
Sets the learning rate.
double getGlobalError(int _neuronIndex)
Reports the global error that is assigned to a specific neuron in this layer.
void saveWeights()
Saves the temporal weight change of all weights in all neurons into files.
whichGradient
Options for what gradient of a chosen error to monitor.
Definition: Layer.h:44
This is the class for creating layers that are contained inside the Net class.
Definition: Layer.h:27
double getWeightChange()
Accesses the total sum of weight changes of all the neurons in this layer.
void setInputs(const double *_inputs, const double scale=1.0, const unsigned int offset=0, const int n=-1)
Sets the inputs to all neurons in the first hidden layer only.
void calcOutputs()
Demands that all neurons in this layer calculate their output.
void propInputs(int _index, double _value)
Sets the inputs to all neurons in the deeper layers (excluding the first hidden layer)
Layer(int _nNeurons, int _nInputs, int _subject, string _trial)
Constructor for Layer: it initialises the neurons internally.
biasInitMethod
Options for method of initialising biases 0 for initialising all weights to zero 1 for initialising a...
Definition: Neuron.h:48
void initLayer(int _layerIndex, Neuron::weightInitMethod _wim, Neuron::biasInitMethod _bim, Neuron::actMethod _am)
Initialises each layer with specific methods for weight/bias initialisation and activation function o...
Neuron * getNeuron(int _neuronIndex)
Allows access to a specific neuron.
~Layer()
Destructor De-allocated any memory.
double getWeights(int _neuronIndex, int _weightIndex)
Allows for accessing any specific weights in the layer.
double getSumOutput(int _neuronIndex)
Allows for accessing the sum output of any specific neuron.
void printLayer()
Prints on the console a full tree of this layer with the values of all weights and outputs for all ne...
This is the class for creating neurons inside the Layer class.
Definition: Neuron.h:28
void setError(double _error)
Sets the error to be propagated backward at all neurons in the output layer only.
void updateWeights()
Requests that all neurons perform one iteration of learning.
weightInitMethod
Options for method of initialising weights 0 for initialising all weights to zero 1 for initialising ...
Definition: Neuron.h:55
double getGradient(whichGradient _whichGradient)
Allows for accessing the error that propagates backward in the network.
double getOutput(int _neuronIndex)
Allows for accessing the activation of a specific neuron.
int getnNeurons()
Reports the number of neurons in this layer.
double getInitWeight(int _neuronIndex, int _weightIndex)
Reports the initial value that was assigned to a specific weight at the initialisatin of the network.
double getWeightDistance()
Performs squared root on the weight change.