Skip to content

Commit 5d99124

Browse files
committed
Remove GenViz and add GenExamples.jl to intro docs
1 parent 5cc3218 commit 5d99124

File tree

2 files changed

+3
-38
lines changed

2 files changed

+3
-38
lines changed

docs/src/getting_started.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ First, obtain Julia 1.3 or later, available [here](https://julialang.org/downloa
66

77
The Gen package can be installed with the Julia package manager. From the Julia REPL, type `]` to enter the Pkg REPL mode and then run:
88
```
9-
pkg> add https://github.com/probcomp/Gen
9+
pkg> add Gen
1010
```
11-
To test the installation, run the example in the next section, or run the tests with:
11+
To test the installation locally, you can run the tests with:
1212
```julia
1313
using Pkg; Pkg.test("Gen")
1414
```
@@ -73,38 +73,3 @@ ys = [8.23, 5.87, 3.99, 2.59, 0.23, -0.66, -3.53, -6.91, -7.24, -9.90]
7373
(slope, intercept) = my_inference_program(xs, ys, 1000)
7474
println("slope: $slope, intercept: $intercept")
7575
```
76-
77-
## Visualization Framework
78-
79-
Because inference programs are regular Julia code, users can use whatever visualization or plotting libraries from the Julia ecosystem that they want.
80-
However, we have paired Gen with the [GenViz](https://github.com/probcomp/GenViz) package, which is specialized for visualizing the output and operation of inference algorithms written in Gen.
81-
82-
An example demonstrating the use of GenViz for this example linear regression problem is available in the [gen-quickstart](https://github.com/probcomp/gen-quickstart) repository. The code there is mostly the same as above, with a few small changes to incorporate an animated visualization of the inference process:
83-
84-
1. It starts a visualization server and initializes a visualization before performing inference:
85-
```julia
86-
# Start a visualization server on port 8000
87-
server = VizServer(8000)
88-
89-
# Initialize a visualization with some parameters
90-
viz = Viz(server, joinpath(@__DIR__, "vue/dist"), Dict("xs" => xs, "ys" => ys, "num" => length(xs), "xlim" => [minimum(xs), maximum(xs)], "ylim" => [minimum(ys), maximum(ys)]))
91-
92-
# Open the visualization in a browser
93-
openInBrowser(viz)
94-
```
95-
96-
The `"vue/dist"` is a path to a custom _trace renderer_ that draws the (x, y) points and the line represented by a trace; see the GenViz documentation for more details. The code for the renderer is [here](https://github.com/probcomp/gen-quickstart/blob/master/quickstart/vue/src/components/Trace.vue).
97-
98-
2. It passes the visualization object into the inference program.
99-
```julia
100-
(slope, intercept) = my_inference_program(xs, ys, 1000000, viz)
101-
```
102-
103-
3. In the inference program, it puts the current trace into the visualization at each iteration:
104-
```julia
105-
for iter=1:num_iters
106-
putTrace!(viz, 1, trace_to_dict(trace))
107-
(trace, _) = metropolis_hastings(trace, select(:slope))
108-
(trace, _) = metropolis_hastings(trace, select(:intercept))
109-
end
110-
```

docs/src/tutorials.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
See [Gen Quickstart](https://github.com/probcomp/gen-quickstart) repository for tutorials and case studies
44

5-
Additional examples are available in the `examples/` directory of the [Gen](https://github.com/probcomp/Gen) repository.
5+
Additional examples are available in the [GenExamples.jl](https://github.com/probcomp/GenExamples.jl) repository.

0 commit comments

Comments
 (0)