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 users to pass a float for constant learning rate #293

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

rlouf
Copy link
Member

@rlouf rlouf commented Sep 19, 2022

The current API requires user to pass a function of the index of the current iteration, even when the learning rate is constant. However, in practice most people use a constant learning rate (even if they shouldn't, but who are we to judge?) and we should simplify that pattern of use.

This commit thus allows users to pass either a function, either a float as learning rate to the kernel builder. It will raise an exception for any other type.

The current API requires user to pass a function of the index of the
current iteration, even when the learning rate is constant. However, in
practice most people use a constant learning rate (even if they
shouldn't, but who are we to judge?)  and we should simplify that
pattern of use.

This commit thus allows users to pass either a function, either a
float as learning rate to the kernel builder. It will raise an
exception for any other type.
@rlouf rlouf added the enhancement New feature or request label Sep 19, 2022
@codecov
Copy link

codecov bot commented Sep 19, 2022

Codecov Report

Merging #293 (7da2351) into main (8de405a) will decrease coverage by 0.09%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main     #293      +/-   ##
==========================================
- Coverage   98.79%   98.69%   -0.10%     
==========================================
  Files          46       46              
  Lines        1905     1917      +12     
==========================================
+ Hits         1882     1892      +10     
- Misses         23       25       +2     
Impacted Files Coverage Δ
blackjax/kernels.py 98.75% <85.71%> (-0.81%) ⬇️

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

@rlouf
Copy link
Member Author

rlouf commented Sep 19, 2022

codevoc is not catching the test cases that check that a TypeError is effectively being raised for some reason.

@rlouf rlouf merged commit ffbf011 into blackjax-devs:main Sep 19, 2022
@rlouf rlouf deleted the sgmcmc-constant-schedule branch September 19, 2022 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants