philsupertramp/game-math
|
#include <Classifier.h>
Public Member Functions | |
ANNClassifier (double _eta, int _n_iter) | |
virtual Matrix< double > | activation (const Matrix< double > &)=0 |
virtual Matrix< double > | netInput (const Matrix< double > &)=0 |
virtual double | costFunction (const Matrix< double > &)=0 |
Public Member Functions inherited from Classifier | |
Classifier () | |
void | initialize_weights (size_t numRows, size_t numColumns=1) |
void | update_weights (const Matrix< double > &update, const Matrix< double > &delta) |
Matrix< double > | transform (const Matrix< double > &in) override |
Public Member Functions inherited from Predictor | |
virtual void | fit (const Matrix< double > &X, const Matrix< double > &y)=0 |
virtual Matrix< double > | predict (const Matrix< double > &)=0 |
virtual Matrix< double > | transform (const Matrix< double > &)=0 |
Protected Attributes | |
double | eta |
Learning rate. More... | |
int | n_iter |
number epochs More... | |
Protected Attributes inherited from Classifier | |
bool | w_initialized = false |
flag to initialize weights only once More... | |
Additional Inherited Members | |
Public Attributes inherited from Classifier | |
Matrix< double > | weights |
Vector holding weights. More... | |
Matrix< double > | costs |
Vector holding classification error per epoch. More... | |
Artificial Neural Network Classifier interface.
Adds interface for activation, cost and net-input functions. As well as learning rate and constant for number of training epochs.
|
inline |
|
pure virtual |
calculates the current cost if unused override returning 0
Implemented in LogRegSGD, AdalineGD, AdalineSGD, and Perceptron.
calculates the net-input (aka output) this is mostly the derivative of activation
Implemented in AdalineGD, AdalineSGD, LogRegSGD, and Perceptron.
|
protected |
Learning rate.
|
protected |
number epochs