Skip to content
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

LinOp arithmetic part 1 #505

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
c24b0ef
Scaling arithmetic
schmidtjonathan Jul 26, 2021
c18e51a
Kronecker arithmetic
schmidtjonathan Jul 26, 2021
4e5d5b6
Identity arithmetic, outsource fallbacks
schmidtjonathan Jul 26, 2021
9b6884d
Fix pylint
schmidtjonathan Jul 26, 2021
92270d5
Kronecker distributive law
schmidtjonathan Jul 28, 2021
d65d7bd
Kronecker shape mismatch raises
schmidtjonathan Jul 28, 2021
c9ad290
Dense matrix matrix product
schmidtjonathan Jul 28, 2021
53e7b51
Add new ops to arithmetic
schmidtjonathan Jul 28, 2021
0e09886
Scalar Identity arithmetic
schmidtjonathan Jul 28, 2021
813c7f7
Scalar scaling arithmetic
schmidtjonathan Jul 28, 2021
4b2ac0f
rmult for scalar Kronecker
schmidtjonathan Jul 28, 2021
f59d37d
Equality for Scaling
schmidtjonathan Jul 28, 2021
1190b76
Equality
schmidtjonathan Jul 28, 2021
9861def
Fix pylint issues
schmidtjonathan Jul 29, 2021
c77c5f0
Zero LinOp
schmidtjonathan Jul 29, 2021
ec23359
Selection LinOp
schmidtjonathan Jul 29, 2021
52db4b3
Zero and Selection arithmetic
schmidtjonathan Jul 29, 2021
2516f94
Allow kronecker cov for vector-valued normal rvs
schmidtjonathan Jul 29, 2021
3cab34d
Use zero linop in constant
schmidtjonathan Jul 29, 2021
f58b951
Remove stupid case from kronecker
schmidtjonathan Jul 29, 2021
9fc34f7
Fix arithmetic
schmidtjonathan Jul 29, 2021
350c58d
Selection Embedding
schmidtjonathan Jul 30, 2021
3a605bf
Add NotImplementedType
schmidtjonathan Jul 30, 2021
4f9ef15
Advances in arithmetics
schmidtjonathan Jul 30, 2021
2ee287f
Matrix arithmetics
schmidtjonathan Aug 2, 2021
760160a
Remove obsolete function stub
schmidtjonathan Aug 2, 2021
ab24687
Fix pylint issues
schmidtjonathan Aug 2, 2021
ab2d9ad
Fix some ToDo's
schmidtjonathan Aug 2, 2021
9da5bbb
Add switch for matrix-matrix products in LinOps
schmidtjonathan Aug 2, 2021
31ebf33
Add IdentityKronecker operator
schmidtjonathan Aug 2, 2021
97597bb
Fix normal rv addition test
schmidtjonathan Aug 3, 2021
d63eeb1
Rename config options according to decision
schmidtjonathan Aug 10, 2021
5b7aad2
Fix IdentityKronecker arithmetics
schmidtjonathan Aug 10, 2021
0338560
Half-baked arithmetics tests
schmidtjonathan Aug 10, 2021
ec7f7ae
Trigger build
schmidtjonathan Aug 10, 2021
e3977c5
Remove mul for Kronecker
schmidtjonathan Aug 11, 2021
b0e2d96
Improve tests for linop arithmetics
schmidtjonathan Aug 11, 2021
3e9f10d
Fix pylint issues
schmidtjonathan Aug 11, 2021
817baa0
Choose neutral ground for scalar times kronecker
schmidtjonathan Aug 11, 2021
dcbe5bf
Add coverage
schmidtjonathan Aug 11, 2021
63f614f
Fix wrong is_scalar = False in Scaling
schmidtjonathan Aug 11, 2021
b0c0ba5
Check isotropic scaling
schmidtjonathan Aug 11, 2021
2660027
Fix tests
schmidtjonathan Aug 12, 2021
8d076ca
Check failure cases as well
schmidtjonathan Aug 12, 2021
3697552
Improve kronecker matmul
schmidtjonathan Aug 12, 2021
56990d6
Adapt tests
schmidtjonathan Aug 12, 2021
41fe141
Add test for selection and embedding
schmidtjonathan Aug 12, 2021
c8f83bd
Use lambda expr in scalar matrix mult
schmidtjonathan Aug 12, 2021
e079aea
Extended config option test
schmidtjonathan Aug 12, 2021
c5e1272
Test arithmetic fallbacks
schmidtjonathan Aug 12, 2021
34ac9e6
Now build.
schmidtjonathan Aug 12, 2021
f362ba6
Fix pylint
schmidtjonathan Aug 12, 2021
b9a27df
Cover Kronecker distributive
schmidtjonathan Aug 12, 2021
0447cdb
Add matrix free IWP transition tests
schmidtjonathan Aug 12, 2021
10b4877
Fix embedding matmul and add tests
schmidtjonathan Aug 12, 2021
b7f1a7f
Test scaling inequality
schmidtjonathan Aug 12, 2021
373dd2f
Extend tests
schmidtjonathan Aug 12, 2021
78d3698
Fix pylint
schmidtjonathan Aug 12, 2021
5963565
Stabilize tests
schmidtjonathan Aug 12, 2021
2d8024c
Test IdentityKronecker
schmidtjonathan Aug 12, 2021
316533b
Add restructured text to config docs
schmidtjonathan Nov 18, 2021
f01c8c8
Handle mult with negative scalars
schmidtjonathan Nov 18, 2021
dfdc9d0
Replace isscalar by ndim == 0
schmidtjonathan Nov 18, 2021
8495c9c
Replace "scalar" by numbers.Number
schmidtjonathan Nov 18, 2021
580ee8c
Nevermind...
schmidtjonathan Nov 18, 2021
a6542fb
Incoroporate PR comments
schmidtjonathan Nov 18, 2021
9d69385
Remove remaining matrix_free_linalg
schmidtjonathan Nov 18, 2021
ce071e9
Fix docs
schmidtjonathan Nov 18, 2021
0391203
pylint
schmidtjonathan Nov 18, 2021
92fbda2
Fix tests ("scalar")
schmidtjonathan Nov 18, 2021
a220f9b
Fix small error
schmidtjonathan Nov 18, 2021
7cb002d
Fix pylint part 2
schmidtjonathan Nov 18, 2021
50fd28e
pylint part 3
schmidtjonathan Nov 18, 2021
ac2c5e0
PYLIIIIINT part 4
schmidtjonathan Nov 18, 2021
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
13 changes: 11 additions & 2 deletions src/probnum/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,19 @@ def register(self, key: str, default_value: Any, description: str) -> None:
"matrix_free",
False,
(
"If True, wherever possible, LinearOperators are used instead "
"of arrays. LinearOperators define a matrix-vector product implicitly without instantiating the full matrix in memory. This makes them memory- and runtime-efficient for linear algebra operations."
"If ``True``, wherever possible, ``LinearOperator`` s are used instead "
"of arrays. ``LinearOperator`` s define a matrix-vector product implicitly without "
"instantiating the full matrix in memory. This makes them memory- and runtime-efficient "
"for linear algebra operations."
),
),
(
"lazy_matrix_matrix_matmul",
False,
"If ``True``, the matmul operation applied to two ``Matrix``-``LinearOperator`` s will "
"again yield a ``Matrix``-``LinearOperator`` with the computed matrix-matrix product,"
" instead of a ``ProductLinearOperator``.",
),
]

# ... and register the default configuration options.
Expand Down
14 changes: 11 additions & 3 deletions src/probnum/linops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,38 @@
:class:`~probnum.linops.LinearOperator` instances.
"""

from ._kronecker import Kronecker, SymmetricKronecker, Symmetrize
from ._linear_operator import Identity, LinearOperator, Matrix
from ._scaling import Scaling
from ._kronecker import IdentityKronecker, Kronecker, SymmetricKronecker, Symmetrize
from ._linear_operator import Embedding, Identity, LinearOperator, Matrix, Selection
from ._scaling import Scaling, Zero
from ._utils import LinearOperatorLike, aslinop

# Public classes and functions. Order is reflected in documentation.
__all__ = [
"aslinop",
"Embedding",
"LinearOperator",
"Matrix",
"Identity",
"IdentityKronecker",
"Scaling",
"Kronecker",
"Selection",
"SymmetricKronecker",
"Symmetrize",
"Zero",
]

# Set correct module paths. Corrects links and module paths in documentation.
LinearOperator.__module__ = "probnum.linops"
Embedding.__module__ = "probnum.linops"
Matrix.__module__ = "probnum.linops"
Identity.__module__ = "probnum.linops"
IdentityKronecker.__module__ = "probnum.linops"
Scaling.__module__ = "probnum.linops"
Kronecker.__module__ = "probnum.linops"
Selection.__module__ = "probnum.linops"
SymmetricKronecker.__module__ = "probnum.linops"
Symmetrize.__module__ = "probnum.linops"
Zero.__module__ = "probnum.linops"

aslinop.__module__ = "probnum.linops"
Loading