-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update turing_inference to accommodate Turing's updated syntax. #46
Comments
Sure, I will update Turing-related codes. |
That would be a great help 👍 |
@xukai92 Could you provide a loose timeframe in which you will be able to take a look. I will be presenting a talk at JuliaCon'18 on DiffEqBayes.jl so it would be helpful for me to plan out my work for the talk accordingly. Thanks! |
I will do it within two days. |
I was trying to upgrade related packages for this repo. but failed to build =======================[ ERROR: SymEngine ]=======================
LoadError: failed process: Process(setenv(`/Users/kai/.julia/v0.6/Conda/deps/usr/bin/conda install -y symengine=0.3.0`,String["XPC_FLAGS=0x0", "LSCOLORS=Gxfxcxdxbxegedabagacad", "PATH=/Applications/Julia-0.6.app/Contents/Resources/julia/bin:/Applications/Julia-0.6.app/Contents/Resources/julia/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/kai/sbin:/Users/kai/bin:/Users/kai/.local/sbin:/Users/kai/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/local/sbin:/opt/local/bin:/sbin:/bin:/opt/X11/bin:/Library/TeX/texbin:/Users/kai/cling/bin:/Users/kai/Library/Android/sdk:/Users/kai/miniconda2/bin", "PWD=/Users/kai", "DISPLAY=/private/tmp/com.apple.launchd.LyGpKQDTb9/org.macosforge.xquartz:0", "XPC_SERVICE_NAME=0", "TERM_PROGRAM=iTerm.app", "ARCHFLAGS=-arch x86_64", "SHELL=/bin/zsh", "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x2", "COLORFGBG=15;0", "LC_CTYPE=en_GB.UTF-8", "TMPDIR=/var/folders/xv/35q9th6x10b926ntt6cwgfjh0000gn/T/", "TK_LIBRARY=/System/Library/Frameworks/Tk.framework/Versions/8.5/Resources/Scripts", "CONDARC=/Users/kai/.julia/v0.6/Conda/deps/usr/condarc-julia.yml", "CPPFLAGS=-I/opt/X11/include", "FONTCONFIG_PATH=/Applications/Julia-0.6.app/Contents/Resources/julia/etc/fonts", "LANG=en_GB.UTF-8", "ITERM_PROFILE=Default", "SHLVL=2", "LOGNAME=kai", "CONDA_PREFIX=/Users/kai/.julia/v0.6/Conda/deps/usr", "TERM_SESSION_ID=w0t0p1:1CC0BEF1-AFAA-4FA6-8785-13D6D5780D0D", "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.dMhY3eLd6k/Listeners", "OLDPWD=/Users/kai", "DEFAULT_USER=kai", "_=/Users/kai/bin/julia", "PAGER=less", "Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.NiLzn0XvJa/Render", "USER=kai", "ITERM_SESSION_ID=w0t0p1:1CC0BEF1-AFAA-4FA6-8785-13D6D5780D0D", "TERM=xterm-256color", "HOME=/Users/kai", "TERM_PROGRAM_VERSION=3.2.0beta3", "OPENBLAS_MAIN_FREE=1", "COLORTERM=truecolor", "LESS=-R", "ZSH=/Users/kai/.oh-my-zsh"]), ProcessExited(1)) [1]
while loading /Users/kai/.julia/v0.6/SymEngine/deps/build.jl, in expression starting on line 56
==================================================================
=========================[ BUILD ERRORS ]=========================
WARNING: SymEngine had build errors.
- packages with build errors remain installed in /Users/kai/.julia/v0.6
- build the package(s) and all dependencies with `Pkg.build("SymEngine")`
- build a single package by running its `deps/build.jl` script
================================================================== which leads to
Tried to |
I can't recreate the error. What version of Julia and |
I'm using Julia 0.6.2 and |
Can you run |
@isuruf Here is it ➜ DiffEqBayes.jl (update-turing) ✗ /Users/kai/.julia/v0.6/Conda/deps/usr/bin/conda install -y symengine=0.3.0
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- symengine=0.3.0
Current channels:
- https://repo.anaconda.com/pkgs/main/osx-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/osx-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/osx-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/pro/osx-64
- https://repo.anaconda.com/pkgs/pro/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page. |
Run |
That works! Thanks! |
@mohamed82008 posted function turing_inference(prob::DiffEqBase.DEProblem,alg,t,data,priors = nothing;
num_samples=1000, delta=0.65, kwargs...)
N = length(priors)
_theta = Vector{Real}(undef, N)
@model bif(x) = begin
for i in 1:length(priors)
_theta[i] ~ priors[i]
end
σ ~ InverseGamma(2, 3)
theta = convert(Array{typeof(first(_theta))}, _theta)
p_tmp = remake(prob, u0 = convert.(eltype(theta), (prob.u0)), p = theta)
sol_tmp = solve(p_tmp, alg; saveat = t, kwargs...)
fill_length = length(t) - length(sol_tmp.u)
for i in 1:fill_length
if eltype(sol_tmp.u) <: Number
push!(sol_tmp.u, Inf)
else
push!(sol_tmp.u, fill(Inf, size(sol_tmp[1])))
end
end
for i = 1:length(t)
res = sol_tmp.u[i]
x[:,i] ~ MvNormal(res, σ*ones(2))
end
end
model = bif(data)
chn = sample(model, Turing.NUTS(num_samples, delta))
end |
Hi @xukai92 I saw that there have been quite a few changes in the last few months in Turing.jl and thus
turing_inference
needs to be updated too, could you help out with the required changes?The text was updated successfully, but these errors were encountered: