Closed RalphAS closed 1 year ago
Here is a reduced case which throws the error:
using LinearAlgebra
using AbstractGPs
using Stheno
using Zygote
function build_gp(θ)
return @gppp let
fbb1 = θ[2] * stretch(GP(SEKernel()), θ[3])
end
end
function trial()
n1 = 50
ftrue(x) = exp(-x^2)
x1 = randn(n1)
err1 = 0.01 * randn(n1)
x = BlockData(GPPPInput(:fbb1, x1))
y = ftrue.(x1) + err1
function build_obs_cov(θ)
var1 = θ[1]
return Diagonal(fill(var1,n1))
end
function nlml(θ)
fm = build_gp(θ)
C = build_obs_cov(θ)
loss = -logpdf(fm(x, C), y)
return loss
end
θ0 = ones(3)
val, grad = Zygote.withgradient(nlml, θ0)
end
trial()
Resolved by #244
While trying to run the Mauna Loa CO2 example I encountered a missing method for the pullback because somewhere a
BlockArray{UpperTriangular}
is differentiated: