Class GaussianLayer
- java.lang.Object
-
- org.joone.engine.Layer
-
- org.joone.engine.SimpleLayer
-
- org.joone.engine.GaussianLayer
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Runnable, java.util.EventListener, Learnable, LearnableLayer, NeuralLayer, NeuralNetListener, Inspectable
public class GaussianLayer extends SimpleLayer implements NeuralNetListener
This layer implements the Gaussian Neighborhood SOM strategy. It receives the euclidean distances between the input vector and weights and calculates the distance fall off between the winning node and all other nodes. These are passed back allowing the previous synapse to adjust it's weights.
The distance fall off is calculated according to a Gaussian distribution from the winning node. This layer uses implemtations of SpatialMap in order to calculate these distances. Currently this layer uses the GaussianSpatialMap which calculates the Gaussian distance for all nodes in the SOM map. Future maps will allow distance calculations based on a specific shape such as a circle , square or diamond. Currently the GuassianLayer supports 3D SOM maps.
- See Also:
parent, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GaussianLayer()The default constructor for this GaussianLayer.GaussianLayer(java.lang.String ElemName)The constructor that takes a name of the layer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidbackward(double[] pattern)This method has a blank body as there are no biases to adjust.java.util.TreeSetcheck()Check that there are no errors or problems with the properties of this GaussianLayer.voidcicleTerminated(NeuralNetEvent e)Updates the Gaussian Size if in learning mode.voiderrorChanged(NeuralNetEvent e)voidforward(double[] pattern)This method takes as input an array of euclidean distances between the input and weights calculated by the previous synapse.doublegetInitialGaussianSize()Getter for property initialGaussianSize.intgetLargestDimension()Gets the largest layer dimension size.intgetLayerDepth()Getter for property LayerDepth.intgetLayerHeight()Getter for property LayerHeight.intgetLayerWidth()Getter for property LayerWidth.intgetOrderingPhase()Getter for property orderingPhase.doublegetTimeConstant()Getter for property timeConstant.java.util.CollectionInspections()It doesn't make sense to return biases for this layervoidnetStarted(NeuralNetEvent e)Initialises the time constant used to decrease the size of the spatial map.voidnetStopped(NeuralNetEvent e)voidnetStoppedError(NeuralNetEvent e, java.lang.String error)voidsetInitialGaussianSize(double initialGaussianSize)Setter for property initialGaussianSize.voidsetLayerDepth(int layerDepth)Setter for property LayerDepth.voidsetLayerHeight(int LayerHeight)Setter for property LayerHeight.voidsetLayerWidth(int LayerWidth)Setter for property LayerWidth.voidsetOrderingPhase(int orderingPhase)Setter for property orderingPhase.voidsetTimeConstant(double timeConstant)Setter for property timeConstant.voidstart()Starts the Layer-
Methods inherited from class org.joone.engine.SimpleLayer
getLearningRate, getLrate, getMomentum, setLrate, setMomentum, setMonitor
-
Methods inherited from class org.joone.engine.Layer
addInputSynapse, addNoise, addOutputSynapse, copyInto, finalize, fwdRun, getAllInputs, getAllOutputs, getBias, getDimension, getLastOutputs, getLayerName, getLearner, getMonitor, getRows, hasStepCounter, init, initLearner, InspectableTitle, isInputLayer, isOutputLayer, isRunning, join, randomize, removeAllInputs, removeAllOutputs, removeInputSynapse, removeOutputSynapse, revRun, run, setAllInputs, setAllOutputs, setBias, setInputSynapses, setLayerName, setOutputSynapses, setRows, stop, toString
-
-
-
-
Constructor Detail
-
GaussianLayer
public GaussianLayer()
The default constructor for this GaussianLayer.
-
GaussianLayer
public GaussianLayer(java.lang.String ElemName)
The constructor that takes a name of the layer.- Parameters:
ElemName- The name of the Layer
-
-
Method Detail
-
backward
public void backward(double[] pattern) throws JooneRuntimeExceptionThis method has a blank body as there are no biases to adjust.
- Parameters:
pattern- Not used. The pattern to process and pass back.- Throws:
JooneRuntimeException- The run time exception.
-
forward
public void forward(double[] pattern) throws JooneRuntimeExceptionThis method takes as input an array of euclidean distances between the input and weights calculated by the previous synapse. This method calculates the Gaussian distance fall off between the winning neuron and all other nodes. These distances are passed on to the next synapse.
- Parameters:
pattern- The pattern containing the euclidean distances from the previous synapse.- Throws:
JooneRuntimeException- ThisExceptionis a wrapper Exception when an Exception is thrown while doing the maths.- See Also:
(double[])
-
getLayerDepth
public int getLayerDepth()
Getter for property LayerDepth.- Returns:
- Value of property LayerDepth.
-
setLayerDepth
public void setLayerDepth(int layerDepth)
Setter for property LayerDepth.- Parameters:
layerDepth- New value of property LayerDepth.
-
getLayerHeight
public int getLayerHeight()
Getter for property LayerHeight.- Returns:
- Value of property LayerHeight.
-
setLayerHeight
public void setLayerHeight(int LayerHeight)
Setter for property LayerHeight.- Parameters:
LayerHeight- New value of property LayerHeight.
-
getLayerWidth
public int getLayerWidth()
Getter for property LayerWidth.- Returns:
- Value of property LayerWidth.
-
setLayerWidth
public void setLayerWidth(int LayerWidth)
Setter for property LayerWidth.- Parameters:
LayerWidth- New value of property LayerWidth.
-
getLargestDimension
public int getLargestDimension()
Gets the largest layer dimension size.- Returns:
- The size of the largest dimension, width , height or depth.
-
check
public java.util.TreeSet check()
Check that there are no errors or problems with the properties of this GaussianLayer.
- Specified by:
checkin interfaceNeuralLayer- Overrides:
checkin classLayer- Returns:
- The TreeSet of errors / problems if any.
- See Also:
NeuralLayer
-
start
public void start()
Description copied from class:LayerStarts the Layer- Specified by:
startin interfaceNeuralLayer- Overrides:
startin classLayer
-
netStarted
public void netStarted(NeuralNetEvent e)
Initialises the time constant used to decrease the size of the spatial map.
- Specified by:
netStartedin interfaceNeuralNetListener- Parameters:
e- The original Net Event.
-
cicleTerminated
public void cicleTerminated(NeuralNetEvent e)
Updates the Gaussian Size if in learning mode.
- Specified by:
cicleTerminatedin interfaceNeuralNetListener- Parameters:
e- The original Net Event.
-
getOrderingPhase
public int getOrderingPhase()
Getter for property orderingPhase.- Returns:
- Value of property orderingPhase.
-
setOrderingPhase
public void setOrderingPhase(int orderingPhase)
Setter for property orderingPhase.- Parameters:
orderingPhase- New value of property orderingPhase.
-
getTimeConstant
public double getTimeConstant()
Getter for property timeConstant.- Returns:
- Value of property timeConstant.
-
setTimeConstant
public void setTimeConstant(double timeConstant)
Setter for property timeConstant.- Parameters:
timeConstant- New value of property timeConstant.
-
getInitialGaussianSize
public double getInitialGaussianSize()
Getter for property initialGaussianSize.- Returns:
- Value of property initialGaussianSize.
-
setInitialGaussianSize
public void setInitialGaussianSize(double initialGaussianSize)
Setter for property initialGaussianSize.- Parameters:
initialGaussianSize- New value of property initialGaussianSize.
-
Inspections
public java.util.Collection Inspections()
It doesn't make sense to return biases for this layer- Specified by:
Inspectionsin interfaceInspectable- Overrides:
Inspectionsin classLayer- Returns:
- null
- See Also:
org.joone.Inspection
-
netStoppedError
public void netStoppedError(NeuralNetEvent e, java.lang.String error)
- Specified by:
netStoppedErrorin interfaceNeuralNetListener
-
errorChanged
public void errorChanged(NeuralNetEvent e)
- Specified by:
errorChangedin interfaceNeuralNetListener
-
netStopped
public void netStopped(NeuralNetEvent e)
- Specified by:
netStoppedin interfaceNeuralNetListener
-
-
DataMelt 3.0 © DataMelt by jWork.ORG