-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Update for latest ParameterSchedulers.jl release #1513
Conversation
The docs are fine, maybe just briefly mention what Unrelated to this PR: do we really need a wrapper around a scheduler to make it stateful? Cannot they just contain the counter, then allow either stateless or stateful behavior depending on the context? |
We could do it that way, but I think keeping the internal state in sync will get annoying/error-prone. Plus, I think Optimisers.jl will want everything to be immutable. Instead, I suggest that we do something like: Exp(args...; stateful=false) = Stateful(Exp(args...)) Default can be whatever we decide is most convenient. |
I'm growing to dislike more and more this whole functional/stateless story, makes everything more annoying and verbose without providing any clear advantage. Anyways, the convenience constructor seems fine. I will vote for |
do you want to update ParameterSchedulers first or merge this? |
Not to derail this too much, but I wouldn't care if ** if you look at code using JAX libraries and Optax, they're not shy about mutating hyperparams in the training loop either. Really the immutability requirement is more for anything that might have to run on an accelerator (and thus needs to be XLA friendly) |
FWIW, I didn't make the schedules immutable because of the whole Optimisers.jl story (if it were up to me we'd still have s = [lambda * gamma^(t - 1) for t in 1:total_iters] Then I tried to get something that behaved that way but without being so verbose. Since iterators in Julia are explicit state, this basically meant schedules would be explicit state. I'm biased because I don't use |
Let me do a patch release just to make sure the proposed syntax works. Then I'll update this to reflect it. |
@CarloLucibello I ended up just rephrasing the docs in the PR as originally planned. I wasn't happy with |
Thanks! bors r+ |
Build succeeded: |
Due to some finagling with #1506 and work on Optimisers.jl, I made some changes to the names/API of ParameterSchedulers.jl. This just updates the docs to reflect those names.
PR Checklist
Tests are addedEntry in NEWS.mdFinal review from@dhairyagandhi96
(for API changes).