Skip to content

Commit c9847a8

Browse files
authored
docs: clarify pbar in accept_reject sampler with batched conditions (#1493)
1 parent 6ea16be commit c9847a8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sbi/samplers/rejection/rejection.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,6 @@ def accept_reject_sample(
253253

254254
# Progress bar can be skipped, e.g. when sampling after each round just for
255255
# logging.
256-
pbar = tqdm(
257-
disable=not show_progress_bars,
258-
total=num_samples,
259-
desc=f"Drawing {num_samples} posterior samples",
260-
)
261256
if proposal_sampling_kwargs is None:
262257
proposal_sampling_kwargs = {}
263258

@@ -269,6 +264,12 @@ def accept_reject_sample(
269264
if "condition" in proposal_sampling_kwargs:
270265
num_xos = proposal_sampling_kwargs["condition"].shape[0]
271266

267+
pbar = tqdm(
268+
disable=not show_progress_bars,
269+
total=num_samples,
270+
desc=f"Drawing {num_samples} posterior samples for {num_xos} observations",
271+
)
272+
272273
accepted = [[] for _ in range(num_xos)]
273274
acceptance_rate = torch.full((num_xos,), float("Nan"))
274275
leakage_warning_raised = False

0 commit comments

Comments
 (0)