mri.operators.gradient.utils#

Different tools required for the reconstruction.

check_lipschitz_cst(f, x_shape, lipschitz_cst, max_nb_of_iter=10, x_dtype=<class 'numpy.float64'>)[source]#

This method checks that the Lipschitz constraints are statisfied for max_nb_of_iter random inputs: .. math:: ||f(x) - f(y)|| < lipschitz_cst ||x - y||

Parameters
  • f (function) – A function to check for lipschitz_cst according to the above equation.

  • x_shape (tuple) – Input data shape for function f.

  • lipschitz_cst (float) – The Lischitz constant associated to the function f.

  • max_nb_of_iter (int, default=10) – The number of random inputs used to validate the constant lipschitz_cst according to the above formula.

Returns

If False then lipschitz_cst is not respecting the above formula. Otherwise, lipschitz_cst might be an upper bound of the real Lipschitz constant for the function f.

Return type

bool