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

Allow repetitions for Choice parameters #670

Merged
merged 12 commits into from
May 13, 2020
Merged

Allow repetitions for Choice parameters #670

merged 12 commits into from
May 13, 2020

Conversation

jrapin
Copy link
Contributor

@jrapin jrapin commented May 12, 2020

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context / Related issue

This seems a common scheme that could be handled more efficiently to scale better.

How Has This Been Tested (if it applies)

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CLA).
  • All tests passed, and additional code has been covered with new tests.

@jrapin jrapin self-assigned this May 12, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 12, 2020
@jrapin
Copy link
Contributor Author

jrapin commented May 12, 2020

30 times faster

In [16]: %cpaste -q
import time
import nevergrad as ng

t0 = time.time()
param = ng.p.Tuple(*[ng.p.Choice(range(64)) for _ in range(100000)])
param.mutate()
v = param.value
print("v1", time.time() - t0)

t0 = time.time()
param = ng.p.Choice(range(64), repetitions=100000)
param.mutate()
v = param.value
print("v2", time.time() - t0)
--
v1 104.45756006240845
v2 3.4510011672973633

@jrapin jrapin requested a review from danthe3rd May 13, 2020 09:38
@danthe3rd
Copy link
Contributor

danthe3rd commented May 13, 2020

30x faster

On how many CPUs? Can you also measure using a single CPU?

@jrapin
Copy link
Contributor Author

jrapin commented May 13, 2020

30x faster

On how many CPUs? Can you also measure using a single CPU?

This is on my macbook pro, there is no parallelization apart from the one that may be in numpy, i think it's 1 CPU then

@jrapin jrapin merged commit f32049e into master May 13, 2020
@jrapin jrapin deleted the reps branch May 13, 2020 14:46
@teytaud
Copy link
Contributor

teytaud commented May 13, 2020

Waow that one is really GREAT :-)

teytaud pushed a commit that referenced this pull request May 25, 2020
teytaud added a commit that referenced this pull request May 25, 2020
* firstMetaModel

* meta_model_for_shiva

* fix

* Type_fix:_.value_was_missing. Also better handling of exceptions.

* Tell not asked: I'm lost.

* Add recommendation.

* Add recommendation.

* Let us catch bad big values in metamodels.

* Deactivate BO test for windows

* Add metamodel in illcond tests.

* fixstaticanalysis

* Update optimizerlib.py

* updateMetaModel (#692)

* updateMetaModel

* Update optimizerlib.py

* Check suggest recommendation (#635)

* Add basic Pylint tests (#669)

* Allow repetitions for Choice parameters (#670)

* firstMetaModel

* meta_model_for_shiva

* Update post version number

* Fix repeated Choice hash (#676)

* fix

* Type_fix:_.value_was_missing. Also better handling of exceptions.

* Tell not asked: I'm lost.

* Add recommendation.

* Add recommendation.

* Let us catch bad big values in metamodels.

* Deactivate BO test for windows

* Add metamodel in illcond tests.

* fixstaticanalysis

* Lazy initialization in MLTuning (#673)

* Fix discrete mutation in dim 1 (#679)

Co-authored-by: Jeremy Rapin <[email protected]>
Co-authored-by: Teytaud <[email protected]>

* fix

* Add an experimental bouncing bounding method (#684)

* Add a tutorial for windows users (#688)

* Update optimizerlib.py

* updateMetaModel (#692)

* updateMetaModel

* Update optimizerlib.py

Co-authored-by: Jeremy Rapin <[email protected]>
Co-authored-by: Jérémy Rapin <[email protected]>
Co-authored-by: Fabien Teytaud <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Difficulty: High Priority: High Status: In Progess Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants