Package mgui.neuro.networks
Class AbstractNeuralNet
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.models.InterfaceAbstractModel
mgui.models.networks.AbstractNetworkModel
mgui.models.networks.AbstractNetwork
mgui.neuro.networks.AbstractNeuralNet
- All Implemented Interfaces:
java.lang.Cloneable
,AttributeObject
,GraphableObject
,InterfaceObject
,NamedObject
,InterfaceNeuroComponentListener
,TreeObject
,CleanableObject
,DynamicModel
,InterfaceNetworkComponentListener
- Direct Known Subclasses:
KohonenNet
,PerceptronNet
public abstract class AbstractNeuralNet extends AbstractNetwork implements InterfaceNeuroComponentListener
Abstract class for all neural net classes to inherit.
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<AbstractSensoryNeuron>
inputs
static int
MODE_TEST
static int
MODE_TRAIN
java.util.ArrayList<ConnectableNeuron>
units
Fields inherited from class mgui.models.networks.AbstractNetwork
idFactory, listeners
Fields inherited from class mgui.models.networks.AbstractNetworkModel
attributes, environment
Fields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes
-
Constructor Summary
Constructors Constructor Description AbstractNeuralNet()
-
Method Summary
Modifier and Type Method Description boolean
addUnit(ConnectableNeuron unit)
boolean
addUnit(ConnectableNeuron unit, boolean fire)
void
componentUpdated(NetworkComponentEvent e)
protected void
fireUnitAdded(ConnectableNeuron n)
java.util.ArrayList<DynamicModelComponent>
getComponents()
java.util.ArrayList<InterfaceDataSource>
getDataSources()
abstract double
getEnergy()
Returns the energy calculation for this neural network.NeuralNetGraph
getGraph()
Constructs and returns a directed graph from the model components and their connections.java.lang.String
getName()
Gets the name for this object.int
getUnitCount()
protected void
init()
boolean
removeUnit(ConnectableNeuron unit)
void
setName(java.lang.String name)
Sets the name for this object.void
setTreeNode(InterfaceTreeNode treeNode)
Sets the children for this node'sInterfaceTreeNode
.Methods inherited from class mgui.models.networks.AbstractNetwork
addListener, fireListeners, fireListeners, removeListener, reset
Methods inherited from class mgui.models.networks.AbstractNetworkModel
addListener, addSensor, clone, fireComponentAdded, fireComponentRemoved, getAttribute, getAttributes, getAttributeValue, getEnvironment, getSensors, removeListener, removeSensor, setAttribute, setAttributes, setEnvironment
Methods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getTreeLabel, isDestroyed, issueTreeNode, updateTreeNodes
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface mgui.interfaces.util.CleanableObject
clean
Methods inherited from interface mgui.interfaces.InterfaceObject
destroy, isDestroyed
Methods inherited from interface mgui.interfaces.trees.TreeObject
getTreeLabel, issueTreeNode
-
Field Details
-
MODE_TRAIN
public static final int MODE_TRAIN- See Also:
- Constant Field Values
-
MODE_TEST
public static final int MODE_TEST- See Also:
- Constant Field Values
-
units
-
inputs
-
-
Constructor Details
-
AbstractNeuralNet
public AbstractNeuralNet()
-
-
Method Details
-
getGraph
Constructs and returns a directed graph from the model components and their connections. DirectedGraph is a class provided in the JUNG API.- Specified by:
getGraph
in interfaceGraphableObject
- Specified by:
getGraph
in classAbstractNetwork
- Returns:
-
init
protected void init()- Overrides:
init
in classAbstractNetwork
-
getDataSources
-
getUnitCount
public int getUnitCount() -
componentUpdated
- Specified by:
componentUpdated
in interfaceInterfaceNetworkComponentListener
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
- Overrides:
setTreeNode
in classAbstractInterfaceObject
-
addUnit
- Throws:
NeuroNetException
-
addUnit
- Throws:
NeuroNetException
-
fireUnitAdded
-
removeUnit
-
getName
public java.lang.String getName()Description copied from interface:NamedObject
Gets the name for this object.- Specified by:
getName
in interfaceNamedObject
- Overrides:
getName
in classAbstractInterfaceObject
- Returns:
-
getEnergy
public abstract double getEnergy()Returns the energy calculation for this neural network. I.e., the Lyapunov function. All instances of AbstractNeuralNet must implement this.- Returns:
-
getComponents
- Specified by:
getComponents
in interfaceDynamicModel
- Specified by:
getComponents
in classAbstractNetwork
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObject
Sets the name for this object.- Specified by:
setName
in interfaceNamedObject
- Overrides:
setName
in classAbstractInterfaceObject
-