Name

ann_FF_grad_BP — error gradient trough backpropagation

CALLING SEQUENCE

W = ann_FF_grad_BP(x,t,N,W[,c,af,err_deriv_y])

PARAMETERS

x Matrix of input patterns, one pattern per column.

t Matrix of targets, one pattern per column. Each column have a correspondent column in x.

N Row vector describing the number of neurons per layer. N(1) is the size of input pattern vector, N(size(N,'c')) is the size of output pattern vector (and also target).

W The weight hypermatrix (initialized first trough ann_BP_init).

c defines the threshold of error which is backpropagated: a error smaller that c (at one neuronal output) is rounded towards zero and thus not propagated. It have to be set to zero for exact calculation of gradient. This parameter is optional, default value 0.

af Activation function and its derivative. Row vector of strings: af(1) name of activation function. af(2) name of derivative.

Warning: given the activation function y=f(x), the derivative have to be expressed in terms of y, not x. This parameter is optional, default value is "['ann_log_activ', 'ann_d_log_activ']", i.e. logistic activation function and its derivative.

err_deriv_y the name of error function derivative with respect to network outputs. This parameter is optional, default value is "ann_d_sum_of_sqr", i.e. the derivative of sum-of-squares.

Description

Returns the error gradient hypermatrix (it have the same layout as W) of a feedforward ANN, using the whole given training set. The algorithm used is standard backpropagation.

EXAMPLES

This function is used as a low level engine in other algorithms (thus the reason for existence of c parameter), e.g. see implementation of ann_FF_ConjugGrad function.

See Also

ANN, ANN_FF, ANN_FF_init