org.encog.neural.networks.synapse
Class WeightedSynapse

java.lang.Object
  extended by org.encog.persist.BasicPersistedSubObject
      extended by org.encog.neural.networks.synapse.BasicSynapse
          extended by org.encog.neural.networks.synapse.WeightedSynapse
All Implemented Interfaces:
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. This is a "fully connected" synapse between two layers. If you would like only some neurons to be connected to others, you should use the PartialSynapse.

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
 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 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 matrix to 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

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 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 matrix.

Returns:
The weight 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 matrix to this layer.

Parameters:
matrix - The new matrix.


Copyright © 2011. All Rights Reserved.