Skip to contents

Restores EWSNet model weights to the pretrained defaults published at This is vital on first use of EWSNet as no model weights are provided with `EWSmethods`. The use of this function may also be necessary after finetuning to reset the model.


  weights_path = default_weights_path(),
  remove_weights = FALSE,
  auto = FALSE



A string naming the path to install model weights. Can be changed, but by default, attempts to add weights to the same location as the Python scripts bundled with EWSmethods.


Boolean. Should all weights be removed (TRUE) or should weights be re/downloaded (FALSE).


Boolean. If FALSE, asks permission to download model weights from Google Drive. If TRUE, no user confirmation is required for re/download.


No return value, called for side effects.


# \donttest{
# on first use of EWSNet via `EWSmethods`
ewsnet_reset(remove_weights = FALSE, auto = TRUE,
weights_path = tempfile())
#> Model weights downloaded
# }

# if this fails due to timeout, you may need to
# increase the timeout length using something
# like below:
# \donttest{
options(timeout = max(300, getOption("timeout")))
# }

# \donttest{
# to remove all downloaded weights
ewsnet_reset(remove_weights = TRUE, auto = TRUE,
weights_path = tempfile())
#> Model weights removed
# }