Skip to contents

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.

Usage

reload_model(x, check_gradient = TRUE)

Arguments

x

Output from tinyVAST, potentially with DLLs not linked

check_gradient

Whether to check the gradients of the reloaded model

Value

Output from tinyVAST with DLLs relinked

Examples

if (FALSE) {
# Run model
fit = tinyVAST( ... )
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 )
}