Skip to contents

Loads a full CISSVAE model into R via reticulate.

Usage

load_cissvae_model(file, python_env = NULL)

Arguments

file

Path to the saved model file (e.g., "trained_vae.pt")

python_env

Optional: Python virtualenv or conda env to activate

Value

CISSVAE model object

Examples

# \donttest{
## Requires a working Python environment via reticulate
## Wrapped in try() and donttest to avoid CRAN check failures
try({
  # Activate the Python virtualenv or conda env where CISSVAE is installed
  reticulate::use_virtualenv("cissvae_environment", required = TRUE)

  # Path to a previously saved model file
  model_file <- "trained_vae.pt"

  # Load the CISS-VAE model
  loaded_model <- try(
    load_cissvae_model(file = model_file, python_env = "cissvae_environment")
  )

})
#> Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
#>   FileNotFoundError: [Errno 2] No such file or directory: 'trained_vae.pt'
#> Run `reticulate::py_last_error()` for details.
# }