You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f840b1a
Browse filesBrowse the repository at this point in the historyBrowse files
Drop @defmodel decorator; plain functions work directly
@defmodel was a no-op marker that wrapped a (params, u) -> Node
function in a ModelFn container which compile_model immediately
unwrapped via _resolve_model_fn. compile_model already accepts
plain functions identically, so the decorator added an import and
a layer of ceremony with zero runtime effect.
Remove ModelFn, defmodel, and _resolve_model_fn from compile.py;
narrow compile_model's signature to plain Callable; drop the
exports from __init__.py; update the migration comment in core.py;
update README quickstart to use compile_model directly (the
old set_params/log_likelihood example was bit-rotted to the
removed Model class anyway); migrate tests and examples to the
plain-function form.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# defmodel calls the userdefined `model` and builds a complete graph of the model
32
+
# compile_model traces the user-defined `model` and builds a complete graph
34
33
# then, we need to find a "plan" that traverses the graph
35
34
# In particular, a plan is a sequence of stages, where each stage is a set of nodes of the same family and all ancestor families.
36
35
# For each stage, all the nodes that are inputs to the current staged are already computed and thus available
@@ -49,7 +48,7 @@ def model(params, u):
49
48
jnp.ones((10, 20))
50
49
) # this will compute the log likelihood of the model
51
50
# under the hood
52
-
# defmodel calls the userdefined `model` and builds a complete graph of
51
+
# compile_model traces the user-defined `model` and builds a complete graph
53
52
# if the graph is a single layer tree (there's only one node of copula),
54
53
# then the log likelihood is simply found by finding the d^th order mixed derivative of the outer generator, multiplied by the product of the derivatives of the inner generators.
0 commit comments