Package pyrobot :: Package brain :: Module conx :: Class Layer
[frames | no frames]

Class Layer


Class which contains arrays of node elements (ie, activation,
error, bias, etc).

Method Summary
  __init__(self, name, size)
Constructor for Layer class.
  __getstate__(self)
  __len__(self)
Returns the number of nodes in the layer.
  __setstate__(self, dict)
  __str__(self)
  changeSize(self, newsize)
Changes the size of the layer.
  closeLog(self)
Closes the log file.
  copyActivations(self, arr)
Copies activations from the argument array into layer activations.
  copyTargets(self, arr)
Copies the targets of the argument array into the self.target attribute.
  display(self)
Displays the Layer instance to the screen.
  getActivations(self)
Returns node activations in (Numeric) array (pointer) form.
  getActivationsList(self)
Returns node activations in list (copy) form.
  getActive(self)
Used to determine if a layer is active or inactive.
  getCorrect(self, tolerance)
Returns the number of nodes within tolerance of the target.
  getEpsilonAt(self, pos)
  getEpsilons(self)
  getTargets(self)
Return targets in (Numeric) array form.
  getTargetsList(self)
Returns targets in list form.
  getWinner(self, type)
Returns the winner of the type specified {'activation' or 'target'}.
  initialize(self, epsilon)
Initializes important node values to zero for each node in the layer (target, error, activation, dbias, delta, netinput, bed).
  logMsg(self, msg)
Logs a message.
  randomize(self)
Initialize node biases to random values in the range [-max, max].
  resetActivationFlag(self)
Resets self.activationSet flag.
  resetFlags(self)
Resets self.targetSet and self.activationSet flags.
  resetTargetFlag(self)
Resets self.targetSet flag.
  RMSError(self)
Returns Root Mean Squared Error for this layer's pattern.
  setActivations(self, value)
Sets all activations to the value of the argument.
  setActive(self, value)
Sets layer to active or inactive.
  setDisplayWidth(self, val)
Sets self.displayWidth the the argument value.
  setEpsilon(self, value)
  setEpsilonAt(self, value, pos)
  setEpsilons(self, values)
  setLog(self, fileName)
Opens a log file with name fileName.
  setTargets(self, value)
Sets all targets the the value of the argument.
  toString(self)
Returns a string representation of Layer instance.
  TSSError(self)
Returns Total Sum Squared Error for this layer's pattern.
  writeLog(self)
Writes to the log file.

Method Details

__init__(self, name, size)
(Constructor)

Constructor for Layer class. A name and the number of nodes
for the instance are passed as arguments.

__len__(self)
(Length operator)

Returns the number of nodes in the layer.

changeSize(self, newsize)

Changes the size of the layer. Should only be called through
Network.changeLayerSize().

closeLog(self)

Closes the log file.

copyActivations(self, arr)

Copies activations from the argument array into
layer activations.

copyTargets(self, arr)

Copies the targets of the argument array into the self.target attribute.

display(self)

Displays the Layer instance to the screen.

getActivations(self)

Returns node activations in (Numeric) array (pointer) form.

getActivationsList(self)

Returns node activations in list (copy) form.

getActive(self)

Used to determine if a layer is active or inactive.

getCorrect(self, tolerance)

Returns the number of nodes within tolerance of the target.

getTargets(self)

Return targets in (Numeric) array form.

getTargetsList(self)

Returns targets in list form.

getWinner(self, type='activation')

Returns the winner of the type specified {'activation' or
'target'}.

initialize(self, epsilon)

Initializes important node values to zero for each node in the
layer (target, error, activation, dbias, delta, netinput, bed).

logMsg(self, msg)

Logs a message.

randomize(self)

Initialize node biases to random values in the range [-max, max].

resetActivationFlag(self)

Resets self.activationSet flag.

resetFlags(self)

Resets self.targetSet and self.activationSet flags.

resetTargetFlag(self)

Resets self.targetSet flag.

RMSError(self)

Returns Root Mean Squared Error for this layer's pattern.

setActivations(self, value)

Sets all activations to the value of the argument. Value should be in the range [0,1].

setActive(self, value)

Sets layer to active or inactive. Layers must be active to propagate activations.

setDisplayWidth(self, val)

Sets self.displayWidth the the argument value.

setLog(self, fileName)

Opens a log file with name fileName.

setTargets(self, value)

Sets all targets the the value of the argument. This value must be in the range [0,1].

toString(self)

Returns a string representation of Layer instance.

TSSError(self)

Returns Total Sum Squared Error for this layer's pattern.

writeLog(self)

Writes to the log file.

Generated by Epydoc 2.1 on Mon Jul 25 01:39:27 2005 http://epydoc.sf.net