apply_gradient2: Compute gradient contribution for exact response

View source: R/apply_gradient.R

apply_gradient2R Documentation

Compute gradient contribution for exact response

Description

Compute gradient contribution for exact response

Usage

apply_gradient2(
  x_train,
  y_train,
  model,
  img_train = NULL,
  verbose = FALSE,
  response_varying = FALSE,
  lambda2 = 0,
  numnet = 1
)

Examples

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)

LucasKookUZH/ontram-pkg documentation built on March 27, 2023, 6:05 p.m.