C# Class xpidea.neuro.net.NeuralNetwork

Base abstract class for all neural networks.
Inheritance: NeuroNode
Mostrar archivo Open project: AlexCherkasov/Neuro.NET

Protected Properties

Property Type Description
links xpidea.neuro.net.NeuroLink[]
linksCount int
nodes xpidea.neuro.net.NeuroNode[]
nodesCount int

Public Methods

Method Description
Epoch ( int epoch ) : void

Overridden.Finalizes trainig cycle of the network. Used by xpidea.neuro.net.NeuralNetwork.Train method of the network.

InputNode ( int index ) : NeuroNode

Returns N-th input node of the network.xpidea.neuro.net.NeuralNetwork.InputNodesCount

Load ( BinaryReader binaryReader ) : void

Overridden.Loads network data from a binary stream.

NeuralNetwork ( ) : System

Constructor. Creates new instance of the network.

NeuralNetwork ( string fileName ) : System

Creates the network and loads it's state from a file.

OutputNode ( int index ) : NeuroNode

Returns N-th output node of the network. xpidea.neuro.net.NeuralNetwork.OutputNodesCount

Save ( BinaryWriter binaryWriter ) : void

Overridden.Saves the network to a binary stream.

Train ( PatternsCollection patterns ) : void

Performs network training. Here you write the code to train your network.

There are several major paradigms, or approaches, to neural network learning. These include supervised, unsupervised, and reinforcement learning. How the training data is processed is a major aspect of these learning paradigms.

Supervised learning is the most common form of learning and is sometimes called programming by example. The neural network is trained by showing it examples of the problem state or attributes along with the desired output or action. The neural network makes a prediction based on the inputs and if the output differs from the desired out put, then the network is adjusted or adapted to produce the correct output. This process is repeated over and over until the agent learns to make accurate classifications or predictions. Historical data from databases, sensor logs, or trace logs is often used as the training or example data.

Unsupervised learning is used when the neural network needs to recognize similarities between inputs or to identify features in the input data. The data is presented to the network, and it adapts so that it partitions the data into groups. The clustering or segmenting process continues until the neural network places the same data into the same group on successive passes over the data. An unsupervised learning algorithm performs a type of feature detection where important common attributes in the data are extracted. The Kohonen map will be a good example of the network using unsupervised learning.

Reinforcement learning is a type of supervised learning used when explicit input/ output pairs of training data are not available. It can be used in cases where there is a sequence of inputs arid the desired output is only known after the specific sequence occurs. This process of identifying the relationship between a series of input values and a later output value is called temporal credit assignment. Because we provide less specific error information, reinforcement learning usually takes longer than supervised learning and is less efficient. However, in many situations, having exact prior information about the desired outcome is not possible. In many ways, reinforcement learning is the most realistic form of learning.

Protected Methods

Method Description
CreateNetwork ( ) : void

Performs network construction based on specific topology. Connects all nodes in the network using the links.

GetInputNode ( int index ) : NeuroNode

Returns N-th input node in the network.

GetInputNodesCount ( ) : int

Returns number of input nodes in the network.

GetNetworkType ( ) : NeuralNetworkType

Neural network type.

GetOutPutNodesCount ( ) : int

Returns number of output nodes in the network.

GetOutputNode ( int index ) : NeuroNode

Returns N-th output node in the network.

LoadInputs ( ) : void

Loads data into input nodes of the network.

Private Methods

Method Description
CheckNetworkType ( BinaryReader binaryReader ) : void
SaveNetworkType ( BinaryWriter binaryWriter ) : void

Method Details

CreateNetwork() protected method

Performs network construction based on specific topology. Connects all nodes in the network using the links.
protected CreateNetwork ( ) : void
return void

Epoch() public method

Overridden.Finalizes trainig cycle of the network. Used by xpidea.neuro.net.NeuralNetwork.Train method of the network.
public Epoch ( int epoch ) : void
epoch int Number of patterns was exposed to the network.
return void

GetInputNode() protected abstract method

Returns N-th input node in the network.
protected abstract GetInputNode ( int index ) : NeuroNode
index int Node index.
return NeuroNode

GetInputNodesCount() protected abstract method

Returns number of input nodes in the network.
protected abstract GetInputNodesCount ( ) : int
return int

GetNetworkType() protected abstract method

Neural network type.
protected abstract GetNetworkType ( ) : NeuralNetworkType
return NeuralNetworkType

GetOutPutNodesCount() protected abstract method

Returns number of output nodes in the network.
protected abstract GetOutPutNodesCount ( ) : int
return int

GetOutputNode() protected abstract method

Returns N-th output node in the network.
protected abstract GetOutputNode ( int index ) : NeuroNode
index int Node index.
return NeuroNode

InputNode() public method

Returns N-th input node of the network.xpidea.neuro.net.NeuralNetwork.InputNodesCount
public InputNode ( int index ) : NeuroNode
index int Node index.
return NeuroNode

Load() public method

Overridden.Loads network data from a binary stream.
public Load ( BinaryReader binaryReader ) : void
binaryReader System.IO.BinaryReader Binary stream reader.
return void

LoadInputs() protected method

Loads data into input nodes of the network.
protected LoadInputs ( ) : void
return void

NeuralNetwork() public method

Constructor. Creates new instance of the network.
public NeuralNetwork ( ) : System
return System

NeuralNetwork() public method

Creates the network and loads it's state from a file.
public NeuralNetwork ( string fileName ) : System
fileName string A file name.
return System

OutputNode() public method

Returns N-th output node of the network. xpidea.neuro.net.NeuralNetwork.OutputNodesCount
public OutputNode ( int index ) : NeuroNode
index int Node index
return NeuroNode

Save() public method

Overridden.Saves the network to a binary stream.
public Save ( BinaryWriter binaryWriter ) : void
binaryWriter System.IO.BinaryWriter Binary stream writer.
return void

Train() public method

Performs network training. Here you write the code to train your network.

There are several major paradigms, or approaches, to neural network learning. These include supervised, unsupervised, and reinforcement learning. How the training data is processed is a major aspect of these learning paradigms.

Supervised learning is the most common form of learning and is sometimes called programming by example. The neural network is trained by showing it examples of the problem state or attributes along with the desired output or action. The neural network makes a prediction based on the inputs and if the output differs from the desired out put, then the network is adjusted or adapted to produce the correct output. This process is repeated over and over until the agent learns to make accurate classifications or predictions. Historical data from databases, sensor logs, or trace logs is often used as the training or example data.

Unsupervised learning is used when the neural network needs to recognize similarities between inputs or to identify features in the input data. The data is presented to the network, and it adapts so that it partitions the data into groups. The clustering or segmenting process continues until the neural network places the same data into the same group on successive passes over the data. An unsupervised learning algorithm performs a type of feature detection where important common attributes in the data are extracted. The Kohonen map will be a good example of the network using unsupervised learning.

Reinforcement learning is a type of supervised learning used when explicit input/ output pairs of training data are not available. It can be used in cases where there is a sequence of inputs arid the desired output is only known after the specific sequence occurs. This process of identifying the relationship between a series of input values and a later output value is called temporal credit assignment. Because we provide less specific error information, reinforcement learning usually takes longer than supervised learning and is less efficient. However, in many situations, having exact prior information about the desired outcome is not possible. In many ways, reinforcement learning is the most realistic form of learning.

public Train ( PatternsCollection patterns ) : void
patterns xpidea.neuro.net.patterns.PatternsCollection Set of the patterns that will be exposed to a network during the training.
return void

Property Details

links protected_oe property

Links in the network.
protected NeuroLink[],xpidea.neuro.net links
return xpidea.neuro.net.NeuroLink[]

linksCount protected_oe property

Number of links in the network.
protected int linksCount
return int

nodes protected_oe property

Nodes in the netowrk.
protected NeuroNode[],xpidea.neuro.net nodes
return xpidea.neuro.net.NeuroNode[]

nodesCount protected_oe property

Number of nodes in the network.
protected int nodesCount
return int