helmholtz-analytics / heat

Distributed tensors and Machine Learning framework with GPU and MPI acceleration in Python
https://heat.readthedocs.io/
MIT License
210 stars 53 forks source link

implement `linalg.cholesky` #886

Open mtar opened 3 years ago

mtar commented 3 years ago

Feature functionality computes the cholesky decomposition Intended scope:

Additional context

https://numpy.org/doc/stable/reference/generated/numpy.linalg.cholesky.html https://pytorch.org/docs/stable/generated/torch.linalg.cholesky.html https://data-apis.org/array-api/latest/extensions/linear_algebra_functions.html?#linalg-cholesky-x-upper-false

After obtaining a triangular matrix by Cholesky, one often uses triangular solvers #1096

mrfh92 commented 10 months ago

My suggestion: implement "standard" Cholesky (see, e.g., https://en.wikipedia.org/wiki/Cholesky_decomposition) but block-wise using PyTorch for the blocks; in this sense, the formulas from wikipedia can be used but the $L{i,j}$'s and $A{i,j}$'s are blocks (i.e. matrices) instead of numbers. Of course, dividing by some $L{i,i}$ has now to be replaced by applying the matrix-inverse of $L{i,i}$ (by triangular solve in PyTorch) etc. ...