mxfusion.components.functions.function_evaluation

Members

class mxfusion.components.functions.function_evaluation.FunctionEvaluationDecorator

Bases: object

The decorator for the eval function in FunctionEvaluation

class mxfusion.components.functions.function_evaluation.FunctionEvaluation(inputs, outputs, input_names, output_names, broadcastable=False)

Bases: mxfusion.components.factor.Factor

The evaluation of a function with specified input variables.

Parameters:
  • inputs ({variable name : Variable}) – the input variables to the function.
  • outputs ({variable name : Variable}) – the output variables to the function.
  • broadcastable – Whether the function supports broadcasting with the additional dimension for samples.
Type:

boolean

replicate_self(attribute_map=None)

This functions is a copy constructor for the object. In order to perform copy construction we first call __new__() on the class which creates a blank object. We then initialize that object using the method’s standard init procedures, and do any extra copying of attributes.

Replicates this Factor, using new inputs, outputs, and a new uuid. Used during model replication to functionally replicate a factor into a new graph.

Parameters:
  • inputs (List of tuples of name to node e.g. [('random_variable': Variable y)] or None) – new input variables of the factor.
  • outputs (List of tuples of name to node e.g. [('random_variable': Variable y)] or None) – new output variables of the factor.
eval(F, variables, always_return_tuple=False)

The method handling the execution of the function. The inputs arguments of the function are fetched from the variables argument according to their UUIDs.

Parameters:
  • F – the MXNet computation mode (mxnet.symbol or mxnet.ndarray)
  • variables ({str(UUID): MXNet NDArray or MXNet Symbol}) – the set of MXNet arrays that holds the values of variables at runtime.
  • always_return_tuple – Whether return a tuple even if there is

only one variables in outputs. :type always_return_tuple: boolean :returns: the return value of the function :rtypes: MXNet NDArray or MXNet Symbol