losses.py 文件源码

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

项目:piecewisecrf 作者: Vaan5 项目源码 文件源码
def total_loss_sum(losses):
    '''

    Adds L2 regularization loss to the given list of losses

    Parameters
    ----------
    losses : list
        List of losses

    Returns
    -------
    total_loss: float
        L2 regularized loss


    '''
    # Assemble all of the losses for the current tower only.
    # Calculate the total loss for the current tower.
    regularization_losses = tf.get_collection(tf.GraphKeys.REGULARIZATION_LOSSES)
    total_loss = tf.add_n(losses + regularization_losses, name='total_loss')
    return total_loss
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号