Beispiel #1
0
def fre_losses(end_points, labels):
    with tf.variable_scope('loss'):
        loss = 0.0
        for _, key in enumerate(end_points):
            cost = fre_loss(key, labels)
            loss += cost
    tf.losses.add_loss(loss)

    if loss is not None:
        tf.logging.info('Add_loss Done!')
        tf.summary.scalar('weights_loss', loss)
Beispiel #2
0
def fre_losses(end_points, labels):
    loss = 0.0
    if len(end_points) < 6:
        raise ValueError('Master: lacking of a layers!')
    with tf.variable_scope('loss'):
        for i, key in enumerate(end_points):
            cost = fre_loss(key, labels)
            loss += cost
    tf.losses.add_loss(loss)

    if loss is not None:
        tf.logging.info('Add_loss Done!')
        tf.summary.scalar('weights_loss', loss)