@verbose
def tf_lipschitz_constant(M, G, phi, phiT, tol=0.001, verbose=None):
 n_times = M.shape[1]
 n_points = G.shape[1]
 iv = np.ones((n_points, n_times), dtype=np.float)
 v = phi(iv)
 L = 1e+100
 for it in range(100):
  L_old = L
  logger.info(('Lipschitz estimation: iteration = %d' % it))
  iv = np.real(phiT(v))
  Gv = np.dot(G, iv)
  GtGv = np.dot(G.T, Gv)
  w = phi(GtGv)
  L = np.max(np.abs(w))
  v = (w / L)
  if (abs(((L - L_old) / L_old)) < tol):
   break
 return L

@ verbose def tf_lipschitz_constant ( M , G , phi , phiT , tol = 0.001 , verbose = None ) : n_times = M . shape [ 1 ] n_points = G . shape [ 1 ] iv = np . ones ( ( n_points , n_times ) , dtype = np . float ) v = phi ( iv ) L = 1e+100 for it in range ( 100 ) : L_old = L logger . info ( ( 'Lipschitz estimation: iteration = %d' % it ) ) iv = np . real ( phiT ( v ) ) Gv = np . dot ( G , iv ) GtGv = np . dot ( G . T , Gv ) w = phi ( GtGv ) L = np . max ( np . abs ( w ) ) v = ( w / L ) if ( abs ( ( ( L - L_old ) / L_old ) ) < tol ) : break return L
compute lipschitz constant for fista .