Represents a single neuron in the neural network.
More...
#include <NeuralNetwork.hpp>
Represents a single neuron in the neural network.
◆ Neuron()
Neuron::Neuron |
( |
unsigned |
numOutputs, |
|
|
unsigned |
index |
|
) |
| |
Constructs a Neuron.
- Parameters
-
numOutputs | The number of outputs from this neuron. |
index | The index of this neuron in its layer. |
◆ calcHiddenGradients()
void Neuron::calcHiddenGradients |
( |
const std::vector< Neuron > & |
nextLayer | ) |
|
Calculates the hidden gradients for hidden layers.
- Parameters
-
nextLayer | The next layer of neurons. |
◆ calcOutputGradients()
void Neuron::calcOutputGradients |
( |
double |
targetVal | ) |
|
Calculates the output gradients for the output layer.
- Parameters
-
targetVal | The target value. |
◆ feedForward()
void Neuron::feedForward |
( |
const std::vector< Neuron > & |
prevLayer | ) |
|
Feeds forward the input values to the next layer.
- Parameters
-
prevLayer | The previous layer of neurons. |
◆ getOutputVal()
double Neuron::getOutputVal |
( |
| ) |
const |
Gets the output value of the neuron.
- Returns
- The output value.
◆ setOutputVal()
void Neuron::setOutputVal |
( |
double |
val | ) |
|
Sets the output value of the neuron.
- Parameters
-
◆ updateInputWeights()
void Neuron::updateInputWeights |
( |
std::vector< Neuron > & |
prevLayer | ) |
|
Updates the input weights for the neuron.
- Parameters
-
prevLayer | The previous layer of neurons. |
The documentation for this class was generated from the following file: