#include <Neuron.h>
Public Member Functions | |
Neuron (std::function< double(double)> activationFunc, std::vector< Edge * > inputs, std::vector< Edge * > outputs) | |
Neuron (std::function< double(double)> activationFunc) | |
void | setInputs (std::vector< Edge * > inputs) |
void | setOutputs (std::vector< Edge * > outputs) |
void | calcOutput () |
void | calcDelta () |
double | getOutput () |
double | getDelta () |
Protected Member Functions | |
double | sigmoidDelta () |
Protected Attributes | |
double | delta = 0 |
A neuron, part of a neural network.
Neuron::Neuron | ( | std::function< double(double)> | activationFunc, |
std::vector< Edge * > | inputs, | ||
std::vector< Edge * > | outputs | ||
) |
Create a new Neuron with the given in- and outputs
activationFunc | function to use for neuron activation |
inputs | vector of pointers to incoming edges |
outputs | vector of pointers to outgoing edges |
Neuron::Neuron | ( | std::function< double(double)> | activationFunc | ) |
Create a new Neuron
activationFunc | function to use for neuron activation |
void Neuron::calcDelta | ( | ) |
Calculate and store the delta from this Neuron according to the GDR. All output Neurons should have their deltas updated before calculating this.
void Neuron::calcOutput | ( | ) |
Calculate and store the output from this Neuron. All input Neurons should have their outputs updated before calculating this.
double Neuron::getDelta | ( | ) |
Get delta for backpropagation
|
virtual |
void Neuron::setInputs | ( | std::vector< Edge * > | inputs | ) |
Set the edges in to this Neuron
inputs | vector of pointers to incoming edges |
void Neuron::setOutputs | ( | std::vector< Edge * > | outputs | ) |
Set the edges out from this Neuron
outputs | vector of pointers to outgoing edges |
|
protected |
Get the derivative of a sigmoid activation function for this node
|
protected |
Delta for backpropagation