Cpp ML Library  1.0.0
A library of Machine Learning Algorithmns seen from the Udemy course Machine Learning A to Z.
Public Member Functions | List of all members
NeuralNetwork Class Reference

Represents the neural network consisting of layers of neurons. More...

#include <NeuralNetwork.hpp>

Public Member Functions

 NeuralNetwork (const std::vector< unsigned > &topology)
 Constructs a NeuralNetwork with the given topology. More...
 
void feedForward (const std::vector< double > &inputVals)
 Feeds the input values forward through the network. More...
 
void backProp (const std::vector< double > &targetVals)
 Performs backpropagation to adjust weights. More...
 
void getResults (std::vector< double > &resultVals) const
 Gets the results from the output layer. More...
 
double getRecentAverageError () const
 Gets the recent average error of the network. More...
 

Detailed Description

Represents the neural network consisting of layers of neurons.

Constructor & Destructor Documentation

◆ NeuralNetwork()

NeuralNetwork::NeuralNetwork ( const std::vector< unsigned > &  topology)

Constructs a NeuralNetwork with the given topology.

Parameters
topologyA vector representing the number of neurons in each layer.

Member Function Documentation

◆ backProp()

void NeuralNetwork::backProp ( const std::vector< double > &  targetVals)

Performs backpropagation to adjust weights.

Parameters
targetValsThe target output values.

◆ feedForward()

void NeuralNetwork::feedForward ( const std::vector< double > &  inputVals)

Feeds the input values forward through the network.

Parameters
inputValsThe input values.

◆ getRecentAverageError()

double NeuralNetwork::getRecentAverageError ( ) const

Gets the recent average error of the network.

Returns
The recent average error.

◆ getResults()

void NeuralNetwork::getResults ( std::vector< double > &  resultVals) const

Gets the results from the output layer.

Parameters
resultValsThe vector to store output values.

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