Comments (10)
Good suggestion! Will do it along with bug fixing.
from turing.jl.
Hi,
great library!
While I'm rather new to it I stumbled upon a small issue
@model gauss1 begin
N = length(x)
lam = ones(Float64,N)
mu ~ Normal(0, sqrt(1000));
for i = 1:N
lam[i] ~ Gamma(.001, .001)
x[i] ~ Normal(mu, sqrt(1 / (sqrt(lam[i]))))
end
mu
end
x = [-27.020, 3.570, 8.191, 9.898, 9.603, 9.945, 10.056]
chain = sample(gauss1, SMC(300))
work. However
@model gauss2 begin
N = length(x)
lam = ones(Float64,N)
mu ~ Normal(0, sqrt(1000));
for i = 1:N
lam[i] ~ Gamma(.001, .001)
x[i] ~ Normal(mu, sqrt(1 / (sqrt(lam[i]))))
end
mu, lam
end
chain = sample(gauss2, SMC(300))
gives me
`
MethodError: no method matching mcmcstats(::Array{Array{Float64,1},1})
Closest candidates are:
mcmcstats{T<:Real}(::Array{T<:Real,1}) at /home/juser/.julia/v0.5/Turing/src/core/io.jl:160
mcmcstats{T<:Real}(::Array{T<:Real,2}) at /home/juser/.julia/v0.5/Turing/src/core/io.jl:168
in show(::IOContext{Base.AbstractIOBuffer{Array{UInt8,1}}}, ::Turing.Chain) at /home/juser/.julia/v0.5/Turing/src/core/io.jl:85
in limitstringmime(::MIME{Symbol("text/plain")}, ::Turing.Chain) at /opt/julia_packages/.julia/v0.5/IJulia/src/inline.jl:25
in display_dict(::Turing.Chain) at /opt/julia_packages/.julia/v0.5/IJulia/src/execute_request.jl:28
in execute_request(::ZMQ.Socket, ::IJulia.Msg) at /opt/julia_packages/.julia/v0.5/IJulia/src/execute_request.jl:188
in eventloop(::ZMQ.Socket) at /opt/julia_packages/.julia/v0.5/IJulia/src/eventloop.jl:8
in (::IJulia.##13#19)() at ./task.jl:360
`
What would you recommend?
Im at the current head at a6d4cc8
Best
Arnim
from turing.jl.
Hi Arnim,
there is a small bug in the print function for Chain
, which stores samples from a sampling algorithm. The following code with an extra semi-colon runs fine
chain = sample(gauss2, SMC(300));
We will fix this bug in the next release.
Thanks
from turing.jl.
BTW, the current master branch contains some (major) ongoing refactoring of the interface, the result should not be trusted too much for the moment. This should gets better in the next new release.
from turing.jl.
Thanks @yebai for your quick response.
For now something like in stan-models/naive_bayes.jl:25 should do the trick of inspecting.
Let me know when I can help.
Really like the intuitive way of defining programs.
Best
Arnim
from turing.jl.
@yebai For more examples in the future, we can have separate files for data, model and inference, which would also make tests for front-end/interface only easy. I adapted my previous 3 Stan models following this. Please check https://github.com/xukai92/Turing-exps/tree/master/stan-models.
from turing.jl.
@xukai92 Thanks Kai. I have added some models myself. I suggest that we keep these example models under the example-models
folder in the main repo for the moment. It will be easier for us to add and run these models within the main repo.
from turing.jl.
@yebai Agreed. I've made the update to the main repo too.
from turing.jl.
Goal for this isuee: make Naive Bayes and LDA work
from turing.jl.
Closed by PR #162
from turing.jl.
Related Issues (20)
- Experimental Gibbs seems to have higher variance than "stable" Gibbs (maybe) HOT 3
- Better return type for mode estimation
- Undeterministic test failure HOT 2
- Tests to check that the correct AD method is actually used
- Setup continuous benchmarking for Tuirng/DynamicPPL
- Problem with using `predict` with vector valued random variables HOT 16
- Turing guaranteed to error (when compiled with GPUCompiler) HOT 6
- Style Guide and Style Checker HOT 13
- Dependent uniform variables not working correctly HOT 2
- Add `Tapir` to Turing's AD test suite
- Implementing `adtype` for closely linked "external" samplers / adding metric warm-up HOT 2
- Constrained or partitioned inference for Turing models.
- Compat issue HOT 13
- missing keyword arguments not property processed HOT 5
- Enable Aqua.test_ambiguities
- Progress reporting in parallel sampling HOT 3
- Using @distributed to accelerate but getting wrong results
- Mode estimation's support of Pathfinder integration HOT 5
- Docs on SGHMC / SGLD? HOT 4
- Failing in precompiling dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turing.jl.