openGPMP
Open Source Mathematics Package
|
Secondary Multi-Layer Perceptron Class making use of the Linear Algebra module. More...
#include <mlp_net.hpp>
Public Member Functions | |
void | log (auto &file, const auto &x, const auto &y, const auto &y_hat) |
long double | sigmoid_activ (long double x) |
Sigmoid activation function. More... | |
long double | sigmoid_deriv (long double x) |
Sigmoid Derivative for backwards propogation. More... | |
SecondaryMLP (std::vector< size_t > _layer_units, long double _lr=.001) | |
auto | prop_forwards (gpmp::linalg::Matrix< T > x) |
void | prop_backwards (gpmp::linalg::Matrix< T > target) |
Public Attributes | |
std::vector< size_t > | layer_units |
std::vector< gpmp::linalg::Matrix< T > > | bias_vectors |
std::vector< gpmp::linalg::Matrix< T > > | wt_mtx |
std::vector< gpmp::linalg::Matrix< T > > | activations |
long double | lr |
Secondary Multi-Layer Perceptron Class making use of the Linear Algebra module.
Definition at line 151 of file mlp_net.hpp.
|
inlineexplicit |
Secondary Multi-Layer Perceptron Constructor Initialize a set of weights + biases for each layer set to random Gaussian Noise related values
Definition at line 194 of file mlp_net.hpp.
References gpmp::ml::SecondaryMLP< T >::activations, gpmp::ml::SecondaryMLP< T >::bias_vectors, gpmp::ml::SecondaryMLP< T >::layer_units, gpmp::linalg::mtx< T >::randn(), and gpmp::ml::SecondaryMLP< T >::wt_mtx.
|
inline |
Logging function for collecting the results
Definition at line 156 of file mlp_net.hpp.
|
inline |
Backwards Propagation is utilized to optimize the net's weights. Enabling learning how to correctly map arbitrary inputs to outputs. The goal being to update each weight of the network allowing them to increase the chance of the actual output being closer to the target output. This method takes the target output as an input parameter
Definition at line 245 of file mlp_net.hpp.
References gpmp::ml::SecondaryMLP< T >::activations, gpmp::ml::SecondaryMLP< T >::bias_vectors, gpmp::ml::SecondaryMLP< T >::layer_units, gpmp::ml::SecondaryMLP< T >::lr, gpmp::ml::SecondaryMLP< T >::sigmoid_deriv(), and gpmp::ml::SecondaryMLP< T >::wt_mtx.
|
inline |
Forward passes compute the activations at a specific layer. This method saves the results to the activations Matrix passing it forwards to use as an input paramater on the next layer
Definition at line 221 of file mlp_net.hpp.
References gpmp::ml::SecondaryMLP< T >::activations, gpmp::ml::SecondaryMLP< T >::bias_vectors, gpmp::ml::SecondaryMLP< T >::layer_units, gpmp::ml::SecondaryMLP< T >::sigmoid_activ(), and gpmp::ml::SecondaryMLP< T >::wt_mtx.
|
inline |
Sigmoid activation function.
[in] | x | : (float) |
Definition at line 169 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_forwards().
|
inline |
Sigmoid Derivative for backwards propogation.
[in] | x | : (float) |
Definition at line 178 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards().
std::vector<gpmp::linalg::Matrix<T> > gpmp::ml::SecondaryMLP< T >::activations |
Definition at line 185 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards(), gpmp::ml::SecondaryMLP< T >::prop_forwards(), and gpmp::ml::SecondaryMLP< T >::SecondaryMLP().
std::vector<gpmp::linalg::Matrix<T> > gpmp::ml::SecondaryMLP< T >::bias_vectors |
Definition at line 183 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards(), gpmp::ml::SecondaryMLP< T >::prop_forwards(), and gpmp::ml::SecondaryMLP< T >::SecondaryMLP().
std::vector<size_t> gpmp::ml::SecondaryMLP< T >::layer_units |
Definition at line 182 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards(), gpmp::ml::SecondaryMLP< T >::prop_forwards(), and gpmp::ml::SecondaryMLP< T >::SecondaryMLP().
long double gpmp::ml::SecondaryMLP< T >::lr |
Definition at line 187 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards().
std::vector<gpmp::linalg::Matrix<T> > gpmp::ml::SecondaryMLP< T >::wt_mtx |
Definition at line 184 of file mlp_net.hpp.
Referenced by gpmp::ml::SecondaryMLP< T >::prop_backwards(), gpmp::ml::SecondaryMLP< T >::prop_forwards(), and gpmp::ml::SecondaryMLP< T >::SecondaryMLP().