Function

class optimix.function.Function(**kwargs)

Base-class for object representing functions.

Parameters:kwargs (dict) – Map of variable name to variable value.
feed(purpose=’learn’)

Return a function with attached data.

fix(var_name)

Set a variable fixed.

Parameters:var_name (str) – variable name.
gradient(*args)

Evaluate the gradient at the args point.

Parameters:args (tuple) – Point at the gradient evaluation. The length of this tuple() is defined by the user.
Returns:Map between variables to their gradient values.
Return type:dict
isfixed(var_name)

Return whether a variable it is fixed or not.

Parameters:var_name (str) – variable name.
set_data(data, purpose=’learn’)

Set a named data source.

Parameters:purpose (str) – Name of the data source.
set_nodata(purpose=’learn’)

Disable data feeding.

Parameters:purpose (str) – Name of the data source.
unfix(var_name)

Set a variable unfixed.

Parameters:var_name (str) – variable name.
unset_data(purpose=’learn’)

Unset a named data source.

Parameters:purpose (str) – Name of the data source.
value(*args)

Evaluate the function at the args point.

Parameters:args (tuple) – Point at the evaluation. The length of this tuple() is defined by the user.
Returns:Function evaluated at args.
Return type:float or array_like
variables()

Function variables.