View source: R/apply_gradient.R
apply_gradient | R Documentation |
Compute gradient contribution for exact response
apply_gradient(
x_train,
y_train,
model,
img_train = NULL,
verbose = FALSE,
response_varying = FALSE
)
mo <- ontram_polr(x_dim = 1L, y_dim = 5L, method = "logit")
x_train <- matrix(c(0.5, -0.5, 0), ncol = 1)
x_train <- tf$constant(x_train, dtype = "float32")
y_train <- matrix(c(0, 1, 0, 0, 0,
0, 0, 1, 0, 0,
0, 0, 0, 0, 1), nrow = 3, byrow = TRUE)
y_train <- tf$constant(y_train, dtype = "float32")
apply_gradient(x_train, y_train, mo, verbose = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.