Description Usage Arguments Value
Creates a numerical approximation to the gradient function of a kernel (using create.numeric.grad
)
and compares it to an analytic gradient function. If the maximum relative difference exceeds 0.01, returns the failing inputs,
otherwise returns TRUE.
1 2 | test.kernel.grad(k, k.grad, hyper.param.names, additional.params,
repetitions = 1000, dimensions = NULL)
|
k |
a kernel function |
k.grad |
the analytic gradient to test |
hyper.param.names |
names of the kernel's hyperparameters |
additional.params |
any additional parameters of the kernel |
repetitions |
number of repetitions to attempt |
If the gradients match, returns TRUE. If a mismatch is found, returns a list with named entries:
a, b, hyper.params - the parameters passed to the gradient functions
grad - return value of the analytic gradient
grad.num - return value of the numerical gradient
max.diff - the maximum relative difference observed between the two gradient functions so far (including the failed set of inputs)
i - the number of inputs tested (including the failed set of inputs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.