stan-dev / posteriordb

Database with posteriors of interest for Bayesian inference
161 stars 26 forks source link

Adds a folder for Turing models, and a few models for testing, #262

Open JasonPekos opened 2 weeks ago

JasonPekos commented 2 weeks ago

Purpose

This PR adds a few Turing models:

Rationale

Eventually the rest of the Turing models are probably going to live here. For now, while I'm building out the Julia testing and benchmarking code, I'd like some models in the actual repository to test my code on.

These models cover some edge cases that I want to make sure my code covers.

JasonPekos commented 2 weeks ago

Converting this to a draft — just noticed that I need to change the corresponding info files as well, to add a turing model section, e.g.:

(for the folder:)

  "model_implementations": {
    "stan": {
      "model_code": "models/stan/eight_schools_noncentered.stan",
      "stan_version": ">=2.26.0"
    },
    "pymc3": {
      "model_code": "models/pymc3/eight_schools_noncentered.py"
    },
    "turing": {
      "model_code": "models/turing/eight_schools_noncentered"
    }
  },

(for the actual code file:)

  "model_implementations": {
    "stan": {
      "model_code": "models/stan/eight_schools_noncentered.stan",
      "stan_version": ">=2.26.0"
    },
    "pymc3": {
      "model_code": "models/pymc3/eight_schools_noncentered.py"
    },
    "turing": {
      "model_code": "models/turing/eight_schools_noncentered/eight_schools_noncentered.jl"
    }
  },

not sure what is ideal here.

JasonPekos commented 2 weeks ago

Ok, updated the .jsons to point at the actual julia files. will revisit if this is a problem. also unsure if adding new implementations for current models requires me to change anything else?

MansMeg commented 2 weeks ago

This looks good to me. I have two thoughts. 1) We should probably add a document explaining how to run the Turing models. Ie example code, I guess an md in docs? 2) hav you checked that these models give the same or proportional log density values as with stan?