Skip to content

Commit 6008085

Browse files
authored
Release 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 - 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)
1 parent f239d8a commit 6008085

File tree

3 files changed

+11
-38
lines changed

3 files changed

+11
-38
lines changed

CHANGES.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Added
10+
### Changed
11+
### Fixed
12+
13+
## [1.1.0]
914

1015
### Added
1116

1217
- 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)
1318

1419
### Changed
1520

16-
- 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).
17-
- 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
21+
- 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)
22+
- 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)
23+
- 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)
24+
- Removed deprecated `skorch.callbacks.scoring.cache_net_infer` (#1088)
1825

1926
### Fixed
2027

@@ -358,3 +365,4 @@ The 1.0.0 release of skorch is here. We think that skorch is at a very stable po
358365
[0.14.0]: https://github.com/skorch-dev/skorch/compare/v0.13.0...v0.14.0
359366
[0.15.0]: https://github.com/skorch-dev/skorch/compare/v0.14.0...v0.15.0
360367
[1.0.0]: https://github.com/skorch-dev/skorch/compare/v0.15.0...v1.0.0
368+
[1.1.0]: https://github.com/skorch-dev/skorch/compare/v1.0.0...v1.1.0

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1dev
1+
1.1.0

skorch/callbacks/scoring.py

-35
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,6 @@
2222
__all__ = ['BatchScoring', 'EpochScoring', 'PassthroughScoring']
2323

2424

25-
@contextmanager
26-
def cache_net_infer(net, use_caching, y_preds):
27-
"""Caching context for ``skorch.NeuralNet`` instance.
28-
29-
Returns a modified version of the net whose ``infer`` method will
30-
subsequently return cached predictions. Leaving the context will
31-
undo the overwrite of the ``infer`` method.
32-
33-
Deprecated.
34-
35-
"""
36-
# TODO: remove this function
37-
38-
warnings.warn(
39-
"cache_net_infer is no longer uesd to provide caching for "
40-
"the scoring callbacks and will hence be removed in a "
41-
"future release.",
42-
DeprecationWarning,
43-
)
44-
45-
if not use_caching:
46-
yield net
47-
return
48-
y_preds = iter(y_preds)
49-
net.infer = lambda *a, **kw: next(y_preds)
50-
51-
try:
52-
yield net
53-
finally:
54-
# By setting net.infer we define an attribute `infer`
55-
# that precedes the bound method `infer`. By deleting
56-
# the entry from the attribute dict we undo this.
57-
del net.__dict__['infer']
58-
59-
6025
@contextmanager
6126
def _cache_net_forward_iter(net, use_caching, y_preds):
6227
"""Caching context for ``skorch.NeuralNet`` instance.

0 commit comments

Comments
 (0)