Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducee random teacher layer sets #35

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

zhangzhenyu13
Copy link
Contributor

I find that a fixed teacher layer sets might not be a good choice for cofi;
so it would make the method more robust to introduce the random teacher sets selection.
refer this: [2109.10164] RAIL-KD: RAndom Intermediate Layer Mapping for Knowledge Distillation (arxiv.org)

add more version inspired by rail-kd
@xiamengzhou xiamengzhou merged commit 756f67b into princeton-nlp:main Nov 7, 2022
if self.additional_args.layer_distill_version > 4:
specified_teacher_layers = [i for i in range(12)]
if self.additional_args.layer_distill_version ==5:
specified_teacher_layers = sorted(random.sample(specified_teacher_layers, 4))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "random" module is not imported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, it is. Thanks.
People see this will import the module: random

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants