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

Conversation

schmidtjonathan
Copy link
Collaborator

@schmidtjonathan schmidtjonathan commented Jul 28, 2021

In a Nutshell

Add (efficient) arithmetics for combinations of Linear Operators : Part 1

Detailed Description

For some combinations of linear operators, there exist known arithmetics that can be implemented more efficiently.
E.g. Kronecker @ Kronecker ~~> Kronecker instead of yielding a ProductLinearOperator that builds up large call stacks.

Related Issues

#509 ; mitigates the described problem in parts. (Subsequent PRs will consecutively solve the issue)

@schmidtjonathan schmidtjonathan added feature request Requests for features to be implemented improvement Improvements of existing functionality labels Jul 28, 2021
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #505 (ac2c5e0) into main (2e4153c) will increase coverage by 0.57%.
The diff coverage is 87.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #505      +/-   ##
==========================================
+ Coverage   88.49%   89.06%   +0.57%     
==========================================
  Files         175      176       +1     
  Lines        6301     6612     +311     
  Branches      805      881      +76     
==========================================
+ Hits         5576     5889     +313     
+ Misses        501      485      -16     
- Partials      224      238      +14     
Impacted Files Coverage Δ
src/probnum/_config.py 100.00% <ø> (ø)
src/probnum/randvars/_constant.py 86.00% <ø> (ø)
...probnum/randprocs/markov/integrator/_integrator.py 89.18% <33.33%> (-10.82%) ⬇️
src/probnum/randvars/_normal.py 81.77% <50.00%> (+0.08%) ⬆️
src/probnum/linops/_scaling.py 82.05% <71.42%> (+0.23%) ⬆️
src/probnum/linops/_linear_operator.py 83.22% <76.36%> (+0.82%) ⬆️
src/probnum/linops/_kronecker.py 86.89% <89.47%> (+0.89%) ⬆️
src/probnum/linops/_arithmetic_fallbacks.py 92.85% <92.85%> (ø)
src/probnum/linops/_arithmetic.py 92.38% <94.01%> (+22.21%) ⬆️
src/probnum/linops/__init__.py 100.00% <100.00%> (ø)
... and 10 more

Copy link
Collaborator

@marvinpfoertner marvinpfoertner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Let's discuss some details on monday.

Since we have Zeros now, could you also add the

...
elif self._scalar == 0:
    ...

case in the constructor of Scaling?

src/probnum/_config.py Outdated Show resolved Hide resolved
src/probnum/typing.py Show resolved Hide resolved
src/probnum/linops/_arithmetic.py Outdated Show resolved Hide resolved
src/probnum/linops/_arithmetic.py Show resolved Hide resolved
src/probnum/linops/_arithmetic.py Show resolved Hide resolved
src/probnum/linops/_linear_operator.py Show resolved Hide resolved
src/probnum/linops/_scaling.py Outdated Show resolved Hide resolved
src/probnum/linops/_scaling.py Outdated Show resolved Hide resolved
src/probnum/randvars/_normal.py Show resolved Hide resolved
@marvinpfoertner marvinpfoertner self-assigned this Aug 15, 2021
@marvinpfoertner
Copy link
Collaborator

The PR can't be merged because patch coverage is slightly too low.
From my POV we can merge this anyway, since test coverage did improve significantly in the linop modules.
@JonathanWenger @pnkraemer can you merge this?

@JonathanWenger JonathanWenger merged commit b6d2e48 into probabilistic-numerics:main Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for features to be implemented improvement Improvements of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants