import torch


def reg_func_abs(weights):
    """Regularization of weights to induce sparcity

    Args:
        weights (torch tensor): Model weights to be regularized towards zero

    Returns:
        regularization loss, scalar
    """
    return torch.mean(torch.abs(weights)).squeeze()