Skip to content

Commit

Permalink
More accurate message when torch is diverging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien-mva authored Apr 11, 2024
1 parent 2744eb1 commit 1728944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/PLNfit-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ PLNfit <- R6Class(

## Error message if objective diverges
if (!is.finite(loss$item())) {
stop(sprintf("The ELBO diverged during the optimization procedure.\nConsider using:\n* a different optimizer (current optimizer: %s)\n* a smaller learning rate (current rate: %.3f)\nwith `control = PLN_param(config_optim = list(algorithm = ..., lr = ...))`",
stop(sprintf("The ELBO diverged during the optimization procedure.\nConsider using:\n* a different optimizer (current optimizer: %s)\n* a smaller learning rate (current rate: %.3f)\nwith `control = PLN_param(backend = "torch", config_optim = list(algorithm = ..., lr = ...))`",
config$algorithm, config$lr))
}

Expand Down

0 comments on commit 1728944

Please sign in to comment.