The Complete SPRLIB & ANNLIB

grad_net_mse

- calculate the gradient of the MSE of a dataset with respect to all parameters of a network

SYNOPSIS

void grad_net_mse (dset, net, grad)

ARGUMENTS

DATASET *dset A pointer to a DATASET structure.
NET *net A pointer to a NET structure.
double *grad A vector containing the gradients.

RETURNS

All gradients, in grad.

FUNCTION

This function calculates the sum of gradients of the MSE for all samples in a dataset with respect to all the parameters belonging to a network. It does this by initializing the SystemData.d fields of all biases (theta's) and weights to 0.0 and calling grad_net for all SAMPLE's in the DATASET. After this loop, the summed gradients are stored in the grad vector: those of the biases first, followed by those of the weights.

NOTE

The function checks certain requirements: dset must be an IOSET and LEARNSET (see DATASET-flags); net must be an FFNET or RBFFNET (see NET-flags) and SystemDataRWFlag should give weight and unit write permission (see NET-ACCESS-flags). The code is an adaptation of the back-propagation function bp_learn.

This document was generated using api2html on Thu Mar 5 09:00:00 MET DST 1998