Skip to content

Commit 0a77a1e

Browse files
committed
Configurable gradient clipping to avoid exploding gradients
1 parent 9d84bef commit 0a77a1e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/electrai/entrypoints/train.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def train(args):
8383
devices=1,
8484
precision=cfg.model_precision,
8585
log_every_n_steps=1,
86+
gradient_clip_val=getattr(cfg, "gradient_clip_value", 1.0),
8687
)
8788

8889
# -----------------------------

0 commit comments

Comments
 (0)