#include <ConnectedNet.h>
A fully connected Neural Network
ConnectedNet::ConnectedNet |
( |
int |
inputNodes, |
|
|
std::vector< int > |
hiddenLayers, |
|
|
int |
outputNodes, |
|
|
WeightGenerator * |
weightGen = nullptr |
|
) |
| |
Create a new ConnectedNet of given dimensions.
For example: For a 3x5x4x4x2 network one would put
inputNodes - 3
hiddenLayers - [5, 4, 4]
outputNodes - 2
- Parameters
-
inputNodes | amount of inputs to the network |
hiddenLayers | vector of dimensions of hidden layers, number at each index becomes amount of neurons in hidden layer at that index |
outputNodes | amount of outputs from the network |
weightGen | generator to use for initializing weights in the network, if left a nullptr it is replaced with a default random generator |
ConnectedNet::~ConnectedNet |
( |
| ) |
|
std::vector< double > ConnectedNet::getDifference |
( |
| ) |
|
Get a vector of difference between target and output
- Returns
- the difference vector
std::vector< double > ConnectedNet::getOutput |
( |
std::vector< double > |
inputValues | ) |
|
Present an input to the ConnectedNet and get the output
- Parameters
-
inputValues | input vector to the net |
- Returns
- the output vector of the net
void ConnectedNet::train |
( |
TrainingData & |
tData, |
|
|
double |
learningRate |
|
) |
| |
Train the net on one input - target vector pair with speed learningrate returns the error
- Parameters
-
tData | a piece of training data to use for training the net |
learningRate | rate to adjust weights in training |
The documentation for this class was generated from the following files: