carpet/loss_gradient.py
def analysis_primal_obj(z, A, D, x, lbda):
    """ Cost for the primal formulation of the analysis problem. """
    z = np.atleast_2d(z)
    n_samples = z.shape[0]
    residual = z.dot(A) - x
    cost = 0.5 * np.sum(residual * residual)
    reg = np.sum(np.abs(z.dot(D)))
    return (cost + lbda * reg) / n_samples
 Cost for the primal formulation of the analysis problem. 
Cost for the primal formulation of the analysis problem.
Cost for the primal formulation of the analysis problem .
def analysis_primal_obj(z, A, D, x, lbda):
    z = np.atleast_2d(z)
    n_samples = z.shape[0]
    residual = z.dot(A) - x
    cost = 0.5 * np.sum(residual * residual)
    reg = np.sum(np.abs(z.dot(D)))
    return (cost + lbda * reg) / n_samples
def analysis_primal_obj ( z , A , D , x , lbda ) : z = np . atleast_2d ( z ) n_samples = z . shape [ 0 ] residual = z . dot ( A ) - x cost = 0.5 * np . sum ( residual * residual ) reg = np . sum ( np . abs ( z . dot ( D ) ) ) return ( cost + lbda * reg ) / n_samples
Cost for the primal formulation of the analysis problem.
Cost for the primal formulation of the analysis problem .
""" Cost for the primal formulation of the analysis problem. """
z
A
D
x
lbda