philsupertramp/game-math
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ANNClassifier Class Referenceabstract

#include <Classifier.h>

Inheritance diagram for ANNClassifier:
Classifier Predictor AdalineGD AdalineSGD LogRegSGD Perceptron

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ANNClassifier()

ANNClassifier::ANNClassifier ( double  _eta,
int  _n_iter 
)
inline

Member Function Documentation

◆ activation()

virtual Matrix< double > ANNClassifier::activation ( const Matrix< double > &  )
pure virtual

Activates a given input

Returns

Implemented in AdalineGD, AdalineSGD, LogRegSGD, and Perceptron.

◆ costFunction()

virtual double ANNClassifier::costFunction ( const Matrix< double > &  )
pure virtual

calculates the current cost if unused override returning 0

Implemented in LogRegSGD, AdalineGD, AdalineSGD, and Perceptron.

◆ netInput()

virtual Matrix< double > ANNClassifier::netInput ( const Matrix< double > &  )
pure virtual

calculates the net-input (aka output) this is mostly the derivative of activation

Returns

Implemented in AdalineGD, AdalineSGD, LogRegSGD, and Perceptron.

Member Data Documentation

◆ eta

double ANNClassifier::eta
protected

Learning rate.

◆ n_iter

int ANNClassifier::n_iter
protected

number epochs


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