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)
- AbstractMCMC docs page out of date HOT 1
- Attempt fixing `bnn` tests in Ezyme PR HOT 3
- Make MLE and MAP more robust HOT 6
- Depreciate MCMC-interface code in favour of `AbstractMCMC`.
- Fix code test coverage HOT 1
- preallocating an array of random variables, getting `varname As used multiple times in model (subsumes As[1])` HOT 1
- maximum_likelihood function not found in Turing.jl HOT 4
- Allow for a named tuple for `initial_params` HOT 13
- Using the score function estimator as gradient for VI HOT 9
- Import style and modularisation HOT 9
- JuliaFormatter GHA workflow fails on public forks due to insufficient permissions HOT 2
- Turing fails to precompile due to deprecated method dispatches with v1.10 HOT 6
- Distributions defined in Turing: is the plan to keep them here? HOT 2
- Slice sampling as a `Gibbs` sampler HOT 5
- Safety for poisson random calls HOT 6
- Multithread tests fail on master HOT 6
- Interface for specifying adjoints of FEM models HOT 9
- Julia 1.7 tests are failing HOT 9
- Support potential type argument in rand for eltype of Sampleable HOT 1
- Refactoring AD Tests
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.