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

[tuner] Regularized Evolution #2802

Merged
merged 37 commits into from
Oct 10, 2020
Merged

Conversation

tabVersion
Copy link
Contributor

No description provided.

@tabVersion tabVersion marked this pull request as ready for review August 22, 2020 02:10
@tabVersion
Copy link
Contributor Author

tabVersion commented Aug 22, 2020

TODO: add to builtin.
I do not know how to make it a builtin tuner in the experiment config file.


This tuner has been added as builtin tuners.

@tabVersion
Copy link
Contributor Author

Tuner behavior should be adjusted to be consistent with #2695 .

n_chosen = val['_value']['n_chosen']
if n_chosen == None:
raise RuntimeError('Key n_chosen must be set in InputChoice.')
idxs = [random.randint(0, len(candidates) - 1) for _ in range(n_chosen)]
Copy link
Contributor

Choose a reason for hiding this comment

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

This could generate duplicate models.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if all models are evaluated? Are random models generated or throwing a NO_MORE_TRIAL exception?

Classic NAS Algorithms
=======================

Classic NAS algorithms use a controller to ensemble a model from search space. The classic tuner algorithms train one model each time and use the reward of the model to guide the latter models. NNI has supported many popular classic NAS algorithms as following.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part may need refactoring.

@QuanluZhang QuanluZhang mentioned this pull request Sep 23, 2020
79 tasks
@QuanluZhang QuanluZhang changed the title evo nas tuner [tuner] Regularized Evolution Sep 23, 2020
src/sdk/pynni/nni/__init__.pye Outdated Show resolved Hide resolved
self.history[parameter_id] = arch
return arch
elif self.population:
sample = []
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the logic here is:

  • Find a candidate from a candidate pool, which is actually a queue with size population_size.
  • Mutate the candidate, send it.
  • Receive the result of candidate, push it into candidate pool.

It's not evolution that I remember, which is conducted in "batch", i.e., a candidate of models are sent and received, then produce a new batch of candidates.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, it is a little different here.
Every time to generate a new model after warmup:

  • randomly select sample_size models from population as sample (they remain in population)
  • choose the model with highest acc in sample
  • mutate the model then send it & push to population after getting the result

docs/en_US/NAS/RegularizedEvolutionTuner.md Outdated Show resolved Hide resolved
src/sdk/pynni/tests/test_classic_nas.py Outdated Show resolved Hide resolved
@@ -0,0 +1,11 @@
Classic NAS Algorithms
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this file and put the content in RegularizedEvolutionTuner.md to ClassicNas.md

self.population = deque()
self.history = {}
self.search_space = None
self._from = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

_from -> _from_initial_population

@QuanluZhang QuanluZhang merged commit 8d3f444 into microsoft:master Oct 10, 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.

4 participants