org.encog.neural.networks.synapse
Class WeightlessSynapse

java.lang.Object
  extended by org.encog.persist.BasicPersistedSubObject
      extended by org.encog.neural.networks.synapse.BasicSynapse
          extended by org.encog.neural.networks.synapse.WeightlessSynapse
All Implemented Interfaces:
Serializable, Synapse, EncogPersistedObject

public class WeightlessSynapse
extends BasicSynapse

A fully connected synapse that simply sums all input to each neuron, no weights are applied. This synapse type is not teachable.

Author:
jheaton
See Also:
Serialized Form

Constructor Summary
WeightlessSynapse()
          Simple default constructor.
WeightlessSynapse(Layer fromLayer, Layer toLayer)
          Construct a weighted synapse between the two layers.
 
Method Summary
 Object clone()
           
 NeuralData compute(NeuralData input)
          Compute the weightless output from this synapse.
 Persistor createPersistor()
          Return a persistor for this object.
 Matrix getMatrix()
          Get the weight matrix.
 int getMatrixSize()
          Get the size of the matrix, or zero if one is not defined.
 SynapseType getType()
           
 boolean isTeachable()
           
 void setMatrix(Matrix matrix)
          Attempt to set the matrix for this layer.
 
Methods inherited from class org.encog.neural.networks.synapse.BasicSynapse
getFromLayer, getFromNeuronCount, getToLayer, getToNeuronCount, isSelfConnected, setFromLayer, setName, setToLayer, toString
 
Methods inherited from class org.encog.persist.BasicPersistedSubObject
getCollection, getDescription, getName, setCollection, setDescription
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.encog.persist.EncogPersistedObject
getCollection, getDescription, getName, setCollection, setDescription
 

Constructor Detail

WeightlessSynapse

public WeightlessSynapse()
Simple default constructor.


WeightlessSynapse

public WeightlessSynapse(Layer fromLayer,
                         Layer toLayer)
Construct a weighted synapse between the two layers.

Parameters:
fromLayer - The starting layer.
toLayer - The ending layer.
Method Detail

clone

public Object clone()
Specified by:
clone in interface Synapse
Specified by:
clone in class BasicSynapse
Returns:
A clone of this object.

compute

public NeuralData compute(NeuralData input)
Compute the weightless output from this synapse. Each neuron in the from layer has a weightless connection to each of the neurons in the next layer.

Parameters:
input - The input from the synapse.
Returns:
The output from this synapse.

createPersistor

public Persistor createPersistor()
Return a persistor for this object.

Returns:
A new persistor.

getMatrix

public Matrix getMatrix()
Description copied from interface: Synapse
Get the weight matrix.

Returns:
null, this synapse type has no matrix.

getMatrixSize

public int getMatrixSize()
Description copied from interface: Synapse
Get the size of the matrix, or zero if one is not defined.

Returns:
0, this synapse type has no matrix.

getType

public SynapseType getType()
Returns:
The type of synapse that this is.

isTeachable

public boolean isTeachable()
Returns:
False, because this type of synapse is not teachable.

setMatrix

public void setMatrix(Matrix matrix)
Attempt to set the matrix for this layer. This will throw an error, because this layer type does not have a matrix.

Parameters:
matrix - Not used.


Copyright © 2011. All Rights Reserved.