Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Retiarii] Weight-sharing trainers #3137

Merged
merged 9 commits into from
Dec 5, 2020

Conversation

ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Nov 29, 2020

This PR migrates old trainers in NNI v1.x to Retiarii framework. Will support the following trainers on Retiarii:

  • DartsTrainer
  • EnasTrainer
  • ProxylessTrainer
  • RandomTrainer/SinglePathTrainer

The trainers will implement the core ideas in the original paper, instead of faithfully implementing all the details in paper.

Examples will be updated correspondingly. Expects no change except the part where trainers got initiated and trained (changed to fit).

TODO:

  • Support sharing choice with same name in DARTS and ProxylessNAS.

@ultmaster ultmaster changed the base branch from master to dev-retiarii November 29, 2020 17:51
@ultmaster ultmaster marked this pull request as draft November 29, 2020 17:53
@ultmaster ultmaster marked this pull request as ready for review December 2, 2020 04:40
Comment on lines 55 to 57
sampled = self.input_choice.sampled
return out, torch.tensor([i == sampled or (isinstance(sampled, list) and i in sampled)
for i in range(len(self.input_choice))], dtype=torch.bool)
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic is complicated, why?

num_epochs = args.epochs or 150
mutator = enas.EnasMutator(model, tanh_constant=1.1, cell_exit_extra_step=True)
if args.v1:
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest to directly abandon v1

@ultmaster ultmaster merged commit 165756c into microsoft:dev-retiarii Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants