theogf / AugmentedGaussianProcesses.jl

Gaussian Process package based on data augmentation, sparsity and natural gradients
https://theogf.github.io/AugmentedGaussianProcesses.jl/dev/
Other
134 stars 9 forks source link

Heteroscedastic model example fails #130

Open axsk opened 9 months ago

axsk commented 9 months ago

The Heteroscedastic model from the documentation fails for me on Julia 1.9.3, supposedly with some AD problem (Zygote version 0.6.64):

julia> train!(model, 100);
[ Info: Starting training Variational Gaussian Process with a Gaussian likelihood with heteroscedastic noise infered by Analytic Variational Inference  with 200 samples, 1 features and 2 latent GPs
ERROR: MethodError: objects of type AugmentedGaussianProcesses.GPPrior{TransformedKernel{ScaledKernel{SqExponentialKernel{Distances.Euclidean}, Float64}, ScaleTransform{Float64}}, ConstantMean{Float64, ADAM{Float64}}} are not callable
Stacktrace:
  [1] macro expansion
    @ ~/.julia/packages/Zygote/4SSHS/src/compiler/interface2.jl:101 [inlined]
  [2] _pullback(ctx::Zygote.Context{false}, f::AugmentedGaussianProcesses.GPPrior{TransformedKernel{ScaledKernel{SqExponentialKernel{Distances.Euclidean}, Float64}, ScaleTransform{Float64}}, ConstantMean{Float64, ADAM{Float64}}}, args::Float64)
    @ Zygote ~/.julia/packages/Zygote/4SSHS/src/compiler/interface2.jl:101
  [3] rrule_via_ad(::Zygote.ZygoteRuleConfig{Zygote.Context{false}}, ::AugmentedGaussianProcesses.GPPrior{TransformedKernel{ScaledKernel{SqExponentialKernel{Distances.Euclidean}, Float64}, ScaleTransform{Float64}}, ConstantMean{Float64, ADAM{Float64}}}, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Zygote ~/.julia/packages/Zygote/4SSHS/src/compiler/chainrules.jl:260
  [4] rrule_via_ad(::Zygote.ZygoteRuleConfig{Zygote.Context{false}}, ::AugmentedGaussianProcesses.GPPrior{TransformedKernel{ScaledKernel{SqExponentialKernel{Distances.Euclidean}, Float64}, ScaleTransform{Float64}}, ConstantMean{Float64, ADAM{Float64}}}, ::Vararg{Any})
theogf commented 9 months ago

Hey sorry for the late answer, was in vacation! This package is not maintained in favor in https://github.com/JuliaGaussianProcesses/AugmentedGPLikelihoods.jl.

Unfortunately the heteroscedastic model is not merged in yet you could still try the branch though (and I will try to refresh the pacakge a bit more)