mxfusion.util.inference

Members

mxfusion.util.inference.broadcast_samples_dict(F, array_dict, num_samples=None)

Broadcast the shape of arrays in the provided dictionary. When the num_samples argument is given, all the sample dimesnions (the first dimension) of the arrays in the dictionary will be broadcasted to the size of num_samples. If the num_samples argument is not given, the sample dimensions of the arrays in the dictionary will be broadcasted to the maximum number of the sizes of the sample dimensions.

Parameters:
  • F (mxnet.ndarray or mxnet.symbol) – the execution mode of MXNet.
  • array_dict ({str: MXNet NDArray or Symbol}) – the dictionary of arrays
  • num_samples (None or int) – (optional) the target size of the sample dimension
mxfusion.util.inference.variables_to_UUID(variables)
mxfusion.util.inference.realize_shape(shape, constants)
mxfusion.util.inference.discover_shape_constants(data_shapes, graphs)

The internal shape discovery from data and the shape inference for all the variables in the model and inference models.

Parameters:
  • data_shapes – a dict of shapes of data
  • graphs – a list of factor graphs of which variable shapes are searched.
Returns:

a dict of constants discovered from data shapes

Return type:

{Variable: int}

mxfusion.util.inference.init_outcomes(inference_outcomes)