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>inputsstatic intMODE_TESTstatic intMODE_TRAINjava.util.ArrayList<ConnectableNeuron>unitsFields inherited from class mgui.models.networks.AbstractNetwork
idFactory, listenersFields inherited from class mgui.models.networks.AbstractNetworkModel
attributes, environmentFields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes -
Constructor Summary
Constructors Constructor Description AbstractNeuralNet() -
Method Summary
Modifier and Type Method Description booleanaddUnit(ConnectableNeuron unit)booleanaddUnit(ConnectableNeuron unit, boolean fire)voidcomponentUpdated(NetworkComponentEvent e)protected voidfireUnitAdded(ConnectableNeuron n)java.util.ArrayList<DynamicModelComponent>getComponents()java.util.ArrayList<InterfaceDataSource>getDataSources()abstract doublegetEnergy()Returns the energy calculation for this neural network.NeuralNetGraphgetGraph()Constructs and returns a directed graph from the model components and their connections.java.lang.StringgetName()Gets the name for this object.intgetUnitCount()protected voidinit()booleanremoveUnit(ConnectableNeuron unit)voidsetName(java.lang.String name)Sets the name for this object.voidsetTreeNode(InterfaceTreeNode treeNode)Sets the children for this node'sInterfaceTreeNode.Methods inherited from class mgui.models.networks.AbstractNetwork
addListener, fireListeners, fireListeners, removeListener, resetMethods inherited from class mgui.models.networks.AbstractNetworkModel
addListener, addSensor, clone, fireComponentAdded, fireComponentRemoved, getAttribute, getAttributes, getAttributeValue, getEnvironment, getSensors, removeListener, removeSensor, setAttribute, setAttributes, setEnvironmentMethods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, getTreeLabel, isDestroyed, issueTreeNode, updateTreeNodesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
cleanMethods inherited from interface mgui.interfaces.InterfaceObject
destroy, isDestroyedMethods 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:
getGraphin interfaceGraphableObject- Specified by:
getGraphin classAbstractNetwork- Returns:
-
init
protected void init()- Overrides:
initin classAbstractNetwork
-
getDataSources
-
getUnitCount
public int getUnitCount() -
componentUpdated
- Specified by:
componentUpdatedin interfaceInterfaceNetworkComponentListener
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject- Overrides:
setTreeNodein classAbstractInterfaceObject
-
addUnit
- Throws:
NeuroNetException
-
addUnit
- Throws:
NeuroNetException
-
fireUnitAdded
-
removeUnit
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Overrides:
getNamein 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:
getComponentsin interfaceDynamicModel- Specified by:
getComponentsin classAbstractNetwork
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject- Overrides:
setNamein classAbstractInterfaceObject
-