reload_model | R Documentation |
reload_model
allows a user to save a fitted model, reload it in a new
R terminal, and then relink the DLLs so that it functions as expected.
reload_model(
x,
check_gradient = TRUE,
CompileDir = system.file("executables", package = "VAST"),
Version = x$settings$Version,
framework = x$input_args$model_args_input$framework,
Obj = x$tmb_list$Obj
)
x |
Output from |
check_gradient |
Whether to check the gradients of the reloaded model |
CompileDir |
a directory where the CPP file is copied, copiled, and run
(must have write privileges or else the function will crash); by default uses |
Version |
Which CPP version to use. If missing, defaults to latest version
using |
framework |
Which AD framework to use ('TMBad' or 'CppAD') |
Output from fit_model
with DLLs relinked
## Not run:
# Run model
fit = fit_model( ... )
saveRDS( object=fit, file="path_and_name.rds" )
# Reload and relink
fit_new = readRDS( file="path_and_name.rds" )
fit_new = reload_model( x = fit_new )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.