MLP Class Reference

#include <mlp.h>

Public Member Functions

 MLP (size_t n_in, std::vector< size_t > n_outs)
 
const std::vector< Layer > & layers () const
 
const std::vector< std::vector< Variable > > & results () const
 
const std::vector< Variable > & parameters () const
 
std::vector< Variable > & mutable_parameters ()
 
std::vector< Variable > & forward (const std::vector< double > &inputs)
 

Detailed Description

This class represents a Multi-Layer Perceptron (MLP) neural network.

Constructor & Destructor Documentation

◆ MLP()

MLP::MLP ( size_t  n_in,
std::vector< size_t >  n_outs 
)
inline

Constructs an MLP with the specified number of input connections and output connections for each layer.

Parameters
n_inThe number of input connections.
n_outsThe number of output connections for each layer.

Member Function Documentation

◆ forward()

std::vector< Variable > & MLP::forward ( const std::vector< double > &  inputs)

Computes the forward pass of the MLP given a vector of input values.

Parameters
inputsThe input values.
Returns
The output values of the MLP as a vector of Variables.

◆ layers()

const std::vector<Layer>& MLP::layers ( ) const
inline

Returns the layers in the MLP.

Returns
The layers.

◆ mutable_parameters()

std::vector<Variable>& MLP::mutable_parameters ( )
inline

Returns a mutable reference to the parameters of the MLP.

Returns
The mutable parameters.

◆ parameters()

const std::vector<Variable>& MLP::parameters ( ) const
inline

Returns all parameters of the MLP, including parameters of all layers.

Returns
The parameters.

◆ results()

const std::vector<std::vector<Variable> >& MLP::results ( ) const
inline

Returns the output results for each layer in the MLP.

Returns
The output results.

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