Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Implement sampling progress bar (#1534)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1534

In this diff:
We are implementing a progress bar for the sampling stage of bart_model.py and eliminating the print to stdout. See T125518201.

Reviewed By: horizon-blue

Differential Revision: D37702073

fbshipit-source-id: 1987fb7c72d9358ade247d0c3f621c8510b97ae6
  • Loading branch information
himaghna authored and facebook-github-bot committed Jul 8, 2022
1 parent f526416 commit 3e8c4b8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from beanmachine.ppl.experimental.causal_inference.models.bart.tree import Tree
from torch.distributions.gamma import Gamma
from torch.distributions.normal import Normal
from tqdm.auto import trange


class BART:
Expand Down Expand Up @@ -114,8 +115,7 @@ def fit(
self.samples = {"trees": [], "sigmas": []}
self._init_trees(X)

for iter_id in range(num_burn + num_samples):
print(f"Sampling iteration {iter_id}")
for iter_id in trange(num_burn + num_samples):
trees, sigma = self._step()
self._all_trees = trees
if iter_id >= num_burn:
Expand Down

0 comments on commit 3e8c4b8

Please sign in to comment.