carpet/loss_gradient.py
def synthesis_primal_subgrad(z, A, L, x, lbda):
    """ Sub-gradient for the primal formulation of the synthesis problem. """
    z = np.atleast_2d(z)
    n = z.shape[0]
    reg = np.concatenate([np.zeros((n, 1)), np.sign(z[:, 1:])], axis=1)
    return synthesis_primal_grad(z, A, L, x) + lbda * reg
 Sub-gradient for the primal formulation of the synthesis problem. 
Sub-gradient for the primal formulation of the synthesis problem.
Sub - gradient for the primal formulation of the synthesis problem .
def synthesis_primal_subgrad(z, A, L, x, lbda):
    z = np.atleast_2d(z)
    n = z.shape[0]
    reg = np.concatenate([np.zeros((n, 1)), np.sign(z[:, 1:])], axis=1)
    return synthesis_primal_grad(z, A, L, x) + lbda * reg
def synthesis_primal_subgrad ( z , A , L , x , lbda ) : z = np . atleast_2d ( z ) n = z . shape [ 0 ] reg = np . concatenate ( [ np . zeros ( ( n , 1 ) ) , np . sign ( z [ : , 1 : ] ) ] , axis = 1 ) return synthesis_primal_grad ( z , A , L , x ) + lbda * reg
Sub-gradient for the primal formulation of the synthesis problem.
Sub - gradient for the primal formulation of the synthesis problem .
""" Sub-gradient for the primal formulation of the synthesis problem. """
z
A
L
x
lbda