\MRNN
Most Retarded Neural Network ever. Yep, with single neuron.
Synopsis
class MRNN
{
- // members
- protected float $weight = 0.01;
- protected integer $lastError = 1;
- protected float $smoothing = 0.0001;
- protected float $actualResult = 0.01;
- protected integer $correction = 0;
- protected integer $epoch = 0;
- protected array $trainStats = ;
- protected integer $statEvery = 5000;
- protected bool $debug = false;
- protected string $activationFunction = 'def';
- // methods
- public void __construct()
- public void setWeight()
- protected void setActivationFunc()
- public float processInputData()
- public float restoreInputData()
- protected float sigmoid()
- protected float unsigmoid()
- protected void train()
- protected bool learn()
- public bool learnDataSet()
- public array getTrainStats()
- public float getWeight()
- protected float getLastError()
- protected float getEpoch()
- public void setDebug()
- public string visualizeTrain()
Members
protected
- $activationFunction
—
string
Contains network activation function type - $actualResult
—
float
Training routine result - $correction
—
float
Contains current weight correction - $debug
—
bool
Output of debug messages due train progress - $epoch
—
int
Contains current training iteration - $lastError
—
float
Last neuron training error - $smoothing
—
float
Smoothing factor - $statEvery
—
int
Contains train stats multiplier - $trainStats
—
array
Contains current training stats as epoch=>error - $weight
—
float
Initial weight
Methods
protected
- getEpoch() — Returns current training epoch
- getLastError() — Returns current train last error
- learn() — Train neural network on some single input value
- setActivationFunc() — Sets network instance activation function type
- sigmoid() — Just native sigmoid function
- train() — Do the neuron train routine
- unsigmoid() — Inverse of native sigmoid function
public
- __construct() — What did you expect?
- getTrainStats() — Retrurns current network instance training stats
- getWeight() — Returns current neuron weight
- learnDataSet() — Performs training of neural network with
- processInputData() — Returns data output processed by trained neuron (forward)
- restoreInputData() — Returns data input processed by trained neuron (backward)
- setDebug() — Sets debug state of learning progress
- setWeight() — Sets neuron instance weight
- visualizeTrain() — Performs network training progress