Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theogf/Turkie.jl
Turing + Makie = Turkie
https://github.com/theogf/Turkie.jl
Last synced: about 2 months ago
JSON representation
Turing + Makie = Turkie
- Host: GitHub
- URL: https://github.com/theogf/Turkie.jl
- Owner: theogf
- License: mit
- Created: 2020-09-19T13:44:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-07T00:35:44.000Z (3 months ago)
- Last Synced: 2024-07-07T02:03:53.307Z (2 months ago)
- Language: Julia
- Size: 10.7 MB
- Stars: 68
- Watchers: 2
- Forks: 6
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sciml - theogf/Turkie.jl: Turing + Makie = Turkie
README
# Turing + Makie -> Turkie
[![Docs Latest](https://img.shields.io/badge/docs-dev-blue.svg)](https://theogf.dev/Turkie.jl/dev)
[![Docs Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://theogf.dev/Turkie.jl/stable)
[![Coverage Status](https://coveralls.io/repos/github/theogf/Turkie.jl/badge.svg?branch=master)](https://coveralls.io/github/theogf/Turkie.jl?branch=master)
[![CI](https://github.com/theogf/Turkie.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/theogf/Turkie.jl/actions/workflows/ci.yml)
WIP for an inference visualization package.## Roadmap
### To plot during sampling
- [x] Trace of the chains
- [x] Statistics (mean and var)
- [x] Marginals (KDE/Histograms)
- [x] Autocorrelation plots
- [ ] Show multiple chains### Additional features
- [x] Selecting which variables are plotted
- [x] Selecting what plots to show
- [x] Giving a recording option
- [ ] Additional fine tuning features like
- [ ] Thinning
- [x] Creating a buffer to limit the viewing### Extra Features
- [ ] Using a color mapping given some statistics
- [ ] Allow to apply transformation before plotting## Usage
Small example:
```julia
using Turing
using Turkie
using GLMakie # You could also use CairoMakie or another backend
@model function demo(x) # Some random Turing model
m0 ~ Normal(0, 2)
s ~ InverseGamma(2, 3)
m ~ Normal(m0, √s)
for i in eachindex(x)
x[i] ~ Normal(m, √s)
end
endxs = randn(100) .+ 1 # Create some random data
m = demo(xs) # Create the model
cb = TurkieCallback(m) # Create a callback function to be given to the sample
chain = sample(m, NUTS(0.65), 300; callback = cb) # Sample and plot at the same time
```If you want to show only some variables you can give a `Dict` to `TurkieCallback` :
```julia
cb = TurkieCallback(
(m0 = [:trace, :mean], s = [:autocov, :var])
)```
You can also directly pass `OnlineStats` object:
```julia
using OnlineStats
cb = TurkieCallback(
(v = [Mean(), AutoCov(20)],)
)
```If you want to record the video do
```julia
using Makie
record(cb.figure, joinpath(@__DIR__, "video.webm")) do io
addIO!(cb, io)
sample(m, NUTS(0.65), 300; callback = cb)
end
```