Value#
- class liesel.model.Value(value, _name='')[source]#
Bases:
NodeA
Nodesubclass that holds constant values.Since the information represented by a value node does not change, it is always up-to-date. A common usecase for value nodes is to cache computed values.
By default, value nodes will appear in the node graph created by
viz.plot_nodes(), but they will not appear in the model graph created byviz.plot_vars().You can wrap a value node in a
Varto make it appear in the model graph.
- Parameters:
See also
CalcA node representing a general calculation/operation in JAX or Python.
DistA node representing a
tensorflow_probabilityDistribution.VarA variable in a statistical model, typically with a probability distribution.
paramA helper function to initialize a
Varas a model parameter.obsA helper function to initialize a
Varas an observed variable.
Examples
A simple constant node representing a constant value without a name:
>>> nameless_node = lsl.Value(1.0) >>> nameless_node Value(name="")
Adding this node to a model leads to an automatically generated name:
>>> model = lsl.Model([nameless_node]) >>> nameless_node Value(name="n0")
A constant node with a name:
>>> node = lsl.Value(1.0, _name="my_name") >>> node Value(name="my_name")
Methods
Stops the recursion setting outdated flags.
update()Does nothing.
Attributes