MCPcopy Create free account
hub / github.com/daft-dev/daft / test_no_gray

Function test_no_gray

test/test_examples.py:400–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

398
399@image_comparison(baseline_images=["no_gray"], extensions=["png"])
400def test_no_gray():
401 pgm = daft.PGM(observed_style="inner")
402
403 # Hierarchical parameters.
404 pgm.add_node("alpha", r"$\alpha$", 0.5, 2, fixed=True)
405 pgm.add_node("beta", r"$\beta$", 1.5, 2)
406
407 # Latent variable.
408 pgm.add_node("w", r"$w_n$", 1, 1)
409
410 # Data.
411 pgm.add_node("x", r"$x_n$", 2, 1, observed=True)
412
413 # Add in the edges.
414 pgm.add_edge("alpha", "beta")
415 pgm.add_edge("beta", "w")
416 pgm.add_edge("w", "x")
417 pgm.add_edge("beta", "x")
418
419 # And a plate.
420 pgm.add_plate([0.5, 0.5, 2, 1], label=r"$n = 1, \ldots, N$", shift=-0.1)
421
422 # Render and save.
423 pgm.render()
424
425
426@image_comparison(baseline_images=["recursive"], extensions=["png"])

Callers

nothing calls this directly

Calls 4

add_nodeMethod · 0.95
add_edgeMethod · 0.95
add_plateMethod · 0.95
renderMethod · 0.95

Tested by

no test coverage detected