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

Querying ZeroCost predictor in Supported Optimizers #139

Open
jr2021 opened this issue Oct 24, 2022 · 0 comments
Open

Querying ZeroCost predictor in Supported Optimizers #139

jr2021 opened this issue Oct 24, 2022 · 0 comments
Assignees
Labels
zero cost merge Merge of zerocost with Develop into Develop_copy

Comments

@jr2021
Copy link
Collaborator

jr2021 commented Oct 24, 2022

A problem occurs in the Bananas optimizer, when an architecture outside of the search space is sampled, and the zero_cost_scores must be calculated on-the-fly using the ZeroCost

Exception has occurred: StopIteration
exception: no description
  File "/home/jhaa/NASLib/naslib/predictors/utils/pruners/measures/model_stats.py", line 7, in get_model_stats
    model_stats = tw.ModelStats(model, input_tensor_shape,
  File "/home/jhaa/NASLib/naslib/predictors/utils/pruners/predictive.py", line 141, in find_measures
    model_stats = get_model_stats(
  File "/home/jhaa/NASLib/naslib/predictors/zerocost.py", line 31, in query
    score = predictive.find_measures(
  File "/home/jhaa/NASLib/naslib/optimizers/discrete/bananas/optimizer.py", line 93, in query_zc_scores
    score = zc_method.query(arch, dataloader=zc_method.train_loader)
  File "/home/jhaa/NASLib/naslib/optimizers/discrete/bananas/optimizer.py", line 241, in _get_best_candidates
    model.zc_scores = self.query_zc_scores(model.arch)
  File "/home/jhaa/NASLib/naslib/optimizers/discrete/bananas/optimizer.py", line 232, in new_epoch
    self.next_batch = self._get_best_candidates(candidates, acq_fn)
  File "/home/jhaa/NASLib/naslib/defaults/trainer.py", line 112, in search
    self.optimizer.new_epoch(e)
  File "/home/jhaa/NASLib/naslib/runners/bbo/runner.py", line 75, in <module>
    trainer.search(resume_from="", summary_writer=writer, report_incumbent=False)

Currently, we are passing model.arch into the zc_method.query() function. This differs slightly from the Fall-School Tutorial, where a graph is being initialized, an architecture is being sampled, the graph is being parsed and then the graph object is being passed in.

@jr2021 jr2021 added the zero cost merge Merge of zerocost with Develop into Develop_copy label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zero cost merge Merge of zerocost with Develop into Develop_copy
Projects
None yet
Development

No branches or pull requests

3 participants