7d9d506e77585e5600b45dc41da1a731a4b30722,nn/loss.py,,sensitivity_specificity_loss,#Any#Any#Any#,83

Before Change


                              values=[1.0] * n_voxels,
                              dense_shape=[n_voxels, n_classes])
    one_hotB = 1 - tf.sparse_tensor_to_dense(one_hot)
    SensSpec = tf.reduce_mean(
        tf.add(tf.multiply(r, tf.reduce_sum(tf.multiply(tf.square(-1 * tf.sparse_add(-1 * pred, one_hot)) \
                                                        , tf.sparse_tensor_to_dense(one_hot)),
                                            0) / tf.sparse_reduce_sum(one_hot, 0)), \
               tf.multiply((1 - r), tf.reduce_sum(tf.multiply(tf.square(-1 * tf.sparse_add(-1 * pred, one_hot)), \
                                                              one_hotB), 0) / tf.reduce_sum(one_hotB, 0))))
    return SensSpec


def l2_reg_loss(scope):
    if not tf.get_collection("reg_var", scope):

After Change


    one_cold = 1 - one_hot

    squared_error = tf.square(one_hot - pred)
    specificity_part = tf.reduce_sum(squared_error * one_hot, 0) / tf.reduce_sum(one_hot, 0)
    sensitivity_part = tf.reduce_sum(tf.multiply(squared_error, one_cold), 0) / tf.reduce_sum(one_cold, 0)

    return tf.reduce_sum(r * specificity_part + (1 - r) * sensitivity_part)


def l2_reg_loss(scope):
    if not tf.get_collection("reg_var", scope):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: NifTK/NiftyNet
Commit Name: 7d9d506e77585e5600b45dc41da1a731a4b30722
Time: 2017-04-27
Author: z.eaton-rosen@ucl.ac.uk
File Name: nn/loss.py
Class Name:
Method Name: sensitivity_specificity_loss


Project Name: NifTK/NiftyNet
Commit Name: 7d9d506e77585e5600b45dc41da1a731a4b30722
Time: 2017-04-27
Author: z.eaton-rosen@ucl.ac.uk
File Name: nn/loss.py
Class Name:
Method Name: sensitivity_specificity_loss


Project Name: zsdonghao/text-to-image
Commit Name: 74796ff02e9425ca336f595978fe6e7c422c0378
Time: 2017-04-11
Author: dhsig552@163.com
File Name: tensorlayer/cost.py
Class Name:
Method Name: cosine_similarity


Project Name: tensorlayer/tensorlayer
Commit Name: 1b5dd6e75723da209cc67c89b4446ac79a8070c5
Time: 2017-02-04
Author: dhsig552@163.com
File Name: tensorlayer/cost.py
Class Name:
Method Name: cosine_similarity