Skip to content
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

UndefVarError: tempered not defined #134

Closed
vembha opened this issue Feb 17, 2022 · 1 comment
Closed

UndefVarError: tempered not defined #134

vembha opened this issue Feb 17, 2022 · 1 comment

Comments

@vembha
Copy link

vembha commented Feb 17, 2022

Hello. I am new to MCMCTempering.jl package and recently started using. As per the tutorial, I tried to use the function tempered(sampler, temperature_steps) with the default NUTS() sampler from Turing.jl. But it looks like I there is not function named tempered at all. There is one Tempered with the capital T, but when I use it, the sampler throws the following error:

ERROR: MethodError: no method matching make_tempered_model(::DynamicPPL.Model{typeof(truth_data_fitting!), (:data, :ODEtspan, :num_variants, :tot_pop, :interp_IPTCC, :interp_mobil), (), (), Tuple{DataFrame, Tuple{Float64, Float64}, Int64, Int64, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}}, Tuple{}, DynamicPPL.DefaultContext}, ::Float64)
Stacktrace:
[1] (::MCMCTempering.var"#5#6"{Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Random._GLOBAL_RNG, DynamicPPL.Model{typeof(truth_data_fitting!), (:data, :ODEtspan, :num_variants, :tot_pop, :interp_IPTCC, :interp_mobil), (), (), Tuple{DataFrame, Tuple{Float64, Float64}, Int64, Int64, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}},
Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}}, Tuple{}, DynamicPPL.DefaultContext}, TemperedSampler{NUTS{Turing.Essential.ForwardDiffAD{40}, (), DiagEuclideanMetric}}})(Δi::Int64)
@ MCMCTempering .\none:0
[2] iterate
@ .\generator.jl:47 [inlined]
[3] collect(itr::Base.Generator{Vector{Int64}, MCMCTempering.var"#5#6"{Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, Random._GLOBAL_RNG, DynamicPPL.Model{typeof(truth_data_fitting!), (:data, :ODEtspan, :num_variants, :tot_pop, :interp_IPTCC, :interp_mobil), (), (), Tuple{DataFrame, Tuple{Float64, Float64}, Int64, Int64, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}}, Tuple{}, DynamicPPL.DefaultContext}, TemperedSampler{NUTS{Turing.Essential.ForwardDiffAD{40}, (), DiagEuclideanMetric}}}})
@ Base .\array.jl:678
[4] step(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(truth_data_fitting!), (:data, :ODEtspan, :num_variants, :tot_pop, :interp_IPTCC, :interp_mobil), (), (), Tuple{DataFrame, Tuple{Float64, Float64}, Int64, Int64, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}}, Tuple{}, DynamicPPL.DefaultContext}, spl::TemperedSampler{NUTS{Turing.Essential.ForwardDiffAD{40}, (), DiagEuclideanMetric}}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ MCMCTempering C:\Users\Bharadwaj.julia\packages\MCMCTempering\ALY2z\src\stepping.jl:37
[5] step
@ C:\Users\Bharadwaj.julia\packages\MCMCTempering\ALY2z\src\stepping.jl:37 [inlined]
[6] macro expansion
@ C:\Users\Bharadwaj.julia\packages\AbstractMCMC\BPJCW\src\sample.jl:123 [inlined]
[7] macro expansion
@ C:\Users\Bharadwaj.julia\packages\ProgressLogging\6KXlp\src\ProgressLogging.jl:328 [inlined]
[8] macro expansion
@ C:\Users\Bharadwaj.julia\packages\AbstractMCMC\BPJCW\src\logging.jl:8 [inlined]
[9] mcmcsample(rng::Random._GLOBAL_RNG, model::DynamicPPL.Model{typeof(truth_data_fitting!), (:data, :ODEtspan, :num_variants, :tot_pop, :interp_IPTCC, :interp_mobil), (), (), Tuple{DataFrame, Tuple{Float64, Float64}, Int64, Int64, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}, Interpolations.BSplineInterpolation{Float64, 1, Vector{Float64}, BSpline{Linear{Throw{OnGrid}}}, Tuple{Base.OneTo{Int64}}}}, Tuple{}, DynamicPPL.DefaultContext}, sampler::TemperedSampler{NUTS{Turing.Essential.ForwardDiffAD{40}, (), DiagEuclideanMetric}}, N::Int64; progress::Bool, progressname::String, callback::Nothing, discard_initial::Int64, thinning::Int64, chain_type::Type, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ AbstractMCMC C:\Users\Bharadwaj.julia\packages\AbstractMCMC\BPJCW\src\sample.jl:114
[10] #sample#16
@ C:\Users\Bharadwaj.julia\packages\AbstractMCMC\BPJCW\src\sample.jl:36 [inlined]
[11] #sample#15
@ C:\Users\Bharadwaj.julia\packages\AbstractMCMC\BPJCW\src\sample.jl:21 [inlined]
[12] top-level scope
@ REPL[53]:1

Can someone help me out, please? Following are my packages on Windows 10:
Julia 1.6.2
[ce233488] MCMCTempering v0.1.1
[fce5fe82] Turing v0.20.1

@yebai
Copy link
Member

yebai commented Aug 2, 2023

Likely fixed now.

@yebai yebai closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants