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:
Z : Categorical-like node

A variable which chooses the index along the gated plate axis

X : node

The node whose plate axis is gated

gated_plate : int (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(*args)
delete() Delete this node and the children
get_mask()
get_moments()
get_pdf_nodes()
get_shape(ind)
has_plotter() 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

plates
plates_multiplier Plate multiplier is applied to messages to parents