Skip to content

Commit

Permalink
fix tolerance update
Browse files Browse the repository at this point in the history
  • Loading branch information
saracoco committed Jan 15, 2025
1 parent 6492b5a commit d6a9ef4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/fit_variational_h.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ fit_variational_h <- function(input_data, max_attempts = 2, initialization = NUL

retries <- 0

tol_rel_obj <- tolerance

while (!fit_successful && retries < 3) { # Set a max number of retries for each attempt
message("Retries ", retries, " of ", 3)

# Increment total_attempts at the start of each retry
total_attempts <- total_attempts + 1


result <- tryCatch({
# Attempt variational inference
print(list(initialization))
Expand Down

0 comments on commit d6a9ef4

Please sign in to comment.