C# Class AForge.Neuro.ActivationNeuron

Activation neuron.

Activation neuron computes weighted sum of its inputs, adds threshold value and then applies activation function. The neuron isusually used in multi-layer neural networks.

Inheritance: Neuron
Show file Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Protected Properties

Property Type Description
function IActivationFunction
threshold double

Public Methods

Method Description
ActivationNeuron ( int inputs, IActivationFunction function ) : System

Initializes a new instance of the ActivationNeuron class.

Compute ( double input ) : double

Computes output value of neuron.

The output value of activation neuron is equal to value of nueron's activation function, which parameter is weighted sum of its inputs plus threshold value. The output value is also stored in Output property.

The method may be called safely from multiple threads to compute neuron's output value for the specified input values. However, the value of Neuron.Output property in multi-threaded environment is not predictable, since it may hold neuron's output computed from any of the caller threads. Multi-threaded access to the method is useful in those cases when it is required to improve performance by utilizing several threads and the computation is based on the immediate return value of the method, but not on neuron's output property.

Randomize ( ) : void

Randomize neuron.

Calls base class Randomize method to randomize neuron's weights and then randomizes threshold's value.

Method Details

ActivationNeuron() public method

Initializes a new instance of the ActivationNeuron class.
public ActivationNeuron ( int inputs, IActivationFunction function ) : System
inputs int Neuron's inputs count.
function IActivationFunction Neuron's activation function.
return System

Compute() public method

Computes output value of neuron.

The output value of activation neuron is equal to value of nueron's activation function, which parameter is weighted sum of its inputs plus threshold value. The output value is also stored in Output property.

The method may be called safely from multiple threads to compute neuron's output value for the specified input values. However, the value of Neuron.Output property in multi-threaded environment is not predictable, since it may hold neuron's output computed from any of the caller threads. Multi-threaded access to the method is useful in those cases when it is required to improve performance by utilizing several threads and the computation is based on the immediate return value of the method, but not on neuron's output property.

Wrong length of the input vector, which is not /// equal to the expected value.
public Compute ( double input ) : double
input double Input vector.
return double

Randomize() public method

Randomize neuron.
Calls base class Randomize method to randomize neuron's weights and then randomizes threshold's value.
public Randomize ( ) : void
return void

Property Details

function protected property

Activation function.
The function is applied to inputs weighted sum plus threshold value.
protected IActivationFunction function
return IActivationFunction

threshold protected property

Threshold value.
The value is added to inputs weighted sum before it is passed to activation function.
protected double threshold
return double