Пример #1
0
def tv_pernalized_loss_function(A, b, x):
    """
    Frobenius + TV penalty

    """

    return .5 * linalg.norm(np.dot(A, x) - b)**2 + lambd * tv(x)
def tv_pernalized_loss_function(A, b, x):
    """
    Frobenius + TV penalty

    """

    return .5 * linalg.norm(np.dot(A, x) - b) ** 2 + lambd * tv(x)
Пример #3
0
def tv_plus_l1_pernalized_loss_function(A, b, x):
    """
    Frobenius + TV penalty + l1 penalty

    """

    return .5 * linalg.norm(np.dot(A, x) -
                            b)**2 + alpha * (rho * tv(x) + (1 - alpha) * l1(x))
def tv_plus_l1_pernalized_loss_function(A, b, x):
    """
    Frobenius + TV penalty + l1 penalty

    """

    return .5 * linalg.norm(np.dot(A, x) - b) ** 2 + alpha * (
        rho * tv(x) + (1 - alpha) * l1(x))
Пример #5
0
 def fg_with_tv_penalty(x):
     z = np.dot(A, x) - b
     return (.5 * linalg.norm(z)**2 + lambd * tv(x),
             np.dot(A.T, z) + lambd * grad_tv(x))
 def fg_with_tv_penalty(x):
     z = np.dot(A, x) - b
     return (.5 * linalg.norm(z) ** 2 + lambd * tv(x),
              np.dot(A.T, z) + lambd * grad_tv(x))