Skip to content

Instantly share code, notes, and snippets.

@zane
Created November 26, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zane/a691cc998514d48eee023e1e61a4ad24 to your computer and use it in GitHub Desktop.
Save zane/a691cc998514d48eee023e1e61a4ad24 to your computer and use it in GitHub Desktop.
A minimal script for using Metaprob's infer with the curve fitting model from probcomp/curve-fitting
#!/bin/sh
"exec" "clojure" "-Sdeps" "{:deps,{probcomp/curve-fitting,{:git/url,\"https://github.com/probcomp/curve-fitting\",:sha,\"916c4e55bf18803a285922f9d1b70e118f07a72e\"}}}" "$0" "$@"
;; "exec" "clojure" "-Sdeps" "{:deps,{probcomp/curve-fitting,{:local/root,\"/absolute/path/to/curve-fitting\"}}}" "$0" "$@"
(ns script
(:refer-clojure :only [])
(:require [metaprob.state :as state]
[metaprob.trace :as trace]
[metaprob.sequence :as sequence]
[metaprob.builtin-impl :as impl]
[metaprob.syntax :refer :all]
[metaprob.builtin :refer :all]
[metaprob.prelude :refer :all]
[metaprob.distributions :refer :all]
[metaprob.interpreters :refer :all]
[metaprob.inference :refer :all]
[metaprob.compositional :as comp]
[metaprob.examples.gaussian :refer :all]
[curve-fitting.model :refer [curve-model]]
[curve-fitting.model.trace :refer [target-trace]]))
(clojure.pprint/pprint
(infer :procedure curve-model
:inputs [[0 1 2 3 4]]
:target-trace (target-trace [0 1 2 3 4])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment