STOR-i / GaussianProcesses.jl

A Julia package for Gaussian Processes
https://stor-i.github.io/GaussianProcesses.jl/latest/
Other
308 stars 53 forks source link

Missing KernelData for ElasticCovStrat? #155

Closed baggepinnen closed 4 years ago

baggepinnen commented 4 years ago

I have a GP with

debug> gp.covstrat
GaussianProcesses.ElasticCovStrat(1000, 1000)

Inside

update!(model::GPE{X,Y,M,K,P,D}, x, y)

the following fit! function is called

function fit!(gp::GPE{X,Y}, x::X, y::Y) where {X,Y}
    length(y) == size(x,2) || throw(ArgumentError("Input and output observations must have consistent dimensions."))
    gp.x = x
    gp.y = y
    gp.data = KernelData(gp.kernel, x, x, gp.covstrat)
    gp.cK = alloc_cK(gp.covstrat, length(y))
    gp.dim, gp.nobs = size(x)
    initialise_target!(gp)
end

which calls KernelData and tries to asssign that into gp.data. Since there is no KernelData method that accepts ElasticCovStrat, it hits this method

KernelData(k::Kernel, X1::AbstractMatrix, X2::AbstractMatrix, covstrat::CovarianceStrategy) = EmptyData()

and the returned EmptyData cannot be converted to the correct type.

ERROR: MethodError: Cannot `convert` an object of type 
  GaussianProcesses.StationaryARDData{Array{Float64,3}} to an object of type 
  GaussianProcesses.StationaryARDData{ElasticPDMats.AllElasticArray{Float64,3}}
jbrea commented 4 years ago

Are you referring to the update! function of BayesianOptimization? I think this commit should have fixed the issue... Which versions are you using?

baggepinnen commented 4 years ago

It appears that you are right, I must have been screwing up when trying to update my dependencies. Sorry for the noise :(