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

Weights and Biases Callback for Elegy #220

Merged
merged 39 commits into from
Mar 23, 2022
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6f2be70
feature: added wandb callback
soumik12345 Feb 14, 2022
3ba4ce3
chore: added WandbCallback import inside __init__.py
soumik12345 Feb 14, 2022
08808ea
chore: applied black
soumik12345 Feb 14, 2022
90c6b21
chore: added documentation for WandbCallback
soumik12345 Feb 14, 2022
1d7cedf
chore: updated wandb run initialization + added run finish on ending …
soumik12345 Feb 17, 2022
cb7fcf1
updated poetry dependencies
soumik12345 Feb 17, 2022
b7ff92c
updated run initialization in wandb callback
soumik12345 Feb 20, 2022
ebb945e
fixec wandb import
soumik12345 Feb 20, 2022
2d1210a
fixed on_train_end in wandb callback
soumik12345 Feb 20, 2022
aac79bd
added 'size' to ignore fields + added 'train' alias to train metrics
soumik12345 Feb 22, 2022
f423035
fix: wandb run keys
soumik12345 Feb 22, 2022
dfc2a3a
fix: updated run key names
soumik12345 Feb 22, 2022
cad4ae5
minor bug fix
soumik12345 Feb 22, 2022
90bacff
feature: instead of logging constant metrics step-wise, logs them to …
soumik12345 Feb 22, 2022
db07abe
updated wandb sun summary
soumik12345 Feb 22, 2022
40609df
updated configs
soumik12345 Feb 22, 2022
5e08aaf
updated callback
soumik12345 Feb 22, 2022
03bb72e
updated callback
soumik12345 Feb 22, 2022
d1abc88
added method to gather module attributes
soumik12345 Feb 22, 2022
0cf6479
fix: fixed minor bug in gathering model attributes
soumik12345 Feb 22, 2022
78d35e1
updated callback example
soumik12345 Feb 22, 2022
b21f38b
added train alias
soumik12345 Feb 22, 2022
3c8babc
Minor Bug Fix
soumik12345 Feb 22, 2022
10e177a
updated wandb callback signature
soumik12345 Feb 22, 2022
3f112b3
fixed typo
soumik12345 Feb 22, 2022
4d08a48
Added model checkpointing
soumik12345 Feb 22, 2022
8929139
updated checkpoint system
soumik12345 Feb 22, 2022
494942e
updated checkpoint logic
soumik12345 Feb 23, 2022
9522109
ipdated checkpoint system
soumik12345 Feb 23, 2022
f7dca2f
Merge pull request #1 from soumik12345/checkpoints
soumik12345 Feb 23, 2022
81c9383
made model checkpoint saving optional
soumik12345 Feb 23, 2022
9b609c9
updated checkpoint system to save artifacts every epoch
soumik12345 Feb 23, 2022
d5837d0
updated checkpoint system
soumik12345 Feb 23, 2022
f95db76
updated checkpoint system
soumik12345 Feb 23, 2022
9c4c42e
updated checkpoint system
soumik12345 Feb 23, 2022
03a57e9
updated checkpoint system
soumik12345 Feb 23, 2022
1cd7cfa
update deps
cgarciae Mar 23, 2022
af1ec99
Merge branch 'master' into pr/soumik12345/220
cgarciae Mar 23, 2022
8d45c2b
update lock
cgarciae Mar 23, 2022
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
Prev Previous commit
Next Next commit
chore: added documentation for WandbCallback
  • Loading branch information
soumik12345 committed Feb 14, 2022
commit 90c6b21462f8c27d68e86f5769175bfa2111c550
22 changes: 18 additions & 4 deletions elegy/callbacks/wandb_callback.py
Original file line number Diff line number Diff line change
@@ -12,15 +12,29 @@
class WandbCallback(Callback):
"""
Callback that streams epoch results to a [Weights & Biases](https://wandb.ai/) run.

```python
run = wandb.init(project="sample-wandb-project")
wandb_logger = WandbCallback(run=run)
model.fit(X_train, Y_train, callbacks=[wandb_logger])
```
"""

def __init__(
self, run: Union[None, wandb_run.Run], update_freq: Union[str, int] = "epoch"
self, run: wandb_run.Run, update_freq: Union[str, int] = "epoch"
):
"""
Arguments:
run: Weights and Biases Run of type `wandb.sdk.wandb_run.Run`. The Run
object can be initialized by invoking `wandb.init()`.
update_freq: `'batch'` or `'epoch'` or integer. When using `'batch'`,
writes the losses and metrics to TensorBoard after each batch. The same
applies for `'epoch'`. If using an integer, let's say `1000`, the
callback will write the metrics and losses to TensorBoard every 1000
batches. Note that writing too frequently to TensorBoard can slow down
your training.
"""
super().__init__()
assert (
run is not None
), "Weights and Biases run has not been initialilzed, please initialize a run using wandb.init()"
self.run = run
self.keys = None
self.write_per_batch = True