Node
Node#
- class liesel.liesel.nodes.Node(value: Any, distribution: liesel.liesel.nodes.NodeDistribution | None = None, name: str | None = None)[source]#
- class liesel.liesel.nodes.Node(value: liesel.liesel.nodes.TNodeCalculator, distribution: liesel.liesel.nodes.NodeDistribution | None = None, name: str | None = None)
Bases:
Generic
[liesel.liesel.nodes.TNodeCalculator
]A node which can be used to build probabilistic graphical models.
The node can be strong or weak, with or without a probability distribution.
Methods
grad
()Returns the gradient of the model log-probability w.r.t.
Informs the node that the value of one of its inputs has changed.
jaxify
()Enables JAX NumPy for the node.
Informs the node that its value has changed.
set_value
(value[, update])Sets the value of the node.
unjaxify
()Disables JAX NumPy for the node.
update
()Updates the value and the log-probability of the node.
validate
()Checks if the value and the log-probability of the node are finite.
Attributes
The calculator of the node.
The distribution of the node.
Whether the node has a calculator.
Whether the node has a distribution.
Whether the node is part of a model.
Whether the node has a name.
All inputs of the node as a set.
Whether JAX NumPy is enabled for the node.
The log-probability of the node.
The model the node is part of.
The name of the node.
Whether the node is outdated.
An output of a node A is a node B which depends on the value of A.
The value and the log-probability as a NodeState.
Whether the node is strong.
The value of the node.
Whether the node is weak.