mxfusion.components.functions.mxfusion_gluon_function

Members

class mxfusion.components.functions.mxfusion_gluon_function.MXFusionGluonFunction(block, num_outputs, dtype=None, broadcastable=False)

Bases: mxfusion.components.functions.mxfusion_function.MXFusionFunction

The wrapper of a MXNet Gluon block in MXFusion. It automatically fetches all the Gluon parameters in its ParameterDict. When this function wrapper is called in Model definition, it returns a factor corresponding to the function evaluation.

Parameters:
  • block (mxnet.gluon.Block or mxnet.gluon.HybridBlock) – The MXNet Gluon block to be wrapped.
  • num_outputs (int) – The number of output variables of the Gluon block.
  • dtype (numpy.float32 or numpy.float64) – the data type of float point numbers used in the Gluon block.
  • broadcastable (boolean) – Whether the function supports broadcasting with the additional dimension for samples.
gluon_block
input_names

The names of all the inputs that the function takes including the function parameters

output_names

The names of all the outputs of the function

parameter_names

The names of all the function parameters.

parameters

The parameters in the format of MXFusion Variable that are associated with the function. These parameters are automatically included as the inputs in the resulting FunctionEvaluation object with the need of explicitly specification when calling the __call__ function.

Returns:a dictionary of all the parameters, in which the keys are the

name of individual parameters and the values are the corresponding Variables. :rtype: {str: Variable}

eval(F, **input_kws)

Invokes the MXNet Gluon block with the arguments passed in.

Parameters:
  • F – the MXNet computation mode (mxnet.symbol or mxnet.ndarray)
  • input_kws – the dict of inputs to the functions. The key in the dict should match with the name of inputs
specified in the inputs
of FunctionEvaluation.
Returns:the return value of the function
Rtypes:MXNet NDArray or MXNet Symbol
replicate_self(attribute_map=None)

The copy constructor for the function.