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

Extended IRPropMin with boundary support and methods to set min and max step size #1465

Merged
merged 6 commits into from
Aug 29, 2022

Conversation

MichaelClerx
Copy link
Member

@MichaelClerx MichaelClerx commented Aug 25, 2022

⬆️ that

The boundary support is non-standard and can cause you to get stuck if you have a problematic problem (i.e. gradient next to the boundaries pointing outside). But very useful if you need to avoid evaluating outside some range that causes errors...

@MichaelClerx MichaelClerx marked this pull request as ready for review August 25, 2022 12:21
@codecov
Copy link

codecov bot commented Aug 25, 2022

Codecov Report

Merging #1465 (d4ba352) into master (d72ca64) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #1465   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           97        97           
  Lines         9482      9532   +50     
=========================================
+ Hits          9482      9532   +50     
Impacted Files Coverage Δ
pints/_optimisers/_irpropmin.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@MichaelClerx MichaelClerx requested a review from DavAug August 25, 2022 15:53
@MichaelClerx
Copy link
Member Author

@DavAug maybe don't review just yet: I think i'll need to change the strategy for step-size shrinking with general boundaries

@MichaelClerx
Copy link
Member Author

OK ready now @DavAug

  • Added max step size
  • Added get/set for max & min step size, although default min step size still set with sigma0
  • Added boundary checks: for rectangular boundaries this is straightforward. For non-rectangular it's a bit weird: I first reduce all step sizes until the boundaries are OK. Then I try setting them all back to their original values again (one by one). The idea here is that if I need to reduce step sizes in dimensions 3, 7, and 8, then that will take me forever to find out if I start by trying to reduce just 1 step size, then all combinations of 2 step sizes, then all of 3. So this looks stupid but should work

@MichaelClerx
Copy link
Member Author

(The strategy is biased against parameters/dimensions with a lower indice: these will get reduced first (even if reducing another parameter would also have worked). I thought a bit about randomisation but that makes this a stochastic method and I don't want to go there. The bias shouldn't matter, I hope: as long as we get to the right solution in the end)

Copy link
Member

@DavAug DavAug left a comment

Choose a reason for hiding this comment

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

Thanks @MichaelClerx this looks very good! I have not reviewed everything yet, but I thought I leave some comments already. I'll have another look tomorrow 😊

pints/_optimisers/_irpropmin.py Show resolved Hide resolved
pints/_optimisers/_irpropmin.py Show resolved Hide resolved
pints/_optimisers/_irpropmin.py Show resolved Hide resolved
pints/_optimisers/_irpropmin.py Show resolved Hide resolved
pints/_optimisers/_irpropmin.py Show resolved Hide resolved
@MichaelClerx
Copy link
Member Author

Thanks!

Copy link
Member

@DavAug DavAug left a comment

Choose a reason for hiding this comment

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

Looks good @MichaelClerx ! I also think that the step size adjustment for non-rectangular boundaries feels a little clumsy and, as you said, there is definitely bias to move towards smaller index dimensions. But at the same time, I think this will only start to matter once we introduce more complicated boundaries than currently available in pints.

@MichaelClerx MichaelClerx merged commit 931d02b into master Aug 29, 2022
@MichaelClerx MichaelClerx deleted the rprop-bounds branch August 29, 2022 16:56
@MichaelClerx
Copy link
Member Author

Thanks @DavAug ! I've added the checks and merged it in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants