tests/testthat/helper_module.R

testmodule_linear = nn_module(
  initialize = function(task) {
    out = get_nout(task)
    self$linear = nn_linear(length(task$feature_names), out)
  },
  forward = function(x) {
    self$linear(x)
  }
)

Try the mlr3torch package in your browser

Any scripts or data that you put into this service are public.

mlr3torch documentation built on April 4, 2025, 3:03 a.m.