wolffd@0: 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:
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:
conjgrad
, graddesc
, hmc
, olgd
, quasinew
, scg
Copyright (c) Ian T Nabney (1996-9) wolffd@0: wolffd@0: wolffd@0: wolffd@0: