File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 47
47
$ python train.py
48
48
```
49
49
50
+ To record some of your experiments, just invoke ` wandb login ` first before modifying the training script
51
+
50
52
## Citations
51
53
52
54
``` bibtex
Original file line number Diff line number Diff line change 29
29
30
30
PROJECT_NAME = 'native-sparse-attention'
31
31
RUN_NAME = 'baseline' if not USE_SPARSE_ATTN else 'sparse-attn'
32
- WANDB_ONLINE = False # turn this on to pipe experiment to cloud
32
+ WANDB_ONLINE = True # turn this on to pipe experiment to cloud
33
33
34
34
# helpers
35
35
@@ -153,6 +153,7 @@ def __getitem__(self, index):
153
153
154
154
(loss / GRAD_ACCUM_EVERY ).backward ()
155
155
156
+ wandb .log (dict (loss = loss .item ()), step = i )
156
157
print (f"training loss: { loss .item ():.3f} " )
157
158
158
159
torch .nn .utils .clip_grad_norm_ (model .parameters (), 0.5 )
@@ -166,6 +167,7 @@ def __getitem__(self, index):
166
167
valid_data = next (val_loader )
167
168
168
169
loss = model (valid_data , return_loss = True )
170
+ wandb .log (dict (valid_loss = loss .item ()), step = i )
169
171
print (f"validation loss: { loss .item ():.3f} " )
170
172
171
173
if i % GENERATE_EVERY == 0 :
You can’t perform that action at this time.
0 commit comments