I’m working on a model that involves a Fourier transform, and I’m running the limits of my julia debugging ability
I’m using this AbstractFFTs PR to try to get it working with the ForwardDiff backend. (Zygote fails with what I think is an unrelated issue that has to due with MvNormal, but I haven’t pursued it that hard.)
This MWE model fails with the forwarddiff backend, complaining about (I think?) the type conversion for FFTW. (I actually want to model both the real and complex components of the FFT output, but I don’t think it’s relevant to the MWE)
using Pkg
Pkg.add("Turing")
Pkg.add("FFTW")
Pkg.add(url="https://github.com/devmotion/AbstractFFTs.jl", rev = "dw/chainrules")
using FFTW
using Turing
using Distributions
using LinearAlgebra
using AbstractFFTs
# MWE model with a fourier transform
@model function fftmodel(x, y)
mu ~ Normal(0, 1)
q = fft(mu .+ x)
y ~ MvNormal(real.(q), 0.1)
return y
end
x = rand(10)
y = fft(3.0 .+ x)
chain = sample(fftmodel(x, real.(y)) , NUTS(0.65), 1000)
here is the traceback:
type ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1} not supported
- error (::String)@ error.jl:33
- _fftfloat (::Type{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}})@ definitions.jl:22
- _fftfloat (::ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1})@ definitions.jl:23
- fftfloat (::ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1})@ definitions.jl:18
- complexfloat (::Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}})@ definitions.jl:31
- fft (::Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, ::UnitRange{Int64})@ definitions.jl:198
- (::Main.workspace18.var"#fftmodel#1")(::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.ThreadSafeVarInfo{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Base.RefValue{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}}}, ::DynamicPPL.SamplingContext{DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG}, ::Vector{Float64}, ::Vector{Float64})@ *[Local: 6]
- macro expansion @ model.jl:465 [inlined]
- _evaluate (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.ThreadSafeVarInfo{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Base.RefValue{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}}}, ::DynamicPPL.SamplingContext{DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG})@ model.jl:448
- evaluate_threadsafe (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, ::DynamicPPL.SamplingContext{DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG})@ model.jl:438
- (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext})(::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, ::DynamicPPL.SamplingContext{DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext, Random._GLOBAL_RNG})@ model.jl:391
- (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext})(::Random._GLOBAL_RNG, ::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, ::DynamicPPL.DefaultContext)@ model.jl:383
- (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext})(::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, Vector{Set{DynamicPPL.Selector}}}}}, ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}, ::Vararg{Any, N} where N)@ model.jl:396
- (::Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext})(::Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}})@ ad.jl:111
- vector_mode_dual_eval! (::Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}}, ::Vector{Float64})@ apiutils.jl:37
- vector_mode_gradient! (::Vector{Float64}, ::Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, ::Vector{Float64}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}})@ gradient.jl:113
- gradient! (::Vector{Float64}, ::Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, ::Vector{Float64}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}}, ::Val{true})@ gradient.jl:37
- gradient! (::Vector{Float64}, ::Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, ::Vector{Float64}, ::ForwardDiff.GradientConfig{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1, Vector{ForwardDiff.Dual{ForwardDiff.Tag{Turing.Core.var"#f#1"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.DefaultContext}, Float64}, Float64, 1}}})@ gradient.jl:35
- gradient_logp (::Turing.Core.ForwardDiffAD{40}, ::Vector{Float64}, ::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, ::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, ::DynamicPPL.DefaultContext)@ ad.jl:121
::AdvancedHMC.Hamiltonian{AdvancedHMC.DiagEuclideanMetric{Float64, Vector{Float64}}, Turing.Inference.var"#logπ#52"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}}, Turing.Inference.var"#∂logπ∂θ#51"{DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64}, DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}}})@ hamiltonian.jl:153- var"#initialstep#41" (::Nothing, ::Int64, ::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(DynamicPPL.initialstep), ::Random._GLOBAL_RNG, ::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, ::DynamicPPL.TypedVarInfo{NamedTuple{(:mu,), Tuple{DynamicPPL.Metadata{Dict{AbstractPPL.VarName{:mu, Tuple{}}, Int64}, Vector{Distributions.Normal{Float64}}, Vector{AbstractPPL.VarName{:mu, Tuple{}}}, Vector{Float64}, Vector{Set{DynamicPPL.Selector}}}}}, Float64})@ hmc.jl:167
- var"#step#17" (::Nothing, ::Base.Iterators.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}}, ::typeof(AbstractMCMC.step), ::Random._GLOBAL_RNG, ::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}})@ sampler.jl:87
- var"#mcmcsample#20" (::Bool, ::String, ::Nothing, ::Int64, ::Int64, ::Type, ::Base.Iterators.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:nadapts,), Tuple{Int64}}}, ::typeof(AbstractMCMC.mcmcsample), ::Random._GLOBAL_RNG, ::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, ::Int64)@ sample.jl:114
- var"#sample#40" (::Type, ::Nothing, ::Bool, ::Int64, ::Bool, ::Int64, ::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(StatsBase.sample), ::Random._GLOBAL_RNG, ::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::DynamicPPL.Sampler{Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}}, ::Int64)@ hmc.jl:133
- sample (::DynamicPPL.Model{Main.workspace18.var"#fftmodel#1", (:x, :y), (), (), Tuple{Vector{Float64}, Vector{Float64}}, Tuple{}, DynamicPPL.DefaultContext}, ::Turing.Inference.NUTS{Turing.Core.ForwardDiffAD{40}, (), AdvancedHMC.DiagEuclideanMetric}, ::Int64)@ Inference.jl:132
Any pointers?
version info:
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.6.0)
CPU: Intel(R) Core™ i7-4770HQ CPU @ 2.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, haswell)
Environment:
JULIA_NUM_THREADS = 4
JULIA_REVISE_WORKER_ONLY = 1