org.encog.neural.networks.synapse
Interface Synapse

All Superinterfaces:
EncogPersistedObject, Serializable
All Known Implementing Classes:
BasicSynapse, DirectSynapse, NEATSynapse, OneToOneSynapse, WeightedSynapse, WeightlessSynapse

public interface Synapse
extends EncogPersistedObject

A synapse is the connection between two layers of a neural network. The various synapse types define how layers will interact with each other. Some synapses contain a weight matrix, which cause them to be teachable. Others simply feed the data between layers in various ways, and are not teachable.

Author:
jheaton

Method Summary
 Object clone()
           
 NeuralData compute(NeuralData input)
          Compute the output from this synapse.
 Layer getFromLayer()
           
 int getFromNeuronCount()
           
 Matrix getMatrix()
          Get the weight matrix.
 int getMatrixSize()
          Get the size of the matrix, or zero if one is not defined.
 Layer getToLayer()
           
 int getToNeuronCount()
           
 SynapseType getType()
           
 boolean isSelfConnected()
           
 boolean isTeachable()
           
 void setFromLayer(Layer fromLayer)
          Set the from layer for this synapse.
 void setMatrix(Matrix matrix)
          Assign a new weight matrix to this layer.
 void setToLayer(Layer toLayer)
          Set the target layer from this synapse.
 
Methods inherited from interface org.encog.persist.EncogPersistedObject
createPersistor, getCollection, getDescription, getName, setCollection, setDescription, setName
 

Method Detail

clone

Object clone()
Returns:
A clone of this object.

compute

NeuralData compute(NeuralData input)
Compute the output from this synapse.

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

getFromLayer

Layer getFromLayer()
Returns:
The from layer.

getFromNeuronCount

int getFromNeuronCount()
Returns:
The neuron count from the "from layer".

getMatrix

Matrix getMatrix()
Get the weight matrix.

Returns:
The weight matrix.

getMatrixSize

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

Returns:
The size of the matrix.

getToLayer

Layer getToLayer()
Returns:
The "to layer".

getToNeuronCount

int getToNeuronCount()
Returns:
The neuron count from the "to layer".

getType

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

isSelfConnected

boolean isSelfConnected()
Returns:
True if this is a self-connected synapse. That is, the from and to layers are the same.

isTeachable

boolean isTeachable()
Returns:
True if the weights for this synapse can be modified.

setFromLayer

void setFromLayer(Layer fromLayer)
Set the from layer for this synapse.

Parameters:
fromLayer - The from layer for this synapse.

setMatrix

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

Parameters:
matrix - The new matrix.

setToLayer

void setToLayer(Layer toLayer)
Set the target layer from this synapse.

Parameters:
toLayer - The target layer from this synapse.


Copyright © 2011. All Rights Reserved.