org.encog.neural.networks.synapse
Class DirectSynapse

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

public class DirectSynapse
extends BasicSynapse

A direct synapse will present the entire input array to each of the directly connected neurons in the next layer. This layer type is useful when building a radial basis neural network. This synapse type is not teachable.

Author:
jheaton
See Also:
Serialized Form

Constructor Summary
DirectSynapse()
          Simple default constructor.
DirectSynapse(Layer fromLayer, Layer toLayer)
          Construct a direct synapse between the two specified layers.
 
Method Summary
 Object clone()
           
 NeuralData compute(NeuralData input)
          Compute the output from this synapse.
 Persistor createPersistor()
          Create a persistor for this type of synapse.
 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

DirectSynapse

public DirectSynapse()
Simple default constructor.


DirectSynapse

public DirectSynapse(Layer fromLayer,
                     Layer toLayer)
Construct a direct synapse between the two specified 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 output from this synapse.

Parameters:
input - The input to this synapse.
Returns:
The output is the same as the input.

createPersistor

public Persistor createPersistor()
Create a persistor for this type of synapse.

Returns:
A 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.