Daniel@0: Daniel@0:
Daniel@0:Daniel@0: Daniel@0: gradchek(w, func, grad) Daniel@0: [gradient, delta] = gradchek(w, func, grad) Daniel@0: gradchek(w, func, grad, p1, p2, ...) Daniel@0:Daniel@0: Daniel@0: Daniel@0:
gradchek(w, func, grad)
checks how accurate the gradient
Daniel@0: grad
of a function func
is at a parameter vector x
.
Daniel@0: A central
Daniel@0: difference formula with step size 1.0e-6 is used, and the results
Daniel@0: for both gradient function and finite difference approximation are
Daniel@0: printed.
Daniel@0: The optional return value gradient
is the gradient calculated
Daniel@0: using the function grad
and the return value delta
is the
Daniel@0: difference between the functional and finite difference methods of
Daniel@0: calculating the graident.
Daniel@0:
Daniel@0: gradchek(x, func, grad, p1, p2, ...)
allows additional arguments
Daniel@0: to be passed to func
and grad
.
Daniel@0:
Daniel@0:
conjgrad
, graddesc
, hmc
, olgd
, quasinew
, scg
Copyright (c) Ian T Nabney (1996-9) Daniel@0: Daniel@0: Daniel@0: Daniel@0: