spaCy/website/docs/usage
Daniël de Kok 5e297aa20e
Add TrainablePipe.{distill,get_teacher_student_loss} (#12016)
* Add `TrainablePipe.{distill,get_teacher_student_loss}`

This change adds two methods:

- `TrainablePipe::distill` which performs a training step of a
   student pipe on a teacher pipe, giving a batch of `Doc`s.
- `TrainablePipe::get_teacher_student_loss` computes the loss
  of a student relative to the teacher.

The `distill` or `get_teacher_student_loss` methods are also implemented
in the tagger, edit tree lemmatizer, and parser pipes, to enable
distillation in those pipes and as an example for other pipes.

* Fix stray `Beam` import

* Fix incorrect import

* Apply suggestions from code review

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* TrainablePipe.distill: use `Iterable[Example]`

* Add Pipe.is_distillable method

* Add `validate_distillation_examples`

This first calls `validate_examples` and then checks that the
student/teacher tokens are the same.

* Update distill documentation

* Add distill documentation for all pipes that support distillation

* Fix incorrect identifier

* Apply suggestions from code review

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Add comment to explain `is_distillable`

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2023-01-16 10:25:53 +01:00
..
101 Merge branch 'copy_master' into copy_v4 2023-01-11 18:40:55 +01:00
_benchmarks-models.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
embeddings-transformers.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
facts-figures.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
index.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
layers-architectures.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
linguistic-features.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
models.mdx Merge branch 'copy_master' into copy_v4 2023-01-11 18:40:55 +01:00
processing-pipelines.mdx Add TrainablePipe.{distill,get_teacher_student_loss} (#12016) 2023-01-16 10:25:53 +01:00
projects.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
rule-based-matching.mdx Merge branch 'copy_master' into copy_v4 2023-01-11 18:40:55 +01:00
saving-loading.mdx Merge branch 'copy_master' into copy_v4 2023-01-11 18:40:55 +01:00
spacy-101.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
training.mdx Merge branch 'copy_master' into copy_v4 2023-01-11 18:40:55 +01:00
v2-1.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v2-2.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v2-3.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v2.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v3-1.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v3-2.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v3-3.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v3-4.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
v3.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00
visualizers.mdx Website migration from Gatsby to Next (#12058) 2023-01-11 17:30:07 +01:00