public class Hopfield extends Subnetwork implements Trainable
Modifier and Type | Class and Description |
---|---|
static class |
Hopfield.HopfieldUpdate
Main forms of Hopfield update rule.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUM_UNITS
Default number of neurons.
|
static Hopfield.HopfieldUpdate |
DEFAULT_UPDATE
Default update mechanism.
|
Constructor and Description |
---|
Hopfield(Network root,
int numNeurons)
Creates a new Hopfield network.
|
Modifier and Type | Method and Description |
---|---|
static double |
bipolar(double in)
Convenience method to convert binary values (1,0) to bipolar
values(1,-1).
|
java.util.List<Neuron> |
getInputNeurons()
Returns the list of input neurons.
|
Group |
getNetwork()
Returns a reference to the subnetwork or synapse group being trained.
|
java.util.HashSet<Neuron> |
getNeuronSet() |
int |
getNumUnits() |
java.util.List<Neuron> |
getOutputNeurons()
Returns the list of output neurons.
|
TrainingSet |
getTrainingSet()
Returns the the training set, which contains input and target data.
|
Hopfield.HopfieldUpdate |
getUpdateFunc() |
java.lang.String |
getUpdateMethodDesecription()
Returns a description of this group's update method, which is displayed
in the update manager panel.
|
void |
initNetwork()
Initialize the network.
|
boolean |
isByPriority() |
void |
randomize()
Randomize weights symmetrically.
|
void |
randomizeSequence()
Randomizes the update sequence by shuffling the neuron list associated
with this Hopfield network.
|
void |
setByPriority(boolean byPriority) |
void |
setNeuronSet(java.util.HashSet<Neuron> neuronSet) |
void |
setUpdateFunc(Hopfield.HopfieldUpdate updateFunc) |
void |
trainOnCurrentPattern()
Apply the basic Hopfield rule to the current pattern.
|
void |
update()
Update this group.
|
addAndLabelSynapseGroup, addNeuronGroup, addRowToTrainingSet, addSynapseGroup, clearActivations, connectNeuronGroups, connectNeuronGroups, connectNeuronGroups, delete, displayNeuronGroups, getEnabled, getFlatNeuronList, getFlatSynapseList, getIndexOfNeuronGroup, getLongDescription, getModifiableNeuronList, getNeuronGroup, getNeuronGroup, getNeuronGroupByLabel, getNeuronGroupCount, getNeuronGroupList, getNeuronGroupsAsList, getSynapseGroup, getSynapseGroup, getSynapseGroupByLabel, getSynapseGroupCount, getSynapseGroupList, isEmpty, recursivelySetIds, removeNeuronGroup, removeSynapseGroup, setDisplayNeuronGroups, setEnabled, size, toString
getId, getLabel, getParentGroup, getParentNetwork, getStateInfo, hasParentGroup, isMarkedForDeletion, isTopLevelGroup, setId, setLabel, setMarkedForDeletion, setParentGroup, setStateInfo
public static final Hopfield.HopfieldUpdate DEFAULT_UPDATE
public static final int DEFAULT_NUM_UNITS
public Hopfield(Network root, int numNeurons)
numNeurons
- Number of neurons in new networkroot
- reference to Network.public void randomizeSequence()
public void randomize()
public void update()
Group
update
in class Subnetwork
public int getNumUnits()
public java.lang.String getUpdateMethodDesecription()
Group
getUpdateMethodDesecription
in class Subnetwork
public java.util.List<Neuron> getInputNeurons()
Trainable
getInputNeurons
in interface Trainable
public java.util.List<Neuron> getOutputNeurons()
Trainable
getOutputNeurons
in interface Trainable
public TrainingSet getTrainingSet()
Trainable
getTrainingSet
in interface Trainable
public void initNetwork()
Trainable
initNetwork
in interface Trainable
public void trainOnCurrentPattern()
public static double bipolar(double in)
in
- number to convertpublic Hopfield.HopfieldUpdate getUpdateFunc()
public void setUpdateFunc(Hopfield.HopfieldUpdate updateFunc)
updateFunc
- the updateFunc to setpublic java.util.HashSet<Neuron> getNeuronSet()
public void setNeuronSet(java.util.HashSet<Neuron> neuronSet)
neuronSet
- the neuronSet to setpublic boolean isByPriority()
public void setByPriority(boolean byPriority)
byPriority
- the byPriority to setpublic Group getNetwork()
Trainable
getNetwork
in interface Trainable