Skip to content
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

Disable progress bar, if not a TTY #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions neurobayes/deterministic_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def train(self, X_train: jnp.ndarray, y_train: jnp.ndarray, epochs: int, batch_s
y_batches = split_in_batches(y_train, batch_size)
num_batches = len(X_batches)

with tqdm(total=epochs, desc="Training Progress", leave=True) as pbar: # Progress bar tracks epochs now
with tqdm(total=epochs, desc="Training Progress", leave=True, disable=None) as pbar: # Progress bar tracks epochs now, but only with TTY
for epoch in range(epochs):
epoch_loss = 0.0
for i, (X_batch, y_batch) in enumerate(zip(X_batches, y_batches)):
Expand Down Expand Up @@ -140,4 +140,4 @@ def average_params(self) -> Dict:
lambda *param_trees: jnp.mean(jnp.stack(param_trees), axis=0),
*self.params_history
)
return avg_params
return avg_params