bayespy.nodes.Gate¶
- class bayespy.nodes.Gate(Z, X, gated_plate=-1, moments=None, **kwargs)[source]¶
Deterministic gating of one node.
Gating is performed over one plate axis.
Note: You should not use gating for several variables which parents of a same node if the gates use the same gate assignments. In such case, the results will be wrong. The reason is a general one: A stochastic node may not be a parent of another node via several paths unless at most one path has no other stochastic nodes between them.
- __init__(Z, X, gated_plate=-1, moments=None, **kwargs)[source]¶
Constructor for the gating node.
- Parameters
- ZCategorical-like node
A variable which chooses the index along the gated plate axis
- Xnode
The node whose plate axis is gated
- gated_plateint (optional)
The index of the plate axis to be gated (by default, -1, that is, the last axis).
Methods
__init__
(Z, X[, gated_plate, moments])Constructor for the gating node.
add_plate_axis
(to_plate)broadcasting_multiplier
(plates, *args)delete
()Delete this node and the children
get_mask
()get_shape
(ind)Return True if the node has a plotter
lower_bound_contribution
([gradient])move_plates
(from_plate, to_plate)plot
([fig])Plot the node distribution using the plotter of the node
random
()set_plotter
(plotter)Attributes
Plate multiplier is applied to messages to parents