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

#include <Edge.h>

Public Member Functions

 Edge (double startWeight, Node *input=nullptr, Neuron *output=nullptr)
 
void setInput (Node *input)
 
void setOutput (Neuron *output)
 
void updateWeight (double learningRate)
 
double getWeightedOutput ()
 
double getWeightedDelta ()
 

Detailed Description

Edge between two nodes with weight W

____ _____
/ \ --- / \
| in | >------| W |--------> | out |
\____/ --- \_____/

Constructor & Destructor Documentation

Edge::Edge ( double  startWeight,
Node input = nullptr,
Neuron output = nullptr 
)

Create a new Edge between 2 Nodes. Start with given weight

Parameters
startWeightinitial weight of the edge
inputstart node of the edge
outputend node of the edge

Member Function Documentation

double Edge::getWeightedDelta ( )

Get the delta from the output Neuron weighted for back propagation

Returns
the delta of output node weighted with the current edge weight
double Edge::getWeightedOutput ( )

Get the output from the edge

Returns
the input weighted with the current edge weight
void Edge::setInput ( Node input)

Set the Node this Edge starts at

Parameters
inputnode to set for input of edge
void Edge::setOutput ( Neuron output)

Set the Neuron this Edge ends at Note: must be Neuron (not just Node) to allow for retrieving delta for training

Parameters
outputnode to set for output of edge, must be a neuron not just a node to allow for retrieving delta for training
void Edge::updateWeight ( double  learningRate)

Update the weight for the edge based on the backpropagation algorithm

Parameters
learningRatedistance to update weight

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