Skip to content

Prepare release of 1.1.0 #1088

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

Merged
merged 2 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
### Changed
### Fixed

## [1.1.0]

### 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).
- 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
- 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

Expand Down Expand Up @@ -358,3 +365,4 @@ The 1.0.0 release of skorch is here. We think that skorch is at a very stable po
[0.14.0]: https://github.com/skorch-dev/skorch/compare/v0.13.0...v0.14.0
[0.15.0]: https://github.com/skorch-dev/skorch/compare/v0.14.0...v0.15.0
[1.0.0]: https://github.com/skorch-dev/skorch/compare/v0.15.0...v1.0.0
[1.1.0]: https://github.com/skorch-dev/skorch/compare/v1.0.0...v1.1.0
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1dev
1.1.0
35 changes: 0 additions & 35 deletions skorch/callbacks/scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,6 @@
__all__ = ['BatchScoring', 'EpochScoring', 'PassthroughScoring']


@contextmanager
def cache_net_infer(net, use_caching, y_preds):
"""Caching context for ``skorch.NeuralNet`` instance.

Returns a modified version of the net whose ``infer`` method will
subsequently return cached predictions. Leaving the context will
undo the overwrite of the ``infer`` method.

Deprecated.

"""
# TODO: remove this function

warnings.warn(
"cache_net_infer is no longer uesd to provide caching for "
"the scoring callbacks and will hence be removed in a "
"future release.",
DeprecationWarning,
)

if not use_caching:
yield net
return
y_preds = iter(y_preds)
net.infer = lambda *a, **kw: next(y_preds)

try:
yield net
finally:
# By setting net.infer we define an attribute `infer`
# that precedes the bound method `infer`. By deleting
# the entry from the attribute dict we undo this.
del net.__dict__['infer']


@contextmanager
def _cache_net_forward_iter(net, use_caching, y_preds):
"""Caching context for ``skorch.NeuralNet`` instance.
Expand Down
Loading