C# Class SharpNeat.Decoders.HyperNeat.Substrate

HyperNEAT substrate. Encapsulates substrate nodes in sets and connections. Connections can be defined explicitly or by providing mapping functions that map (connect) between nodes in sets. Node sets can be arranged as layers, however there is no limitation on node positions within the substrate - nodes in a set can be distributed throughout the substrate with no restrictions based on e.g. where nodes in other sets are located.
Show file Open project: colgreen/sharpneat Class Usage Examples

Public Methods

Method Description
CreateNetworkDefinition ( IBlackBox blackbox, bool lengthCppnInput ) : INetworkDefinition

Create a network definition by querying the provided IBlackBox (typically a CPPN) with the substrate connection endpoints.

Substrate ( List nodeSetList, IActivationFunctionLibrary activationFnLibrary, int activationFnId, double weightThreshold, double maxWeight, List nodeSetMappingList ) : System

Constructs with the provided substrate nodesets and mappings that describe how the nodesets are to be connected up.

Substrate ( List nodeSetList, IActivationFunctionLibrary activationFnLibrary, int activationFnId, double weightThreshold, double maxWeight, List connectionList ) : System

Construct a substrate with the provided node sets and a predetermined set of connections.

Private Methods

Method Description
CalcBiasConnectionCountHint ( List nodeSetList ) : int

Calculate the maximum number of possible bias connections. Input nodes don't have a bias therefore this value is the number of hidden and output nodes.

CalculateConnectionLength ( double a ) : double

Calculates the euclidean distance between a point and the origin.

CalculateConnectionLength ( double a, double b ) : double

Calculates the euclidean distance between two points in N dimensional space.

CreateNetworkNodeList ( ) : NodeList

Pre-build the network node list used for constructing new networks 'grown' on the substrate. This can be pre-built because the set of nodes remains the same for each network instantiation, only the connections differ between instantiations.

GetConnectionSequence ( ) : IEnumerable
VaildateSubstrateNodes ( List nodeSetList ) : void

Method Details

CreateNetworkDefinition() public method

Create a network definition by querying the provided IBlackBox (typically a CPPN) with the substrate connection endpoints.
public CreateNetworkDefinition ( IBlackBox blackbox, bool lengthCppnInput ) : INetworkDefinition
blackbox IBlackBox The HyperNEAT CPPN that defines the strength of connections between nodes on the substrate.
lengthCppnInput bool Optionally we provide a connection length input to the CPPN.
return INetworkDefinition

Substrate() public method

Constructs with the provided substrate nodesets and mappings that describe how the nodesets are to be connected up.
public Substrate ( List nodeSetList, IActivationFunctionLibrary activationFnLibrary, int activationFnId, double weightThreshold, double maxWeight, List nodeSetMappingList ) : System
nodeSetList List Substrate nodes, represented as distinct sets of nodes. By convention the first and second /// sets in the list represent the input and output noes respectively. All other sets represent hidden nodes.
activationFnLibrary IActivationFunctionLibrary The activation function library allocated to the networks that are 'grown' from the substrate.
activationFnId int The ID of an activation function in activationFnLibrary. This is the activation function /// ID assigned to all nodes in networks that are 'grown' from the substrate.
weightThreshold double The weight threshold below which substrate connections are not created in grown networks.
maxWeight double Defines the weight range of grown connections (+-maxWeight).
nodeSetMappingList List A list of mappings between node sets that defines what connections to create between substrate nodes.
return System

Substrate() public method

Construct a substrate with the provided node sets and a predetermined set of connections.
public Substrate ( List nodeSetList, IActivationFunctionLibrary activationFnLibrary, int activationFnId, double weightThreshold, double maxWeight, List connectionList ) : System
nodeSetList List Substrate nodes, represented as distinct sets of nodes. By convention the first and second /// sets in the list represent the input and output noes respectively. All other sets represent hidden nodes.
activationFnLibrary IActivationFunctionLibrary The activation function library allocated to the networks that are 'grown' from the substrate.
activationFnId int The ID of an activation function in activationFnLibrary. This is the activation function /// ID assigned to all nodes in networks that are 'grown' from the substrate.
weightThreshold double The weight threshold below which substrate connections are not created in grown networks.
maxWeight double Defines the weight range of grown connections (+-maxWeight).
connectionList List A predetermined list of substrate connections.
return System