Skip to content

Progress bar fix for PF #457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pymc_extras/inference/pathfinder/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,6 @@ def bfgs_sample_sparse(
# (L, N, N), (L, N, M) -> (L, N, M)
+ sqrt_alpha_diag
@ (
# (L, N, 2J), (L, 2J, M) -> (L, N, M)
# intermediate calcs below
# (L, N, 2J), (L, 2J, 2J) -> (L, N, 2J)
(Q @ (Lchol - IdN))
# (L, 2J, N), (L, N, M) -> (L, 2J, M)
Expand Down Expand Up @@ -1565,8 +1563,9 @@ def multipath_pathfinder(
task,
description=desc.format(path_idx=path_idx),
completed=path_idx,
refresh=True,
)
# Ensure the progress bar visually reaches 100% and shows 'Completed'
progress.update(task, completed=num_paths, description="Completed")
except (KeyboardInterrupt, StopIteration) as e:
# if exception is raised here, MultiPathfinderResult will collect all the successful results and report the results. User is free to abort the process earlier and the results will still be collected and return az.InferenceData.
if isinstance(e, StopIteration):
Expand Down