-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
This tuner has been added as builtin tuners. |
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)] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
docs/en_US/NAS/classic_nas.rst
Outdated
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. |
There was a problem hiding this comment.
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.
e109c3c
to
11f375e
Compare
src/sdk/pynni/nni/regularized_evolution_tuner/regularized_evolution_tuner.py
Outdated
Show resolved
Hide resolved
self.history[parameter_id] = arch | ||
return arch | ||
elif self.population: | ||
sample = [] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 frompopulation
assample
(they remain inpopulation
) - choose the model with highest acc in sample
- mutate the model then send it & push to
population
after getting the result
src/sdk/pynni/nni/regularized_evolution_tuner/regularized_evolution_tuner.py
Show resolved
Hide resolved
src/sdk/pynni/nni/regularized_evolution_tuner/regularized_evolution_tuner.py
Show resolved
Hide resolved
docs/en_US/NAS/classic_nas.rst
Outdated
@@ -0,0 +1,11 @@ | |||
Classic NAS Algorithms |
There was a problem hiding this comment.
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 = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_from
-> _from_initial_population
No description provided.