-
Notifications
You must be signed in to change notification settings - Fork 20
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
Deprecate implicit obsdim
keyword argument and improve tests
#264
Changes from 8 commits
98ca012
59004c0
6f27050
5706cbb
7db260f
d40d73f
50488b7
47e5851
e79cfc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,6 @@ function FiniteGP(f::AbstractGP, x::AbstractVector, σ²::Real=default_σ²) | |
return FiniteGP(f, x, Fill(σ², length(x))) | ||
end | ||
|
||
function FiniteGP( | ||
f::AbstractGP, X::AbstractMatrix, σ²=default_σ²; obsdim::Int=KernelFunctions.defaultobs | ||
) | ||
return FiniteGP(f, KernelFunctions.vec_of_vecs(X; obsdim=obsdim), σ²) | ||
end | ||
|
||
## conversions | ||
Base.convert(::Type{MvNormal}, f::FiniteGP) = MvNormal(mean_and_cov(f)...) | ||
function Base.convert(::Type{MvNormal{T}}, f::FiniteGP) where {T} | ||
|
@@ -36,6 +30,11 @@ end | |
Base.length(f::FiniteGP) = length(f.x) | ||
|
||
(f::AbstractGP)(x...) = FiniteGP(f, x...) | ||
function (f::AbstractGP)( | ||
X::AbstractMatrix, args...; obsdim::Union{Int,Nothing}=KernelFunctions.defaultobs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To capture all possible arguments (if someone decides to create some other internal |
||
) | ||
return f(KernelFunctions.vec_of_vecs(X; obsdim=obsdim), args...) | ||
end | ||
|
||
""" | ||
mean(fx::FiniteGP) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ using AbstractGPs | |
using AbstractGPs: | ||
AbstractGP, | ||
MeanFunction, | ||
FiniteGP, | ||
ConstMean, | ||
GP, | ||
ZeroMean, | ||
|
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.
Should it be
or is it done automatically?
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.
No, it isn't done automatically (and hence one can't change
obsdim
with the official API - but this is not tested either...). However, sinceFiniteGP
does not accept keyword arguments it is not really needed currently after applying the fixes and dispatches in this PR.