gradchek

Purpose

Checks a user-defined gradient function using finite differences.

Synopsis


gradchek(w, func, grad)
gradchek(w, func, grad, p1, p2, ...)

Description

This function is intended as a utility for other netlab functions (particularly optimisation functions) to use. It enables the user to check whether a gradient calculation has been correctly implmented for a given function. gradchek(w, func, grad) checks how accurate the gradient grad of a function func is at a parameter vector x. A central difference formula with step size 1.0e-6 is used, and the results for both gradient function and finite difference approximation are printed. There is no return value.

gradchek(x, func, grad, p1, p2, ...) allows additional arguments to be passed to func and grad.

See Also

conjgrad, graddesc, hmc, olgd, quasinew, scg
Pages: Index

Copyright (c) Christopher M Bishop, Ian T Nabney (1996, 1997)