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)
__init__(*args, initialize=True, dims=None, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(*args[, initialize, dims]) Initialize self.
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
load(filename)
lowerbound()
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.
unobserve()
update([annealing])

Attributes

plates
plates_multiplier Plate multiplier is applied to messages to parents