All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Improve efficiency of Hessian-vector product (PR)
1.7.1 - 2024-11-15
This patch extends the support of BackPACK's GGN-vector product to compute graphs where one parameter of the GGN is not used by explicitly materializing the zero tensors in the associated derivatives (PR).
1.7.0 - 2024-11-12
This version deprecates Python 3.8 and bumps the PyTorch dependency to
>=2.2.0
, allowing several internal clean-ups. We also move from a
setup.py
-based installation mechanism to pyproject.toml
.
- Tutorial explaining how to write second-order extensions for custom layers (PR, docs)
- Support
AdaptiveAvgPool{1,2,3}d
layers inDiagHessian
andBatchDiagHessian
extensions (PR)
- We will deprecate the
development
branch and from now on directly merge new features and fixes intomaster
- Deprecate Python 3.8 and PyTorch <2.2.0 (PR1, PR2)
- Move from
setup.py
topyproject.toml
(PR)
1.6.0 - 2023-06-26
With this patch, BackPACK supports torch==2.x
and deprecates python3.7
(PR). BackPACK now supports
BCEWithLogitsLoss
, and supports KFAC for N-dimensional (transpose)
convolutions.
- Example use case for
retain_graph
(PR) - Example for computing batched Jacobians (PR)
- Support
BCEWithLogitsLoss
- Extend
KFAC, KFLR, KFRA
to N-dimensional convolutions (and transpose convolutions) (blog post)
- Use correct imports on website code samples (PR)
- Update code to latest
black
andflake8
(PR) - Fix examples on splash page (PR)
- Abstract negative log-likelihood losses in core (PR)
- Implement second-order derivatives of
BCEWithLogitsLoss
(PR) - Implement optimized sampled gradients for
BCEWithLogitsLoss
(PR) - Use batch size 1 in KFAC tests for ResNets (PR)
- Test with PyTorch
1.9.0
and1.12.0
and make tests compatible (PR) - Use
unfoldNd
package - Fully-document utility functions for convolutions (PR)
- Make output shape of unfolded input of transpose convolution consistent with convolution case (PR)
- Fully-document
HBPConv2d
class (PR) - Fix support for PyTorch 1.13 (PR)
- Update linting and formatting to latest
black
,flake8
(PR)
1.5.2 - 2022-12-19
This patch adds support for torch>=1.13.0
to BackPACK.
1.5.1 - 2022-11-03
This patch fixes temporary compatibility issues with the latest PyTorch release.
- Circumvent compatibility issues with
torch==1.13.0
by requiring `torch<1.13.0`` (PR)
1.5.0 - 2022-02-15
This small release improves ResNet support of some second-order extensions and adds some more custom layers.
Thanks to @jabader97 for contributing to KFAC
.
KFAC
for ResNets modules (commit)- Custom modules for
{Batch}DiagGGN{Exact,MC}
,{Batch}DiagHessian
support forSqrtGGN{Exact,MC}
support for
- Automate PyPI release through GitHub action (commit)
- Add
KFAC
tests for linear layers to test suite (commit) - Update formatting to
black==22.1.0
(commit) - Add BackPACK logo to RTD (commit)
1.4.0 - 2021-11-12
This release ships many new features. Some rely on recent PyTorch functionality.
We now require torch>=1.9.0
.
Highlights:
- ResNets & RNNs: Thanks to @schaefertim for bringing basic support for RNNs (#16, tutorial) and ResNets (#14, tutorial)
SqrtGGN{Exact,MC}
extension: Symmetric factorization of the generalized Gauss-Newton/Fisher (see arXiv:2106.02624)- Sub-sampling: Allows for restricting BackPACK extensions to a sub-set of samples in the mini-batch (#12, tutorial)
- Converter functionality for basic support of ResNets and RNNs [PR1, PR2, PR3]
- New extensions:
- Module support:
Linear
: Support additional (more than 2) input dimensions [PR1, PR2]BatchNormNd
: Distinguish evaluation and training mode, support first-order extensions andDiagGGN{Exact,MC}
[#160, PR1, PR2]AdaptiveAvgPoolND
: Support first-order extensions andDiagGGN{Exact,MC}
[PR]RNN
: Support first-order extensions andDiagGGN{MC,Exact}
[PR1 PR2 PR3]LSTM
: Support first-order extensions andDiagGGN{MC,Exact}
[PR]CrossEntropyLoss
: Support additional (more than 2) input dimensions. [PR]Embedding
: Support first-order extensions andDiagGGN{MC,Exact}
[PR]
- Mini-batch sub-sampling
retain_graph
option forbackpack
context [PR]- Assume batch axis always first [PR]
- Deprecate
python3.6
, require at leastpython3.7
[PR]
- Use
full_backward_hook
fortorch>=1.9.0
[PR] - Core
- Extensions
- Tests
1.3.0 - 2021-06-16
Thanks to @sbharadwajj and @schaefertim for co-authoring many PRs shipped in this release.
- New extensions
- Support for more layers
([PR,
overview])
DiagGGN{Exact,MC}
extensionsDiagHessian
extensiongroup
argument of (transpose) convolutions
- Extension hook which allows to run code right after a BackPACK extension [PR, example]
- Context to disable BackPACK [PR]
- Tutorial how to extend custom modules [PR, example]
- (Experimental) Alternative convolution weight Jacobian with option to save memory [PR, example]
- Remove hooks that save input/output shapes. This probably resolves #97 [PR]
- Remove
DiagGGN
from API (useDiagGGNExact
instead). It was indented as abstract parent class forDiagGGNExact
andDiagGGNMC
[PR]
- CI
- Move tests from Travis to GitHub actions [PR, small fix]
- Test
DiagHessian
with new test suite [PR] - Test
DiagGGN
with new test suite, introduce 'light' and 'full' tests [PR1, PR2] - Fix
isort
[PR] - Add partial docstring checks [PR]
- Add docstrings to contribution guide lines [commit]
- Auto-format and lint examples [PR]
- Refactoring
- Core
1.2.0 - 2020-10-26
Thanks to @sbharadwajj for co-authoring many PRs shipped in this release.
- Deprecated
python3.5
, tested compatibility with PyTorch 1.6.0 [PR] - Support first-order extensions for
Conv1d
,Conv3d
,ConvTranspose1d
,ConvTranspose2d
,ConvTranspose3d
- New example: Backpropagating through BackPACK quantities [commit]
- New extensions in API: Block-diagonal curvature products
- Add missing
zero_grad
in the diagonal GGN second-order optimization example [PR]
- Increased test coverage
- Implemented derivatives of the following operations in
backpack.core
- Refactor
firstorder
extensions to share more code [PR1, PR2] - Removed
detach
s to support differentiating through quantities [PR]
1.1.1 - 2020-04-29
- Improved documentation, moved to ReadTheDocs [PR1, PR2, PR3]
- Tested compatibility with PyTorch 1.5.0.
- Support 2nd-order backprop for vectors in
MSELoss
[PR] - Sanity checks to raise warnings if the following are used.
inplace
modification [PR], unsupported loss parameters [PR], custom losses in 2nd-order backpropagation [PR]
- Removed
opt_einsum
dependency [PR] - Missing implementations and wrong backpropagation of KFRA
for
Conv2d
,MaxPool2d
, andAvgPool2d
[PR] - Remove
try_view
and usereshape
to use PyTorch 1.4.0 improvements [PR]
- Docstring style [PR]
1.1.0 - 2020-02-11
- Fixed documentation issue in
Batch l2
[PR] - Added support for stride parameter in Conv2d [Issue, PR]
- Pytorch
1.3.0
compatibility [PR, PR]
- Added continuous integration [PR], test coverage [PR], style guide enforcement [PR]
- Changed internal shape conventions of backpropagated quantities for performance improvements [PR]
1.0.1 - 2019-09-05
- Fixed PyPI installaton
1.0.0 - 2019-10-03
Initial release