g <- kernGradient(kern, x, partial)
g <- kernGradient(kern, x1, x2, partial_)
g <- kernGradient(kern, x, partial)
g <- *kernGradient(kern, x, partial)
computes the gradient of functions with respect to the kernel parameters. As well as the kernel structure and the input positions, the user provides a matrix PARTIAL which gives the partial derivatives of the function with respect to the relevant elements of the kernel matrix. g <- kernGradient(kern, x1, x2, partial_)
g <- *kernGradient(kern, x1, x2, partial_)
computes the derivatives as above, but input locations are now provided in two matrices associated with rows and columns of the kernel matrix.
g <- *X*kernGradient(kern1, kern2, x, partial)
g <- *X*kernGradient(kern1, kern2, x1, x2, partial_)
same as above, but for cross combinations of two kernels, kern1
and kern2
.
kernCompute
, kernExtractParam
.kern <- kernCreate(1, 'rbf')
g <- kernGradient(kern, as.matrix(c(1, 4)), array(1, c(2, 2)))
Run the code above in your browser using DataLab