-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ENH: add exponentiation of a covariance function with a scalar #3852
ENH: add exponentiation of a covariance function with a scalar #3852
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3852 +/- ##
==========================================
+ Coverage 90.45% 90.47% +0.02%
==========================================
Files 133 135 +2
Lines 20564 21246 +682
==========================================
+ Hits 18601 19223 +622
- Misses 1963 2023 +60
|
Why have the travis tests not started yet? |
pymc3/gp/cov.py
Outdated
@@ -34,6 +36,7 @@ | |||
"Coregion", | |||
"ScaledCov", | |||
"Kron", | |||
"Exponentiated", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Exponentiated
isn't necessarily user-facing because you added __pow__
, it probably shouldn't be included in __all__
.
pymc3/gp/cov.py
Outdated
@@ -117,6 +136,19 @@ def __array_wrap__(self, result): | |||
raise RuntimeError | |||
|
|||
|
|||
class Exponentiated(Covariance): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this down to be near Add
and Prod
? (very small nitpick, since it's more like a Combination
covariance than a base covariance)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Maybe you could add a very brief example to the docs so this functionality can be discovered? https://docs.pymc.io/notebooks/GP-MeansAndCovs.html
Tests look perfect.
Thanks for the review @bwengals. Noticed that there were no examples exclusively for combinations of kernels so I went ahead and added all of them. I hope they are good to go! |
Nice, yeah I support merging now |
Thanks @tirthasheshpatel! |
pymc-devs#3852 adds the new feature to the V3.8 changelog while it should go in the V3.9 changelog.
* move change from V3.8 to V3.9 #3852 adds the new feature to the V3.8 changelog while it should go in the V3.9 changelog. * fix small typo * move the change a little down in the changelog
This PR adds functionality to the
pm.gp.cov
module. Now, a covariance function can be exponentiated with a scalar.Changes:
Exponentiated
class for kernels that are exponentiated with a scalar.__pow__
in covariance base class to support exponentiation for all the covariance functions