Releases: skorch-dev/skorch
v1.3.1
v1.3.0
Version 1.3.0
This is just a small release, with the main addition being support for the sklearn __sklearn_is_fitted__ protocol and some updates for new Python and PyTorch versions.
What's Changed
- Release fixes by @githubnemo in #1117
- Custom sklearn estimators implementing
__sklearn_is_fitted__by @divakaivan in #1119 - Update Python (3.13) and PyTorch (2.9) versions by @BenjaminBossan in #1121
- Release 1.3.0 by @BenjaminBossan in #1124
New Contributors
- @divakaivan made their first contribution in #1119
Full Changelog: v1.2.0...v1.3.0
v1.2.0
Version 1.2.0
This is a smaller release, most changes concern examples and development and thus don't affect users of skorch.
Changed
- Loading of skorch nets using pickle: When unpickling a skorch net, you may come across a PyTorch warning that goes: "FutureWarning: You are using torch.load with weights_only=False [...]"; to avoid this warning, pickle the net again and use the new pickle file (#1092)
Added
- Add Contributing Guidelines for skorch. (#1097)
- Add an example of hyper-parameter optimization using Optuna here (#1098)
- Add Example for Streaming Dataset(#1105)
- Add pyproject.toml to Improve CI/CD and Tooling (#1108)
Thanks @raphaelrubrice, @omahs, and @ParagEkbote for their contributions.
Full Changelog: v1.1.0...v1.2.0
Version 1.1.0
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
Changed
- All neural net classes now inherit from sklearn's
BaseEstimator. This is to support compatibility with sklearn 1.6.0 and above. Classification models additionally inherit fromClassifierMixinand regressors fromRegressorMixin. (#1078) - When using the
ReduceLROnPlateaulearning 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 asReduceLROnPlateauwhich expect metrics to base their schedule on. (#1077) - Removed deprecated
skorch.callbacks.scoring.cache_net_infer(#1088)
Fixed
- Fix an issue with using
NeuralNetBinaryClassifierwithtorch.compile(#1058)
Thanks @Ball-Man and @ParagEkbote for their contributions.
Version 1.0.0
The 1.0.0 release of skorch is here. We think that skorch is at a very stable point, which is why a 1.0.0 release is appropriate. There are no plans to add any breaking changes or major revisions in the future. Instead, our focus now is to keep skorch up-to-date with the latest versions of PyTorch and scikit-learn, and to fix any bugs that may arise.
Find the list of full changes here: v0.15.0...v1.0.0
Version 0.15.0
This is a smaller release, but it still contains changes which will be interesting to some of you.
We added the possibility to store weights using safetensors. This can have several advantages, listed here. When calling net.save_params and net.load_params, just pass use_safetensors=True to use safetensors instead of pickle.
Moreover, there is a new argument on NeuralNet: You can now pass use_caching=False or True to disable or enable caching for all callbacks at once. This is useful if you have a lot of scoring callbacks and don't want to toggle caching on each individually.
Finally, we fixed a few issues related to using skorch with accelerate.
Thanks Zach Mueller (@muellerzr) for his first contribution to skorch.
Find the full list of changes here: v0.14.0...v0.15.0
Version 0.14.0
This release offers a new interface for scikit-learn to do zero-shot and few-shot classification using open source large language models (Jump right into the example notebook).
skorch.llm.ZeroShotClassifier and skorch.llm.FewShotClassifier allow the user to do classification using open-source language models that are compatible with the huggingface generation interface. This allows you to do all sort of interesting things in your pipelines. From simply plugging a LLM into your classification pipeline to get preliminary results quickly, to using these classifiers to generate training data candidates for downstream models. This is a first draft of the interface, therefore it is not unlikely that the interface will change a bit in the future, so please, let us know about any potential issues you have.
Other items of this release are
- the drop of Python 3.7 support - this version of Python has reached EOL and will not be supported anymore
- the
NeptuneLoggernow logs the skorch version thanks to @AleksanderWWW NeuralNetRegressorcan now be fitted with 1-dimensionaly, which is necessary in some specific circumstances (e.g. in conjunction with sklearn'sBaggingRegressor, see #972); for this to work correctly, the output of the of the PyTorch module should also be 1-dimensional; the existing default, i.e. havingyandy_predbe 2-dimensional, remains the recommended way of usingNeuralNetRegressor
Full Changelog: v0.13.0...v0.14.0
Version 0.13.0
The new skorch release is here and it has some changes that will be exiting for some users.
- First of all, you may have heard of the PyTorch 2.0 release, which includes the option to compile the PyTorch module for better runtime performance. This skorch release allows you to pass
compile=Truewhen initializing the net to enable compilation. - Support for training on multiple GPUs with the help of the
acceleratepackage has been improved by fixing some bugs and providing a dedicated history class. Our documentation contains more information on what to consider when training on multiple GPUs. - If you have ever been frustrated with your neural net not training properly, you know how hard it can be to discover the underlying issue. Using the new
SkorchDoctorclass will simplify the diagnosis of underlying issues. Take a look at the accompanying notebook.
Apart from that, a few bugs have been fixed and the included notebooks have been updated to properly install requirements on Google Colab.
We are grateful for external contributors, many thanks to:
- Kshiteej K (@kshitij12345)
- Muhammad Abdullah (@abdulasiraj)
- Royi (@RoyiAvital)
- Sawradip Saha (@sawradip)
- y10ab1 (@y10ab1)
Find below the list of all changes since v0.12.1 below:
Added
- Add support for compiled PyTorch modules using the
torch.compilefunction, introduced in PyTorch 2.0 release, which can greatly improve performance on new GPU architectures; to use it, initialize your net with thecompile=Trueargument, further compilation arguments can be specified using the dunder notation, e.g.compile__dynamic=True - Add a class
DistributedHistorywhich should be used when training in a multi GPU setting (#955) SkorchDoctor: A helper class that assists in understanding and debugging the neural net training, see this notebook (#912)- When using
AccelerateMixin, it is now possible to prevent unwrapping of the modules by settingunwrap_after_train=True(#963)
Fixed
- Fixed install command to work with recent changes in Google Colab (#928)
- Fixed a couple of bugs related to using non-default modules and criteria (#927)
- Fixed a bug when using
AccelerateMixinin a multi-GPU setup (#947) _get_param_namesreturns a list instead of a generator so that subsequent error messages return useful information instead of a generatorreprstring (#925)- Fixed a bug that caused modules to not be sufficiently unwrapped at the end of training when using
AccelerateMixin, which could prevent them from being pickleable (#963)
Version 0.12.1
This is a small release which consists mostly of a couple of bug fixes. The standout feature here is the update of the NeptuneLogger, which makes it work with the latest Neptune client versions and adds many useful features, check it out. Big thanks to @twolodzko and colleagues for this update.
Here is the list of all changes:
Version 0.12.0
We're pleased to announce a new skorch release, bringing new features that might interest you.
The main changes relate to better integration with the Hugging Face ecosystem:
- Benefit from faster training and inference times thanks to easy integration with accelerate via skorch's
AccelerateMixin. - Better integration of tokenizers via skorch's
HuggingfaceTokenizerandHuggingfacePretrainedTokenizer; you can even put Hugging Face tokenizers into an sklearnPipelineand perform a grid search to find the best tokenizer hyperparameters. - Automatically upload model checkpoints to Hugging Face Hub via skorch's
HfHubStorage. - Check out this notebook to see how to use skorch and Hugging Face together.
But this is not all. We have added the possibility to load the best model parameters at the end of training when using the EarlyStopping callback. We also added the possibility to remove unneeded attributes from the net after training when it is intended to be only used for prediction by calling the trim_for_prediction method. Moreover, we now show how to use skorch with PyTorch Geometric in this notebook.
As always, this release was made possible by outside contributors. Many thanks to:
- Alan deLevie (@adelevie)
- Cédric Rommel (@cedricrommel)
- Florian Pinault (@floriankrb)
- @terminator-ger
- Timo Kaufmann (@timokau)
- @TrellixVulnTeam
Find below the list of all changes:
Added
- Added
load_bestattribute toEarlyStoppingcallback to automatically load module weights of the best result at the end of training - Added a method,
trim_for_prediction, on the net classes, which trims the net from everything not required for using it for prediction; call this after fitting to reduce the size of the net - Added experimental support for huggingface accelerate; use the provided mixin class to add advanced training capabilities provided by the accelerate library to skorch
- Add integration for Huggingface tokenizers; use
skorch.hf.HuggingfaceTokenizerto train a Huggingface tokenizer on your custom data; useskorch.hf.HuggingfacePretrainedTokenizerto load a pre-trained Huggingface tokenizer - Added support for creating model checkpoints on Hugging Face Hub using
HfHubStorage - Added a notebook that shows how to use skorch with PyTorch Geometric (#863)
Changed
- The minimum required scikit-learn version has been bumped to 0.22.0
- Initialize data loaders for training and validation dataset once per fit call instead of once per epoch (migration guide)
- It is now possible to call
np.asarraywithSliceDatasets (#858)
Fixed
- Fix a bug in
SliceDatasetthat prevented it to be used withto_numpy(#858) - Fix a bug that occurred when loading a net that has device set to None (#876)
- Fix a bug that in some cases could prevent loading a net that was trained with CUDA without CUDA
- Enable skorch to work on M1/M2 Apple MacBooks (#884)