眠気.jl

投稿=不定期

Juliaで話題のGen/チュートリアルの環境構築

Genとは

A general-purpose probabilistic programming system with programmable inference.
DLに限らないgeneral-purposeな確率的プログラミングを目指しているのでGenという名前(リンク先参照)
The name 'Gen' comes from the system's purpose to fill a gap in "general-purpose" probabilistic programming, according a paper by MIT researchers. probcomp.github.io GenTF
TensorFlow plugin for the Gen probabilistic programming system
GenViz
可視化のためのなにか

触ってみる

公式のGetting Startedでは2通りのやり方が書いてある
1 . Juliaのpackage managerから入れる

pkg> add https://github.com/probcomp/Gen

2 . Dockerを使う

Dockerでやってみる

The easiest way to run the notebooks is using Docker.
らしいのでDockerの方のチュートリをやってみる

$ git clone https://github.com/probcomp/gen-quickstart.git
$ cd gen-quickstart
$ docker build -t gen:v0 .
$ docker run -it --name gen -p 8080:8080 -p 8090:8090 -p 8091:8091 -p 8092:8092 gen:v0

デカいので時間かかった(1.95GB)

f:id:julialangisthebestlang:20190701195453p:plain
docker_size

localhost:8080にアクセス

f:id:julialangisthebestlang:20190701200611p:plain
Gen

環境構築できた

チュートリアルの中身を見てみる

全体 Gen Quick Start.ipynb

f:id:julialangisthebestlang:20190701203442p:plain
tutorial

例えば tutorials/Reasoning About Regenerate.ipynb

Genの使い方,特にget_choicesで取りうる値がtreeコマンドの様に見れるのが印象的だったので載せておく

f:id:julialangisthebestlang:20190701210847p:plain
measurable_func
f:id:julialangisthebestlang:20190701210850p:plain
tree_view

参考

Gen公式