mri.optimizers.utils.cost#

Different cost functions for the optimization.

class DualGapCost(linear_op, initial_cost=1000000.0, tolerance=0.0001, cost_interval=None, test_range=4, verbose=False, plot_output=None)[source]#

Bases: modopt.opt.cost.costObj

Define the dual-gap cost function.

_calc_cost(x_new, y_new, *args, **kwargs)[source]#

Return the dual-gap cost.

Parameters
Returns

norm – the dual-gap.

Return type

float

_abc_impl = <_abc._abc_data object>#
class GenericCost(gradient_op, prox_op, initial_cost=1000000.0, tolerance=0.0001, cost_interval=None, test_range=4, optimizer_type='forward_backward', linear_op=None, verbose=False, plot_output=None)[source]#

Bases: modopt.opt.cost.costObj

Define the Generic cost function.

It is based on the cost function of the gradient operator and the cost function of the proximity operator.

_calc_cost(x_new, *args, **kwargs)[source]#

Return the cost.

Parameters

x_new (numpy.ndarray) – intermediate solution in the optimization problem.

Returns

cost – the cost function defined by the operators (gradient + prox_op).

Return type

float

_abc_impl = <_abc._abc_data object>#