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

Algebraic Operations on Functions #725

Merged

Conversation

marvinpfoertner
Copy link
Collaborator

@marvinpfoertner marvinpfoertner commented Aug 31, 2022

In a Nutshell

This PR implements addition and scalar multiplication on Functions.

This is a proposal for how to redesign all algebraic structures in ProbNum.

Detailed Description

  • Function + Function
  • ScalarLike * Function
  • leverages functools.singledispatchmethod to register the correct result for combinations of different function types

Related Issues

None

@marvinpfoertner marvinpfoertner added the improvement Improvements of existing functionality label Aug 31, 2022
@marvinpfoertner marvinpfoertner self-assigned this Aug 31, 2022
@codecov
Copy link

codecov bot commented Aug 31, 2022

Codecov Report

Merging #725 (f73f3a4) into main (e2a46b0) will increase coverage by 0.14%.
The diff coverage is 93.60%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #725      +/-   ##
==========================================
+ Coverage   90.12%   90.27%   +0.14%     
==========================================
  Files         194      197       +3     
  Lines        7353     7445      +92     
  Branches     1163     1154       -9     
==========================================
+ Hits         6627     6721      +94     
- Misses        486      487       +1     
+ Partials      240      237       -3     
Impacted Files Coverage Δ
src/probnum/__init__.py 100.00% <ø> (ø)
src/probnum/functions/_zero.py 83.33% <77.77%> (ø)
src/probnum/functions/_algebra_fallbacks.py 88.67% <88.67%> (ø)
src/probnum/functions/__init__.py 100.00% <100.00%> (ø)
src/probnum/functions/_algebra.py 100.00% <100.00%> (ø)
src/probnum/functions/_function.py 96.61% <100.00%> (ø)
src/probnum/randprocs/__init__.py 100.00% <100.00%> (ø)
src/probnum/randprocs/_gaussian_process.py 100.00% <100.00%> (ø)
src/probnum/randprocs/_random_process.py 92.20% <100.00%> (ø)
src/probnum/randprocs/markov/_markov.py 87.50% <100.00%> (ø)
... and 4 more

@JonathanWenger JonathanWenger self-requested a review August 31, 2022 15:04
@JonathanWenger JonathanWenger self-assigned this Aug 31, 2022
@marvinpfoertner marvinpfoertner marked this pull request as ready for review August 31, 2022 15:36
Copy link
Contributor

@JonathanWenger JonathanWenger left a comment

Choose a reason for hiding this comment

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

Looks great! Just a few clarification questions, but otherwise good to go. Thanks 🙏!

docs/source/api.rst Outdated Show resolved Hide resolved
src/probnum/functions/_algebra.py Outdated Show resolved Hide resolved
src/probnum/functions/_algebra_fallbacks.py Outdated Show resolved Hide resolved
src/probnum/functions/_algebra_fallbacks.py Outdated Show resolved Hide resolved
src/probnum/functions/_zero.py Show resolved Hide resolved
tests/test_functions/test_algebra.py Show resolved Hide resolved
marvinpfoertner and others added 5 commits August 31, 2022 19:43
Co-authored-by: Jonathan Wenger <jonathan.wenger@uni-tuebingen.de>
Co-authored-by: Jonathan Wenger <jonathan.wenger@uni-tuebingen.de>
@marvinpfoertner marvinpfoertner merged commit c9957f3 into probabilistic-numerics:main Sep 1, 2022
@marvinpfoertner marvinpfoertner deleted the function-algebra branch September 1, 2022 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvements of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants