NNetCpp
Neural network implementation in C++
 All Classes Namespaces Functions Variables
Public Member Functions | List of all members
OutputNeuron Class Reference

#include <OutputNeuron.h>

Inheritance diagram for OutputNeuron:
Neuron Node

Public Member Functions

 OutputNeuron (std::function< double(double)> activationFunc)
 
 OutputNeuron (std::function< double(double)> activationFunc, std::vector< Edge * > inputs)
 
 OutputNeuron (std::function< double(double)> activationFunc, double targetValue)
 
void calcDelta ()
 
void setTarget (double targetValue)
 
double getDifference ()
 
- Public Member Functions inherited from Neuron
 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 ()
 

Additional Inherited Members

- Protected Member Functions inherited from Neuron
double sigmoidDelta ()
 
- Protected Attributes inherited from Neuron
double delta = 0
 

Detailed Description

Neuron at end of Neural Network outputting the nets output

Constructor & Destructor Documentation

OutputNeuron::OutputNeuron ( std::function< double(double)>  activationFunc)

Create a new OutputNeuron using the given activation function

Parameters
activationFuncfunction to use for neuron activation
OutputNeuron::OutputNeuron ( std::function< double(double)>  activationFunc,
std::vector< Edge * >  inputs 
)

Create a new OutputNeuron using the given activation function with given inputs

Parameters
activationFuncfunction to use for neuron activation
inputsvector of pointers to incoming edges
OutputNeuron::OutputNeuron ( std::function< double(double)>  activationFunc,
double  targetValue 
)

Create a new OutputNeuron using the given activation function and target value

Parameters
activationFuncfunction to use for neuron activation
targetValuetarget output value of the neuron

Member Function Documentation

void OutputNeuron::calcDelta ( )

Calculate delta for output Neuron according to the GDR
Inherits:
Calculate and store the delta from this Neuron according to the GDR. All output Neurons should have their deltas updated before calculating this.

double OutputNeuron::getDifference ( )

Get the difference between actual output and target

Returns
the difference for the Neurons current values
void OutputNeuron::setTarget ( double  targetValue)

Set the target value of the OutputNeuron

Parameters
targetValuevalue to target as output

The documentation for this class was generated from the following files: