Notebook for Learning Rate Scheduler#1074
Notebook for Learning Rate Scheduler#1074BenjaminBossan merged 16 commits intoskorch-dev:masterfrom ParagEkbote:notebook-for-learning-rate-scheduler
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR. I haven't done an in-depth review yet but the first impression is already quite good.
Before proceeding, I have a few points, could you please take a look?
- Right now, the notebook starts with
pip install .... We typically have a check if the notebook runs in a colab environment and only run the installs there (also, with a link to open the notebook in colab). E.g. check out this notebook. Could you please copy the approach? - Right now, you apply the
StandardScalerdirectly on the data. How about creating an sklearnPipelinewith theStandardScaleras the first step and the neural net as the 2nd? That would be a bit cleaner IMO. - You can remove the
if __name__ == "__main__":part. - Regarding the visualization, we have a
simulatemethod inLRScheduler. Maybe that can be used instead of having to implementLRHistoryCallback. - Could you please add an entry to the notebook/README.md and to the CHANGES.md?
|
I have modified the notebook, and markdown files as per the suggested changes. Here's a summary:
Could you please review the changes? |
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thanks a lot for the updates. I have added some comments, please take a look.
|
Could you please review the updated changes? |
|
Could you please review the updated changes? |
BenjaminBossan
left a comment
There was a problem hiding this comment.
Sorry for the delay. I reviewed the PR again and added a few comments. One change is blocked by a new PR, so I'd say let's wait for that PR first. Please take a look.
add new training method for rate scheduler.
|
I have addressed the mentioned comments. Could you please review the updated changes? cc: @BenjaminBossan |
|
Could you please review the updated changes? cc: @BenjaminBossan |
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thanks so much for the updates. I went through the notebook again and found only a few small things I'd like to be adjusted. Please check my comments.
|
I have addressed the mentioned comments. Could you please review the updated changes? cc: @BenjaminBossan |
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thanks for making the final changes, the notebook looks great, well done.
|
Thank you for assigning me the issue and being a patient guide. Could you please see that #1025 gets closed to declutter? cc: @BenjaminBossan |
|
Thanks for the reminder! |
Please welcome skorch 1.1.0 - a smaller release with a few fixes, a new notebook showcasing learning rate schedulers and mainly support for scikit-learn 1.6.0. Full list of changes: ### Added - Added a [notebook](https://github.com/skorch-dev/skorch/blob/master/notebooks/Learning_Rate_Scheduler.ipynb) that shows how to use Learning Rate Scheduler in skorch.(#1074) ### Changed - All neural net classes now inherit from sklearn's [`BaseEstimator`](https://scikit-learn.org/stable/modules/generated/sklearn.base.BaseEstimator.html). This is to support compatibility with sklearn 1.6.0 and above. Classification models additionally inherit from [`ClassifierMixin`](https://scikit-learn.org/stable/modules/generated/sklearn.base.ClassifierMixin.html) and regressors from [`RegressorMixin`](https://scikit-learn.org/stable/modules/generated/sklearn.base.RegressorMixin.html). (#1078) - When using the `ReduceLROnPlateau` learning rate scheduler, we now record the learning rate in the net history (`net.history[:, 'event_lr']` by default). It is now also possible to to step per batch, not only by epoch (#1075) - The learning rate scheduler `.simulate()` method now supports adding step args which is useful when simulation policies such as `ReduceLROnPlateau` which expect metrics to base their schedule on. (#1077) - Removed deprecated `skorch.callbacks.scoring.cache_net_infer` (#1088) ### Fixed - Fix an issue with using `NeuralNetBinaryClassifier` with `torch.compile` (#1058)
As described in #275, I've created a notebook that shows the visualization of the learning rate schedulers using the custom scheduler callback method in skorch.
Please let me know if any improvements are needed and I will make the necessary changes.
Fixes #275
cc: @BenjaminBossan