Table of Contents

Class: OutputLayer Bio/NeuralNetwork/BackPropagation/Layer.py
Base Classes   
AbstractLayer
Methods   
__init__
backpropagate
get_error
set_weight
update
  __init__ 
__init__ (
        self,
        num_nodes,
        activation=logistic_function,
        )

Initialize the Output Layer.

Arguments:

  • num_nodes -- The number of nodes in this layer. This corresponds to the number of outputs in the neural network.

  • activation -- The transformation function used to transform predicted values.

  backpropagate 
backpropagate (
        self,
        outputs,
        learning_rate,
        momentum,
        )

Calculate the backpropagation error at a given node.

This calculates the error term using the formula:

p = (z - t) z (1 - z)

where z is the calculated value for the node, and t is the real value.

Arguments:

  • outputs - The list of output values we use to calculate the errors in our predictions.

  get_error 
get_error (
        self,
        real_value,
        node_number,
        )

Return the error value at a particular node.

  set_weight 
set_weight (
        self,
        this_node,
        next_node,
        value,
        )

Exceptions   
NotImplementedError( "Can't set weights for the output layer" )
  update 
update ( self,  previous_layer )

Update the value of output nodes from the previous layers.

Arguments:

  • previous_layer -- The hidden layer preceeding this.


Table of Contents

This document was automatically generated on Mon Jul 1 12:03:11 2002 by HappyDoc version 2.0.1