Package Bio :: Package NeuralNetwork :: Package BackPropagation :: Module Layer :: Class OutputLayer
[hide private]
[frames] | no frames]

Class OutputLayer

source code

   object --+    
            |    
AbstractLayer --+
                |
               OutputLayer

Instance Methods [hide private]
 
__init__(self, num_nodes, activation=<function logistic_function at 0x7fa98d0cdb90>)
Initialize the Output Layer.
source code
 
update(self, previous_layer)
Update the value of output nodes from the previous layers.
source code
 
backpropagate(self, outputs, learning_rate, momentum)
Calculate the backpropagation error at a given node.
source code
 
get_error(self, real_value, node_number)
Return the error value at a particular node.
source code
 
set_weight(self, this_node, next_node, value)
Set a weight value from one node to the next.
source code

Inherited from AbstractLayer: __str__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, num_nodes, activation=<function logistic_function at 0x7fa98d0cdb90>)
(Constructor)

source code 
Initialize the Output Layer.

Arguments:

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

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

Overrides: object.__init__

update(self, previous_layer)

source code 
Update the value of output nodes from the previous layers.

Arguments:

o previous_layer -- The hidden layer preceding this.

backpropagate(self, outputs, learning_rate, momentum)

source code 
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:

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

set_weight(self, this_node, next_node, value)

source code 
Set a weight value from one node to the next.

If weights are not explicitly set, they will be initialized to
random values to start with.

Overrides: AbstractLayer.set_weight
(inherited documentation)