Class neuron
The Neuron class does most of the work
Methods summary
public
|
#
cleanup( )
Cleanup unnecessary variables to save memory and serialization time
Cleanup unnecessary variables to save memory and serialization time
|
public
|
#
adjust_weights_clean( $learningrate, $delta )
Adjusts the weights of the synapses as well as the bias and momentum
and cleans up uneeded varibles when finished.
Adjusts the weights of the synapses as well as the bias and momentum
and cleans up uneeded varibles when finished.
Parameters
- $learningrate
- learning rate
- $delta
|
public
|
#
adjust_weights( $learningrate, $delta )
Adjusts the weights of the synapses as well as the bias and momentum
but keeps the variables and sets the synapses delta
Adjusts the weights of the synapses as well as the bias and momentum
but keeps the variables and sets the synapses delta
Parameters
- $learningrate
- learning rate
- $delta
|
public
|
#
randomize_weights( $weightrange )
Set the synapse weights to a random number within a range
Set the synapse weights to a random number within a range
Parameters
- $weightrange
- of the random weight
|
public
Sigmoid
|
#
sigmoid( $value )
Mathematical sigmoid function, mainly because PHP doesn't have it natively.
Mathematical sigmoid function, mainly because PHP doesn't have it natively.
Parameters
- $value
- to return the sigmoid of
Returns
Sigmoid of given number
|
public
|
#
add_synapse( $weightrange = 1 )
Add a synapse to the synapse array
Add a synapse to the synapse array
Parameters
- $weightrange
- for random weights
|
public
|
#
remove_synapse( )
Remove a synapse from the synapse array
Remove a synapse from the synapse array
|
public
|
#
neuron( $inputs, $bias, $weightrange )
Neuron constructor
Parameters
- $inputs
- of inputs
- $bias
- $weightrange
|