spaCy/spacy/training
Madeesh Kannan 5ea14af32b
Add `training.before_update` callback (#11739)
* Add `training.before_update` callback

This callback can be used to implement training paradigms like gradual (un)freezing of components (e.g: the Transformer) after a certain number of training steps to mitigate catastrophic forgetting during fine-tuning.

* Fix type annotation, default config value

* Generalize arguments passed to the callback

* Update schema

* Pass `epoch` to callback, rename `current_step` to `step`

* Add test

* Simplify test

* Replace config string with `spacy.blank`

* Apply suggestions from code review

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>

* Cleanup imports

Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
2022-11-23 17:54:58 +01:00
..
converters Auto-format code with black (#10377) 2022-02-25 10:00:21 +01:00
__init__.pxd
__init__.py account for NER labels with a hyphen in the name (#10960) 2022-06-17 20:02:37 +01:00
align.pyx Fix alignment for 1-to-1 tokens and lowercasing (#6476) 2020-12-08 14:25:16 +08:00
alignment.py Alignment: use a simplified ragged type for performance (#10319) 2022-04-01 09:02:06 +02:00
alignment_array.pxd Alignment: use a simplified ragged type for performance (#10319) 2022-04-01 09:02:06 +02:00
alignment_array.pyx Backport parser/alignment optimizations from `feature/refactor-parser` (#10952) 2022-06-24 13:39:52 +02:00
augment.py Preserve missing entity annotation in augmenters (#11540) 2022-09-27 10:16:51 +02:00
batchers.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
callbacks.py 🏷 Add Mypy check to CI and ignore all existing Mypy errors (#9167) 2021-10-14 15:21:40 +02:00
corpus.py Auto-format code with black (#9664) 2021-11-12 10:00:03 +01:00
example.pxd Make a pre-check to speed up alignment cache (#6139) 2020-09-24 18:13:39 +02:00
example.pyx adding spans to doc_annotation in Example.to_dict (#11261) 2022-08-05 12:26:38 +02:00
gold_io.pyx Fix is_sent_start when converting from JSON (fix #7635) (#7655) 2021-04-08 18:24:52 +10:00
initialize.py Clean up warnings in the test suite (#11331) 2022-08-22 12:04:30 +02:00
iob_utils.py Preserve missing entity annotation in augmenters (#11540) 2022-09-27 10:16:51 +02:00
loggers.py Add ConsoleLogger.v2 (#11214) 2022-08-29 10:23:05 +02:00
loop.py Add `training.before_update` callback (#11739) 2022-11-23 17:54:58 +01:00
pretrain.py Clarify how to fill in init_tok2vec after pretraining (#9639) 2021-11-18 15:38:30 +01:00