C# Class Encog.Neural.Networks.BasicNetwork

Inheritance: Encog.ML.BasicML, IMLMethod, IContainsFlat, IMLContext, IMLRegression, IMLInputOutput, IMLInput, IMLOutput, IMLEncodable, IMLResettable, IMLClassification, IMLError
Exibir arquivo Open project: encog/encog-silverlight-core Class Usage Examples

Public Methods

Method Description
AddLayer ( ILayer layer ) : void

Add a layer to the neural network. If there are no layers added this layer will become the input layer. This function automatically updates both the input and output layer references.

AddWeight ( int fromLayer, int fromNeuron, int toNeuron, double v ) : void

Add to a weight.

BasicNetwork ( ) : System

Construct an empty neural network.

CalculateError ( IMLDataSet data ) : double

Calculate the error for this neural network.

CalculateNeuronCount ( ) : int

Calculate the total number of neurons in the network across all layers.

Classify ( IMLData input ) : int
ClearContext ( ) : void

Clear any data from any context layers.

Clone ( ) : Object

Return a clone of this neural network. Including structure, weights and bias values. This is a deep copy.

Compute ( IMLData input ) : IMLData

Compute the output for a given input to the neural network.

Compute ( double input, double output ) : void

Compute the output for this network.

DecodeFromArray ( double encoded ) : void
DumpWeights ( ) : String
EnableConnection ( int fromLayer, int fromNeuron, int toNeuron, bool enable ) : void

Enable, or disable, a connection.

EncodeToArray ( double encoded ) : void
EncodedArrayLength ( ) : int
Equals ( BasicNetwork other ) : bool

Compare the two neural networks. For them to be equal they must be of the same structure, and have the same matrix values.

Equals ( BasicNetwork other, int precision ) : bool

Determine if this neural network is equal to another. Equal neural networks have the same weight matrix and bias values, within a specified precision.

GetActivation ( int layer ) : IActivationFunction

Get the activation function for the specified layer.

GetHashCode ( ) : int

Generate a hash code.

GetLayerBiasActivation ( int l ) : double

Get the bias activation for the specified layer.

GetLayerNeuronCount ( int l ) : int

Get the neuron count.

GetLayerOutput ( int layer, int neuronNumber ) : double

Get the layer output for the specified neuron.

GetLayerTotalNeuronCount ( int l ) : int

Get the total (including bias and context) neuron cont for a layer.

GetWeight ( int fromLayer, int fromNeuron, int toNeuron ) : double

Get the weight between the two layers.

IsConnected ( int layer, int fromNeuron, int toNeuron ) : bool

Determine if the specified connection is enabled.

IsLayerBiased ( int l ) : bool

Determine if the specified layer is biased.

Reset ( ) : void

Reset the weight matrix and the bias values. This will use a Nguyen-Widrow randomizer with a range between -1 and 1. If the network does not have an input, output or hidden layers, then Nguyen-Widrow cannot be used and a simple range randomize between -1 and 1 will be used.

Reset ( int seed ) : void

Reset the weight matrix and the bias values. This will use a Nguyen-Widrow randomizer with a range between -1 and 1. If the network does not have an input, output or hidden layers, then Nguyen-Widrow cannot be used and a simple range randomize between -1 and 1 will be used. Use the specified seed.

SetLayerBiasActivation ( int l, double v ) : void

Set the bias activation for the specified layer.

SetWeight ( int fromLayer, int fromNeuron, int toNeuron, double v ) : void

Set the weight between the two specified neurons.

ToString ( ) : String

UpdateProperties ( ) : void

ValidateNeuron ( int targetLayer, int neuron ) : void

Validate the the specified targetLayer and neuron are valid.

Winner ( IMLData input ) : int

Determine the winner for the specified input. This is the number of the winning neuron.

Method Details

AddLayer() public method

Add a layer to the neural network. If there are no layers added this layer will become the input layer. This function automatically updates both the input and output layer references.
public AddLayer ( ILayer layer ) : void
layer ILayer The layer to be added to the network.
return void

AddWeight() public method

Add to a weight.
public AddWeight ( int fromLayer, int fromNeuron, int toNeuron, double v ) : void
fromLayer int The from layer.
fromNeuron int The from neuron.
toNeuron int The to neuron.
v double The value to add.
return void

BasicNetwork() public method

Construct an empty neural network.
public BasicNetwork ( ) : System
return System

CalculateError() public method

Calculate the error for this neural network.
public CalculateError ( IMLDataSet data ) : double
data IMLDataSet The training set.
return double

CalculateNeuronCount() public method

Calculate the total number of neurons in the network across all layers.
public CalculateNeuronCount ( ) : int
return int

Classify() public method

public Classify ( IMLData input ) : int
input IMLData
return int

ClearContext() public method

Clear any data from any context layers.
public ClearContext ( ) : void
return void

Clone() public method

Return a clone of this neural network. Including structure, weights and bias values. This is a deep copy.
public Clone ( ) : Object
return Object

Compute() public method

Compute the output for a given input to the neural network.
public Compute ( IMLData input ) : IMLData
input IMLData The input to the neural network.
return IMLData

Compute() public method

Compute the output for this network.
public Compute ( double input, double output ) : void
input double The input.
output double The output.
return void

DecodeFromArray() public method

public DecodeFromArray ( double encoded ) : void
encoded double
return void

DumpWeights() public method

public DumpWeights ( ) : String
return String

EnableConnection() public method

Enable, or disable, a connection.
public EnableConnection ( int fromLayer, int fromNeuron, int toNeuron, bool enable ) : void
fromLayer int The layer that contains the from neuron.
fromNeuron int The source neuron.
toNeuron int The target connection.
enable bool True to enable, false to disable.
return void

EncodeToArray() public method

public EncodeToArray ( double encoded ) : void
encoded double
return void

EncodedArrayLength() public method

public EncodedArrayLength ( ) : int
return int

Equals() public method

Compare the two neural networks. For them to be equal they must be of the same structure, and have the same matrix values.
public Equals ( BasicNetwork other ) : bool
other BasicNetwork The other neural network.
return bool

Equals() public method

Determine if this neural network is equal to another. Equal neural networks have the same weight matrix and bias values, within a specified precision.
public Equals ( BasicNetwork other, int precision ) : bool
other BasicNetwork The other neural network.
precision int The number of decimal places to compare to.
return bool

GetActivation() public method

Get the activation function for the specified layer.
public GetActivation ( int layer ) : IActivationFunction
layer int The layer.
return IActivationFunction

GetHashCode() public final method

Generate a hash code.
public final GetHashCode ( ) : int
return int

GetLayerBiasActivation() public method

Get the bias activation for the specified layer.
public GetLayerBiasActivation ( int l ) : double
l int The layer.
return double

GetLayerNeuronCount() public method

Get the neuron count.
public GetLayerNeuronCount ( int l ) : int
l int The layer.
return int

GetLayerOutput() public method

Get the layer output for the specified neuron.
public GetLayerOutput ( int layer, int neuronNumber ) : double
layer int The layer.
neuronNumber int The neuron number.
return double

GetLayerTotalNeuronCount() public method

Get the total (including bias and context) neuron cont for a layer.
public GetLayerTotalNeuronCount ( int l ) : int
l int The layer.
return int

GetWeight() public method

Get the weight between the two layers.
public GetWeight ( int fromLayer, int fromNeuron, int toNeuron ) : double
fromLayer int The from layer.
fromNeuron int The from neuron.
toNeuron int The to neuron.
return double

IsConnected() public method

Determine if the specified connection is enabled.
public IsConnected ( int layer, int fromNeuron, int toNeuron ) : bool
layer int The layer to check.
fromNeuron int The source neuron.
toNeuron int THe target neuron.
return bool

IsLayerBiased() public method

Determine if the specified layer is biased.
public IsLayerBiased ( int l ) : bool
l int The layer number.
return bool

Reset() public method

Reset the weight matrix and the bias values. This will use a Nguyen-Widrow randomizer with a range between -1 and 1. If the network does not have an input, output or hidden layers, then Nguyen-Widrow cannot be used and a simple range randomize between -1 and 1 will be used.
public Reset ( ) : void
return void

Reset() public method

Reset the weight matrix and the bias values. This will use a Nguyen-Widrow randomizer with a range between -1 and 1. If the network does not have an input, output or hidden layers, then Nguyen-Widrow cannot be used and a simple range randomize between -1 and 1 will be used. Use the specified seed.
public Reset ( int seed ) : void
seed int
return void

SetLayerBiasActivation() public method

Set the bias activation for the specified layer.
public SetLayerBiasActivation ( int l, double v ) : void
l int The layer to use.
v double
return void

SetWeight() public method

Set the weight between the two specified neurons.
public SetWeight ( int fromLayer, int fromNeuron, int toNeuron, double v ) : void
fromLayer int The from layer.
fromNeuron int The from neuron.
toNeuron int The to neuron.
v double The to value.
return void

ToString() public final method

public final ToString ( ) : String
return String

UpdateProperties() public final method

public final UpdateProperties ( ) : void
return void

ValidateNeuron() public method

Validate the the specified targetLayer and neuron are valid.
public ValidateNeuron ( int targetLayer, int neuron ) : void
targetLayer int The target layer.
neuron int The target neuron.
return void

Winner() public method

Determine the winner for the specified input. This is the number of the winning neuron.
public Winner ( IMLData input ) : int
input IMLData The input patter to present to the neural network.
return int