org.joone.net
Class NestedNeuralLayer
- java.lang.Object
-
- org.joone.engine.Layer
-
- org.joone.net.NestedNeuralLayer
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Runnable, Learnable, LearnableLayer, NeuralLayer, Inspectable
public class NestedNeuralLayer extends Layer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NestedNeuralLayer()NestedNeuralLayer(java.lang.String ElemName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddInputSynapse(InputPatternListener p1)Adds a new input synapse to the layervoidaddNoise(double p1)Adds a noise componentto the biases of the layer and to all the input connected synapses.booleanaddOutputSynapse(OutputPatternListener p1)Adds a new output synapse to the layerjava.util.TreeSetcheck()Get check messages from listeners.NeuralLayercopyInto(NeuralLayer p1)Copies one layer into another, to obtain a type-transformation from one kind of Layer to another.voidfwdRun(Pattern pattIn)Implementation code for the single-thread version of Joone /********************************************************* /** This method serves to a single forward step when the Layer is called from an external threadjava.util.VectorgetAllInputs()Returns the vector of the input listenersjava.util.VectorgetAllOutputs()Returns the vector of the output listenersMatrixgetBias()Return the bias matrixjava.io.FilegetEmbeddedNet()java.lang.StringgetLayerName()Returns the name of the layerMonitorgetMonitor()Returns the monitor objectNeuralNetgetNestedNeuralNet()Getter for property NestedNeuralNet.java.lang.StringgetNeuralNet()intgetRows()Returns the dimension (# of neurons) of the LayerbooleanisLearning()Getter for property learning.booleanisRunning()Determine whether the execution thread is runningvoidrandomize(double amplitude)Initialize the weights of the biases and of all the connected synapsesvoidremoveAllInputs()Remove all the input listeners of the layervoidremoveAllOutputs()Remove all the output listeners of the layervoidremoveInputSynapse(InputPatternListener p1)Remove an input ListenervoidremoveOutputSynapse(OutputPatternListener p1)Remove an output listener from the layervoidrevRun(Pattern pattIn)This method serves to a single backward step when the Layer is called from an external threadvoidsetAllInputs(java.util.Vector p1)Sets the Vector that contains all the input listeners.voidsetAllOutputs(java.util.Vector p1)Sets the Vector that contains all the output listeners.voidsetBias(Matrix p1)Sets the matrix of biasesvoidsetEmbeddedNet(java.io.File embeddedNet)voidsetLayerName(java.lang.String p1)Sets the name of the layervoidsetLearning(boolean learning)Setter for property learning.voidsetMonitor(Monitor p1)Sets the monitor objectvoidsetNestedNeuralNet(NeuralNet newNeuralNet)Setter for property NestedNeuralNet.voidsetNeuralNet(java.lang.String NNFile)voidsetRows(int p1)Sets the dimension (# of neurons) of the Layervoidstart()Starts the Layervoidstop()Stops the Layer-
Methods inherited from class org.joone.engine.Layer
finalize, getDimension, getLastOutputs, getLearner, hasStepCounter, init, initLearner, InspectableTitle, Inspections, isInputLayer, isOutputLayer, join, run, setInputSynapses, setOutputSynapses, toString
-
-
-
-
Constructor Detail
-
NestedNeuralLayer
public NestedNeuralLayer()
-
NestedNeuralLayer
public NestedNeuralLayer(java.lang.String ElemName)
-
-
Method Detail
-
getNeuralNet
public java.lang.String getNeuralNet()
-
setNeuralNet
public void setNeuralNet(java.lang.String NNFile)
-
start
public void start()
Description copied from class:LayerStarts the Layer- Specified by:
startin interfaceNeuralLayer- Overrides:
startin classLayer
-
stop
public void stop()
Description copied from class:LayerStops the Layer
-
getRows
public int getRows()
Description copied from class:LayerReturns the dimension (# of neurons) of the Layer- Specified by:
getRowsin interfaceNeuralLayer- Overrides:
getRowsin classLayer- Returns:
- the number of neurons in the layer
-
setRows
public void setRows(int p1)
Description copied from class:LayerSets the dimension (# of neurons) of the Layer- Specified by:
setRowsin interfaceNeuralLayer- Overrides:
setRowsin classLayer- Parameters:
p1- The number of the neurons contained in the Layer
-
addNoise
public void addNoise(double p1)
Description copied from class:LayerAdds a noise componentto the biases of the layer and to all the input connected synapses.- Specified by:
addNoisein interfaceNeuralLayer- Overrides:
addNoisein classLayer- Parameters:
p1- the noise's amplitude in terms of distance from zero; e.g. a value equal 0.3 means a noise range from -0.3 to 0.3
-
randomize
public void randomize(double amplitude)
Description copied from class:LayerInitialize the weights of the biases and of all the connected synapses
-
getBias
public Matrix getBias()
Description copied from class:LayerReturn the bias matrix- Specified by:
getBiasin interfaceNeuralLayer- Overrides:
getBiasin classLayer- Returns:
- the layer biases
-
getAllOutputs
public java.util.Vector getAllOutputs()
Description copied from class:LayerReturns the vector of the output listeners- Specified by:
getAllOutputsin interfaceNeuralLayer- Overrides:
getAllOutputsin classLayer- Returns:
- the connected output pattern listeners
-
getLayerName
public java.lang.String getLayerName()
Description copied from class:LayerReturns the name of the layer- Specified by:
getLayerNamein interfaceNeuralLayer- Overrides:
getLayerNamein classLayer- Returns:
- the name of the layer
-
removeOutputSynapse
public void removeOutputSynapse(OutputPatternListener p1)
Description copied from class:LayerRemove an output listener from the layer- Specified by:
removeOutputSynapsein interfaceNeuralLayer- Overrides:
removeOutputSynapsein classLayer- Parameters:
p1- the output listener to remove
-
setAllInputs
public void setAllInputs(java.util.Vector p1)
Description copied from class:LayerSets the Vector that contains all the input listeners. Can be useful to set the input synapses taken from another Layer- Specified by:
setAllInputsin interfaceNeuralLayer- Overrides:
setAllInputsin classLayer- Parameters:
p1- The vector containing the list of input synapses
-
removeAllOutputs
public void removeAllOutputs()
Description copied from class:LayerRemove all the output listeners of the layer- Specified by:
removeAllOutputsin interfaceNeuralLayer- Overrides:
removeAllOutputsin classLayer
-
getAllInputs
public java.util.Vector getAllInputs()
Description copied from class:LayerReturns the vector of the input listeners- Specified by:
getAllInputsin interfaceNeuralLayer- Overrides:
getAllInputsin classLayer- Returns:
- the connected input pattern listeners
-
addOutputSynapse
public boolean addOutputSynapse(OutputPatternListener p1)
Description copied from class:LayerAdds a new output synapse to the layer- Specified by:
addOutputSynapsein interfaceNeuralLayer- Overrides:
addOutputSynapsein classLayer- Parameters:
p1- The new output synapse- Returns:
- whether the listener was added
-
setBias
public void setBias(Matrix p1)
Description copied from class:LayerSets the matrix of biases- Specified by:
setBiasin interfaceNeuralLayer- Overrides:
setBiasin classLayer- Parameters:
p1- The Matrix object containing the biases
-
removeInputSynapse
public void removeInputSynapse(InputPatternListener p1)
Description copied from class:LayerRemove an input Listener- Specified by:
removeInputSynapsein interfaceNeuralLayer- Overrides:
removeInputSynapsein classLayer- Parameters:
p1- the input listener to remove
-
setLayerName
public void setLayerName(java.lang.String p1)
Description copied from class:LayerSets the name of the layer- Specified by:
setLayerNamein interfaceNeuralLayer- Overrides:
setLayerNamein classLayer- Parameters:
p1- The name
-
addInputSynapse
public boolean addInputSynapse(InputPatternListener p1)
Description copied from class:LayerAdds a new input synapse to the layer- Specified by:
addInputSynapsein interfaceNeuralLayer- Overrides:
addInputSynapsein classLayer- Parameters:
p1- The new input synapse to add- Returns:
- whether the listener was added
-
setAllOutputs
public void setAllOutputs(java.util.Vector p1)
Description copied from class:LayerSets the Vector that contains all the output listeners. Can be useful to set the output synapses taken from another Layer- Specified by:
setAllOutputsin interfaceNeuralLayer- Overrides:
setAllOutputsin classLayer- Parameters:
p1- The vector containing the list of output synapses
-
setMonitor
public void setMonitor(Monitor p1)
Description copied from class:LayerSets the monitor object- Specified by:
setMonitorin interfaceNeuralLayer- Overrides:
setMonitorin classLayer- Parameters:
p1- The Monitor
-
getMonitor
public Monitor getMonitor()
Description copied from class:LayerReturns the monitor object- Specified by:
getMonitorin interfaceLearnable- Specified by:
getMonitorin interfaceNeuralLayer- Overrides:
getMonitorin classLayer- Returns:
- the layer's Monitor object
-
removeAllInputs
public void removeAllInputs()
Description copied from class:LayerRemove all the input listeners of the layer- Specified by:
removeAllInputsin interfaceNeuralLayer- Overrides:
removeAllInputsin classLayer
-
copyInto
public NeuralLayer copyInto(NeuralLayer p1)
Description copied from class:LayerCopies one layer into another, to obtain a type-transformation from one kind of Layer to another. The old Layer is disconnected from the net, and the new Layer takes its place.- Specified by:
copyIntoin interfaceNeuralLayer- Overrides:
copyIntoin classLayer- Parameters:
p1- the new layer with which to replace this one- Returns:
- The new layer
-
isRunning
public boolean isRunning()
Description copied from class:LayerDetermine whether the execution thread is running- Specified by:
isRunningin interfaceNeuralLayer- Overrides:
isRunningin classLayer- Returns:
- whether it is running
-
getNestedNeuralNet
public NeuralNet getNestedNeuralNet()
Getter for property NestedNeuralNet.- Returns:
- Value of property NestedNeuralNet.
-
setNestedNeuralNet
public void setNestedNeuralNet(NeuralNet newNeuralNet)
Setter for property NestedNeuralNet.- Parameters:
NestedNeuralNet- New value of property NestedNeuralNet.
-
isLearning
public boolean isLearning()
Getter for property learning.- Returns:
- Value of property learning.
-
setLearning
public void setLearning(boolean learning)
Setter for property learning.- Parameters:
learning- New value of property learning.
-
check
public java.util.TreeSet check()
Description copied from class:LayerGet check messages from listeners. Subclasses should call this method from thier own check method.- Specified by:
checkin interfaceNeuralLayer- Overrides:
checkin classLayer- Returns:
- validation errors.
- See Also:
NeuralLayer
-
getEmbeddedNet
public java.io.File getEmbeddedNet()
-
setEmbeddedNet
public void setEmbeddedNet(java.io.File embeddedNet)
-
fwdRun
public void fwdRun(Pattern pattIn)
Description copied from class:LayerImplementation code for the single-thread version of Joone /********************************************************* /** This method serves to a single forward step when the Layer is called from an external thread
-
-
DataMelt 3.0 © DataMelt by jWork.ORG