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

Rename a_min and a_max to lower and upper and add them to Scalar init #536

Merged
merged 5 commits into from
Feb 25, 2020

Conversation

jrapin
Copy link
Contributor

@jrapin jrapin commented Feb 21, 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

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 CONTRIBUTING).
  • All tests passed, and additional code has been covered with new tests.

@jrapin jrapin requested a review from teytaud February 21, 2020 15:59
@jrapin jrapin self-assigned this Feb 21, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 21, 2020
super().__init__(init=np.array([init]), mutable_sigma=mutable_sigma)
if bounded:
self.set_mutation(sigma=(upper - lower) / 6) # type: ignore
Copy link
Contributor Author

@jrapin jrapin Feb 21, 2020

Choose a reason for hiding this comment

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

@teytaud
what do you think of these defaults for scalars, if both lower and upper bounds are provided:

  • sigma is set to a sixth of b - a (so that the full range is covered from start)
  • we also set full_range_sampling=True which means that parametrization.sample() will sample uniformly within the bounds ( this is used by some new algorithms)
  • if init is not provided, it is set it is set to the middle point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If neither or only one is provided, we are back to normal and the user need to use the Scalar methods to update sigma

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also forgot to mention, by default it's using clipping, but once again to use a different method one can set it manually through the set_bounds method

@jrapin jrapin merged commit 4ed9a70 into master Feb 25, 2020
@jrapin jrapin deleted the bounds branch February 25, 2020 17:12
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants