custom_layers.py 文件源码

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

项目:SSD_tensorflow_VOC 作者: LevinJ 项目源码 文件源码
def abs_smooth_2(x):
    """Smoothed absolute function. Useful to compute an L1 smooth error.

    Define as:
        x^2 / 2         if abs(x) < 1
        abs(x) - 0.5    if abs(x) > 1
    an implementation that strictly stick to the formula
    """
    absx = tf.abs(x)
    r = array_ops.where(absx < 1, math_ops.square(x)/2.0, absx-0.5)
    return r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号