The Encog Project

org.encog.neural.networks.synapse
Class WeightedSynapse

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

public class WeightedSynapse
extends BasicSynapse

A fully-connected weight based synapse. Inputs will be multiplied by the weight matrix and presented to the layer. This synapse type is teachable.

Author:
jheaton
See Also:
Serialized Form

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

Constructor Detail

WeightedSynapse

public WeightedSynapse()
Simple default constructor.


WeightedSynapse

public WeightedSynapse(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 java.lang.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 weighted output from this synapse. Each neuron in the from layer has a weighted 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()
Get the weight and threshold matrix.

Returns:
The weight and threshold matrix.

getMatrixSize

public int getMatrixSize()
Get the size of the matrix, or zero if one is not defined.

Returns:
The size of the matrix.

getType

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

isTeachable

public boolean isTeachable()
Returns:
True, this is a teachable synapse type.

setMatrix

public void setMatrix(Matrix matrix)
Assign a new weight and threshold matrix to this layer.

Parameters:
matrix - The new matrix.

The Encog Project