wolffd@0: wolffd@0: wolffd@0: wolffd@0: Netlab Reference Manual gradchek wolffd@0: wolffd@0: wolffd@0: wolffd@0:

gradchek wolffd@0:

wolffd@0:

wolffd@0: Purpose wolffd@0:

wolffd@0: Checks a user-defined gradient function using finite differences. wolffd@0: wolffd@0:

wolffd@0: Synopsis wolffd@0:

wolffd@0:
wolffd@0: 
wolffd@0: gradchek(w, func, grad)
wolffd@0: [gradient, delta] = gradchek(w, func, grad)
wolffd@0: gradchek(w, func, grad, p1, p2, ...)
wolffd@0: 
wolffd@0: wolffd@0: wolffd@0:

wolffd@0: Description wolffd@0:

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

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

wolffd@0: See Also wolffd@0:

wolffd@0: conjgrad, graddesc, hmc, olgd, quasinew, scg
wolffd@0: Pages: wolffd@0: Index wolffd@0:
wolffd@0:

Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: wolffd@0: wolffd@0: