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.
parent
,
Serialized Formbias, gradientInps, gradientOuts, inps, inputPatternListeners, learnable, learning, m_batch, monitor, myLearner, outputPatternListeners, outs, running, step, STOP_FLAG
Constructor and Description |
---|
GaussianLayer()
The default constructor for this GaussianLayer.
|
GaussianLayer(java.lang.String ElemName)
The constructor that takes a name of the layer.
|
Modifier and Type | Method and Description |
---|---|
void |
backward(double[] pattern)
This method has a blank body as there are no biases to adjust.
|
java.util.TreeSet |
check()
Check that there are no errors or problems with the properties of this
GaussianLayer.
|
void |
cicleTerminated(NeuralNetEvent e)
Updates the Gaussian Size if in learning mode.
|
void |
errorChanged(NeuralNetEvent e) |
void |
forward(double[] pattern)
This method takes as input an array of euclidean distances between the input and
weights calculated by the previous synapse.
|
double |
getDefaultState()
Return the default state of a node in this layer, such as 0 for a tanh or 0.5 for a sigmoid layer
|
double |
getDerivative(int i)
Similar to the backward message and used by RTRL
|
double |
getInitialGaussianSize()
Getter for property initialGaussianSize.
|
int |
getLargestDimension()
Gets the largest layer dimension size.
|
int |
getLayerDepth()
Getter for property LayerDepth.
|
int |
getLayerHeight()
Getter for property LayerHeight.
|
int |
getLayerWidth()
Getter for property LayerWidth.
|
double |
getMaximumState()
Return maximum value of a node in this layer
|
double |
getMinimumState()
Return minimum value of a node in this layer
|
int |
getOrderingPhase()
Getter for property orderingPhase.
|
protected SpatialMap |
getSpace_map()
Getter for property space_map.
|
double |
getTimeConstant()
Getter for property timeConstant.
|
java.util.Collection |
Inspections()
It doesn't make sense to return biases for this layer
|
void |
netStarted(NeuralNetEvent e)
Initialises the time constant used to decrease the size of the spatial
map.
|
void |
netStopped(NeuralNetEvent e) |
void |
netStoppedError(NeuralNetEvent e,
java.lang.String error) |
void |
setInitialGaussianSize(double initialGaussianSize)
Setter for property initialGaussianSize.
|
void |
setLayerDepth(int layerDepth)
Setter for property LayerDepth.
|
void |
setLayerHeight(int LayerHeight)
Setter for property LayerHeight.
|
void |
setLayerWidth(int LayerWidth)
Setter for property LayerWidth.
|
void |
setOrderingPhase(int orderingPhase)
Setter for property orderingPhase.
|
void |
setTimeConstant(double timeConstant)
Setter for property timeConstant.
|
void |
start()
Starts the Layer
|
getLearningRate, getLrate, getMomentum, setDimensions, setLrate, setMomentum, setMonitor
addInputSynapse, addNoise, addOutputSynapse, adjustSizeToFwdPattern, adjustSizeToRevPattern, checkInputEnabled, checkInputs, checkOutputs, copyInto, finalize, fireFwdGet, fireFwdPut, fireRevGet, fireRevPut, fwdRun, getAllInputs, getAllOutputs, getBias, getDimension, getLastGradientInps, getLastGradientOuts, getLastInputs, getLastOutputs, getLayerName, getLearner, getMonitor, getRows, getThreadMonitor, hasStepCounter, init, initLearner, InspectableTitle, isInputLayer, isOutputLayer, isRunning, join, randomize, randomizeBias, randomizeWeights, removeAllInputs, removeAllOutputs, removeInputSynapse, removeListener, removeOutputSynapse, resetInputListeners, revRun, run, setAllInputs, setAllOutputs, setBias, setConnDimensions, setInputDimension, setInputSynapses, setLastInputs, setLastOutputs, setLayerName, setOutputDimension, setOutputSynapses, setRows, stop, sumBackInput, sumInput, toString
public GaussianLayer()
The default constructor for this GaussianLayer.
public GaussianLayer(java.lang.String ElemName)
ElemName
- The name of the Layerpublic void backward(double[] pattern) throws JooneRuntimeException
This method has a blank body as there are no biases to adjust.
backward
in class SimpleLayer
pattern
- Not used. The pattern to process and pass back.JooneRuntimeException
- The run time exception.public double getDerivative(int i)
getDerivative
in class Layer
public void forward(double[] pattern) throws JooneRuntimeException
This 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.
forward
in class Layer
pattern
- The pattern containing the euclidean distances from the previous synapse.JooneRuntimeException
- This Exception
is a wrapper Exception when an Exception is thrown
while doing the maths.(double[])
public int getLayerDepth()
public void setLayerDepth(int layerDepth)
layerDepth
- New value of property LayerDepth.public int getLayerHeight()
public void setLayerHeight(int LayerHeight)
LayerHeight
- New value of property LayerHeight.public int getLayerWidth()
public void setLayerWidth(int LayerWidth)
LayerWidth
- New value of property LayerWidth.public int getLargestDimension()
public java.util.TreeSet check()
Check that there are no errors or problems with the properties of this GaussianLayer.
check
in interface NeuralLayer
check
in class Layer
NeuralLayer
public void start()
Layer
start
in interface NeuralLayer
start
in class Layer
public void netStarted(NeuralNetEvent e)
Initialises the time constant used to decrease the size of the spatial map.
netStarted
in interface NeuralNetListener
e
- The original Net Event.public void cicleTerminated(NeuralNetEvent e)
Updates the Gaussian Size if in learning mode.
cicleTerminated
in interface NeuralNetListener
e
- The original Net Event.public int getOrderingPhase()
public void setOrderingPhase(int orderingPhase)
orderingPhase
- New value of property orderingPhase.public double getTimeConstant()
public void setTimeConstant(double timeConstant)
timeConstant
- New value of property timeConstant.protected SpatialMap getSpace_map()
public double getInitialGaussianSize()
public void setInitialGaussianSize(double initialGaussianSize)
initialGaussianSize
- New value of property initialGaussianSize.public java.util.Collection Inspections()
Inspections
in interface Inspectable
Inspections
in class Layer
org.joone.Inspection
public void netStoppedError(NeuralNetEvent e, java.lang.String error)
netStoppedError
in interface NeuralNetListener
public void errorChanged(NeuralNetEvent e)
errorChanged
in interface NeuralNetListener
public void netStopped(NeuralNetEvent e)
netStopped
in interface NeuralNetListener
public double getDefaultState()
Layer
getDefaultState
in class Layer
public double getMinimumState()
Layer
getMinimumState
in class Layer
public double getMaximumState()
Layer
getMaximumState
in class Layer
Submit Feedback to pmarrone@users.sourceforge.net