Skip to content

Commit

Permalink
Include a logging line for early dropout
Browse files Browse the repository at this point in the history
  • Loading branch information
AngledLuffa committed Dec 15, 2024
1 parent 56cd087 commit 751208a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stanza/models/constituency/parser_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ def iterate_training(args, trainer, train_trees, train_sequences, transitions, d
wandb.log({n: torch.linalg.norm(p)})

if args['early_dropout'] > 0 and trainer.epochs_trained >= args['early_dropout']:
if any(x > 0.0 for x in (trainer.model.word_dropout.p, trainer.model.predict_dropout.p, trainer.model.lstm_input_dropout.p)):
logger.info("Setting dropout to 0.0 at epoch %d", trainer.epochs_trained)
trainer.model.word_dropout.p = 0
trainer.model.predict_dropout.p = 0
trainer.model.lstm_input_dropout.p = 0
Expand Down

0 comments on commit 751208a

Please sign in to comment.