|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.adaptation.neural.RepastNeuralWrapper
public class RepastNeuralWrapper
A wrapper around a NeuralNet. This class adds
training and retrieval methods that wait until the training/retrieval is
finished before returning.
Note: if you want serialize the network that this wrapper wraps, use the
saveNetToFile and NeuralUtils.loadNetFromFile methods, otherwise you will
have multiple wrappers attached to the serialized networks (through the
listeners).
| Field Summary | |
|---|---|
protected int |
epochsPerIteration
The number of times to apply the patterns to the network during the training |
protected org.joone.net.NeuralNet |
net
The net being wrapped |
protected boolean |
netStopped
Whether or not the network is running (training/retrieving). |
| Constructor Summary | |
|---|---|
RepastNeuralWrapper()
The default constructor for a network wrapper. |
|
RepastNeuralWrapper(org.joone.net.NeuralNet net)
This creates a basic network wrapper, however this cannot be used until Layers, Synapses,
and so forth have been specified. |
|
| Method Summary | |
|---|---|
void |
cicleTerminated(org.joone.engine.NeuralNetEvent e)
|
void |
errorChanged(org.joone.engine.NeuralNetEvent e)
|
int |
getEpochsPerIteration()
|
org.joone.net.NeuralNet |
getNet()
|
void |
netStarted(org.joone.engine.NeuralNetEvent e)
|
void |
netStopped(org.joone.engine.NeuralNetEvent e)
|
void |
netStoppedError(org.joone.engine.NeuralNetEvent e,
java.lang.String error)
|
org.joone.engine.Pattern |
retrieve(org.joone.engine.InputPatternListener in)
This method will retrieve a result Pattern from a network based on the in parameter. |
void |
saveNetToFile(java.lang.String fileName)
Saves the neural network this is wrapping to the specified file. |
void |
setEpochsPerIteration(int epochsPerIteration)
|
void |
setNet(org.joone.net.NeuralNet net)
|
void |
train(org.joone.engine.InputPatternListener in)
Trains a network. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.joone.net.NeuralNet net
protected int epochsPerIteration
protected transient boolean netStopped
| Constructor Detail |
|---|
public RepastNeuralWrapper()
Layers,
Synapses, and so forth have been specified.
public RepastNeuralWrapper(org.joone.net.NeuralNet net)
Layers, Synapses,
and so forth have been specified.
| Method Detail |
|---|
public org.joone.engine.Pattern retrieve(org.joone.engine.InputPatternListener in)
throws NeuralException
in - The input to the network (best as a DirectSynapse)
NeuralException - when there is an error querying the network
public void train(org.joone.engine.InputPatternListener in)
throws NeuralException
Monitor.
in - the input for the network.
NeuralException - when there is an error training the networkNeuralNet.check(),
retrieve(InputPatternListener)public int getEpochsPerIteration()
public void setEpochsPerIteration(int epochsPerIteration)
epochsPerIteration - the number of times to feed a pattern
through the networkpublic void netStarted(org.joone.engine.NeuralNetEvent e)
netStarted in interface org.joone.engine.NeuralNetListenerpublic void netStopped(org.joone.engine.NeuralNetEvent e)
netStopped in interface org.joone.engine.NeuralNetListener
public void netStoppedError(org.joone.engine.NeuralNetEvent e,
java.lang.String error)
netStoppedError in interface org.joone.engine.NeuralNetListenerpublic void cicleTerminated(org.joone.engine.NeuralNetEvent e)
cicleTerminated in interface org.joone.engine.NeuralNetListenerpublic void errorChanged(org.joone.engine.NeuralNetEvent e)
errorChanged in interface org.joone.engine.NeuralNetListenerpublic org.joone.net.NeuralNet getNet()
public void setNet(org.joone.net.NeuralNet net)
net - the new net to wrap
public void saveNetToFile(java.lang.String fileName)
throws NeuralException
#loadNetFromFile(String).
fileName - the name of the file to save the network to
NeuralException - when there is an error saving the network#loadNetFromFile(String),
NeuralUtils.saveNetToFile(NeuralNet, String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||