bayespy.inference.vmp.nodes.stochastic.Stochastic¶
- class bayespy.inference.vmp.nodes.stochastic.Stochastic(*args, initialize=True, dims=None, **kwargs)[source]¶
Base class for nodes that are stochastic.
u observed
- Sub-classes must implement:
_compute_message_to_parent(parent, index, u_self, *u_parents) _update_distribution_and_lowerbound(self, m, *u) lowerbound(self) _compute_dims initialize_from_prior()
- If you want to be able to observe the variable:
_compute_fixed_moments_and_f
Sub-classes may need to re-implement: 1. If they manipulate plates:
_compute_weights_to_parent(index, weights) _compute_plates_to_parent(self, index, plates) _compute_plates_from_parent(self, index, plates)
Methods
__init__
(*args[, initialize, dims])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
load
(filename)move_plates
(from_plate, to_plate)observe
(x[, mask])Fix moments, compute f and propagate mask.
plot
([fig])Plot the node distribution using the plotter of the node
random
()Draw a random sample from the distribution.
save
(filename)set_plotter
(plotter)show
()Print the distribution using standard parameterization.
update
([annealing])Attributes
Plate multiplier is applied to messages to parents