20 typedef std::vector<Neuron>
Layer;
40 Neuron(
unsigned numOutputs,
unsigned myIdx);
105 static double randomWeight() {
return rand() / double(RAND_MAX); }
108 std::vector<Connection> _outputWeights;
120 static double transferFunction(
double x);
131 static double transferFunctionDerivative(
double x);
142 double sumDOW(
const Layer& nextLayer)
const;
std::vector< Neuron > Layer
Represents a layer of neurons in the neural network.
Definition: Neuron.hpp:20
Represents a single neuron within a neural network layer.
Definition: Neuron.hpp:29
void updateInputWeights(Layer &prevLayer)
Updates the weights of connections from the previous layer.
Definition: Neuron.cpp:35
void setOutputVal(double val)
Sets the neuron's output value.
Definition: Neuron.hpp:47
void feedForward(const Layer &prevLayer)
Feeds the input values forward through the neuron.
Definition: Neuron.cpp:126
void calcHiddenGradients(const Layer &nextLayer)
Calculates gradients for hidden layer neurons.
Definition: Neuron.cpp:74
double getOutputVal() const
Retrieves the neuron's output value.
Definition: Neuron.hpp:54
Neuron(unsigned numOutputs, unsigned myIdx)
Constructs a Neuron with a specified number of outputs.
Definition: Neuron.cpp:144
void calcOutputGradients(double targetVal)
Calculates the gradient for output layer neurons.
Definition: Neuron.cpp:87