f-dangel/curvlinops
소개
PyTorch linear operators for curvature matrices (Hessian, Fisher/GGN, KFAC, ...)
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Linear Operators for Curvature Matrices in PyTorch
This library provides linear operators---a unified interface for matrix-free computation---for deep learning curvature matrices in PyTorch.
curvlinops is inspired by SciPy's sparse.linalg.LinearOperator interface and implements a PyTorch version.
You can read our position paper to know more about why combining linear operators with curvature matrices might be a good idea.
Main features:
Broad support of curvature matrices.
curvlinopssupports many common curvature matrices and approximations thereof, such as the Hessian, Fisher, generalized Gauss-Newton, and K-FAC (overview, visual tour).Unified interface. All linear operators share the same interface, making it easy to switch between curvature matrices. The linear operator interface also allows for seamless integration with other linop-based libraries, such as
skerch(example).Purely PyTorch. All computations can run on a GPU.
SciPy export. You can export a
curvlinopslinear operator to a SciPyLinearOperatorwith.to_scipy(). This allows plugging it intoscipy, while carrying out the heavy lifting (matrix-vector multiplies) in PyTorch on GPU. My favorite example isscipy.sparse.linalg.eigshthat lets you compute a subset of eigen-pairs (example).Randomized estimation algorithms.
curvlinopsoffers functionality to estimate properties the matrix represented by a linear operators, like its spectral density (example), and inverse (example). For trace and diagonal estimation, useskerch(example).
Installation
pip install curvlinops-for-pytorch
Useful Links
Documentation: https://curvlinops.readthedocs.io/en/latest/
Bug reports & feature requests: https://github.com/f-dangel/curvlinops/issues
Citation
If you find curvlinops useful for your work, consider citing our position paper
@article{dangel2025position,
title = {Position: Curvature Matrices Should Be Democratized via Linear
Operators},
author = {Dangel, Felix and Eschenhagen, Runa and Ormaniec, Weronika and
Fernandez, Andres and Tatzel, Lukas and Kristiadi, Agustinus},
journal = {arXiv 2501.19183},
year = 2025,
}
Future ideas
Refactor the back-end for curvature-matrix multiplication into pure functions to improve recycle-ability and ease the use of
torch.compile(see PR #285 for current status).Multi-GPU support.
Include more curvature matrices
- E.g. the GGN's hierarchical decomposition
Logo mage credits
- PyTorch logo: https://github.com/soumith, CC BY-SA 4.0, via Wikimedia Commons
관련 프로젝트 살펴보기
불러오는 중…