nloptr (version 0.8.3)

check.derivatives: Check analytic gradients of a function using finite difference approximations

Description

This function compares the analytic gradients of a function with a finite difference approximation and prints the results of these checks.

Usage

check.derivatives( 
	.x, 
	func, 
	func_grad, 
	check_derivatives_tol = 1e-04, 
	check_derivatives_print = 'all', 
	func_grad_name = 'grad_f', 
	...)

Arguments

.x
point at which the comparison is done.
func
function to be evaluated.
func_grad
function calculating the analytic gradients.
check_derivatives_tol
option determining when differences between the analytic gradient and its finite difference approximation are flagged as an error.
check_derivatives_print
option related to the amount of output. 'all' means that all comparisons are shown, 'errors' only shows comparisons that are flagged as an error, and 'none' shows the number of errors only.
func_grad_name
option to change the name of the gradient function that shows up in the output.
...
further arguments passed to the functions func and func_grad.

See Also

nloptr