org.encog.neural.networks.structure
Class NeuralStructure
- java.lang.Object
-
- org.encog.neural.networks.structure.NeuralStructure
-
- All Implemented Interfaces:
- java.io.Serializable
public class NeuralStructure extends java.lang.Object implements java.io.SerializableHolds "cached" information about the structure of the neural network. This is a very good performance boost since the neural network does not need to traverse itself each time a complete collection of layers or synapses is needed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NeuralStructure(BasicNetwork network)Construct a structure object for the specified network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcalculateSize()Calculate the size that an array should be to hold all of the weights and bias values.voidenforceLimit()Enforce that all connections are above the connection limit.voidfinalizeLimit()Parse/finalize the limit value for connections.voidfinalizeStructure()voidfinalizeStructure(boolean dropout)Build the synapse and layer structure.doublegetConnectionLimit()FlatNetworkgetFlat()java.util.List<Layer>getLayers()BasicNetworkgetNetwork()booleanisConnectionLimited()voidrequireFlat()Throw an error if there is no flat network.voidsetFlat(FlatNetwork flat)Set the flat network.voidupdateProperties()Update any properties from the property map.
-
-
-
Constructor Detail
-
NeuralStructure
public NeuralStructure(BasicNetwork network)
Construct a structure object for the specified network.- Parameters:
network- The network to construct a structure for.
-
-
Method Detail
-
calculateSize
public final int calculateSize()
Calculate the size that an array should be to hold all of the weights and bias values.- Returns:
- The size of the calculated array.
-
enforceLimit
public final void enforceLimit()
Enforce that all connections are above the connection limit. Any connections below this limit will be severed.
-
finalizeLimit
public void finalizeLimit()
Parse/finalize the limit value for connections.
-
finalizeStructure
public final void finalizeStructure(boolean dropout)
Build the synapse and layer structure. This method should be called after you are done adding layers to a network, or change the network's logic property.- Parameters:
dropout- Is dropout used?
-
finalizeStructure
public final void finalizeStructure()
-
getConnectionLimit
public final double getConnectionLimit()
- Returns:
- The connection limit.
-
getFlat
public final FlatNetwork getFlat()
- Returns:
- The flat network.
-
getLayers
public final java.util.List<Layer> getLayers()
- Returns:
- The layers in this neural network.
-
getNetwork
public final BasicNetwork getNetwork()
- Returns:
- The network this structure belongs to.
-
isConnectionLimited
public final boolean isConnectionLimited()
- Returns:
- True if this is not a fully connected feedforward network.
-
requireFlat
public final void requireFlat()
Throw an error if there is no flat network.
-
setFlat
public final void setFlat(FlatNetwork flat)
Set the flat network.- Parameters:
flat- The flat network.
-
updateProperties
public final void updateProperties()
Update any properties from the property map.
-
-
DMelt 3.0 © DataMelt by jWork.ORG