carpet/loss_gradient.py
def loss_prox_tv_analysis(x, u, lbda):
    """ TV reg. loss function for Numpy variables. """
    n_samples = u.shape[0]
    data_fit = 0.5 * np.sum(np.square(u - x))
    reg = lbda * np.sum(np.abs(np.diff(u, axis=-1)))
    return (data_fit + reg) / n_samples
 TV reg. loss function for Numpy variables. 
TV reg. loss function for Numpy variables.
TV reg . loss function for Numpy variables .
def loss_prox_tv_analysis(x, u, lbda):
    n_samples = u.shape[0]
    data_fit = 0.5 * np.sum(np.square(u - x))
    reg = lbda * np.sum(np.abs(np.diff(u, axis=-1)))
    return (data_fit + reg) / n_samples
def loss_prox_tv_analysis ( x , u , lbda ) : n_samples = u . shape [ 0 ] data_fit = 0.5 * np . sum ( np . square ( u - x ) ) reg = lbda * np . sum ( np . abs ( np . diff ( u , axis = - 1 ) ) ) return ( data_fit + reg ) / n_samples
TV reg.
TV reg .
""" TV reg. loss function for Numpy variables. """
x
u
lbda