utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:GraphTime 作者: GlooperLabs 项目源码 文件源码
def soft_threshold(X, thresh):
    """Proximal mapping of l1-norm results in soft-thresholding. Therefore, it is required
    for the optimisation of the GFGL or IFGL.

    Parameters
    ----------
    X : ndarray
        input data of arbitrary shape
    thresh : float
        threshold value

    Returns
    -------
    ndarray soft threshold applied
    """
    return (np.absolute(X) - thresh).clip(0) * np.sign(X)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号