carpet/loss_gradient.py
def synthesis_primal_obj(z, A, L, x, lbda):
    """ Cost for the primal formulation of the synthesis problem. """
    z = np.atleast_2d(z)
    n_samples = z.shape[0]
    cost = 0.5 * np.sum(np.square(z.dot(L).dot(A) - x))
    cost += lbda * np.sum(np.abs(z[:, 1:]))
    return cost / n_samples
 Cost for the primal formulation of the synthesis problem. 
Cost for the primal formulation of the synthesis problem.
Cost for the primal formulation of the synthesis problem .
def synthesis_primal_obj(z, A, L, x, lbda):
    z = np.atleast_2d(z)
    n_samples = z.shape[0]
    cost = 0.5 * np.sum(np.square(z.dot(L).dot(A) - x))
    cost += lbda * np.sum(np.abs(z[:, 1:]))
    return cost / n_samples
def synthesis_primal_obj ( z , A , L , x , lbda ) : z = np . atleast_2d ( z ) n_samples = z . shape [ 0 ] cost = 0.5 * np . sum ( np . square ( z . dot ( L ) . dot ( A ) - x ) ) cost += lbda * np . sum ( np . abs ( z [ : , 1 : ] ) ) return cost / n_samples
Cost for the primal formulation of the synthesis problem.
Cost for the primal formulation of the synthesis problem .
""" Cost for the primal formulation of the synthesis problem. """
z
A
L
x
lbda