df93c4e61e7ca1db25f1ee346ac0516685498b02,keras_rcnn/backend/tensorflow_backend.py,,subsample_negative_labels,#Any#,235

Before Change


    :param labels: array of labels (1 is positive, 0 is negative, -1 is dont care)
    :return:
    
    num_bg = RPN_BATCHSIZE - tensorflow.reduce_sum(tensorflow.gather(labels, tensorflow.where(tensorflow.equal(labels, 1))))
    
    bg_inds = tensorflow.where(tensorflow.equal(labels, 0))
    
    bg_inds = keras.backend.shape(bg_inds)[0]
    
    size = keras.backend.cast(bg_inds, tensorflow.int32) - keras.backend.cast(num_bg, tensorflow.int32)

    def more_negative():
        indices = tensorflow.multinomial(keras.backend.log(keras.backend.ones((bg_inds, 1)) * 10.), size)

After Change



    :return:
    
    num_bg = RPN_BATCHSIZE - keras.backend.shape(
        keras_rcnn.backend.where(keras.backend.equal(labels, 1)))[0]
    bg_inds = keras_rcnn.backend.where(keras.backend.equal(labels, 0))
    num_bg_inds = keras.backend.shape(bg_inds)[0]

    size = num_bg_inds - num_bg
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: broadinstitute/keras-rcnn
Commit Name: df93c4e61e7ca1db25f1ee346ac0516685498b02
Time: 2017-08-15
Author: allen.goodman@icloud.com
File Name: keras_rcnn/backend/tensorflow_backend.py
Class Name:
Method Name: subsample_negative_labels


Project Name: asyml/texar
Commit Name: 477c6ffca3eeccac0402d3530886e16cb5a6d7f7
Time: 2017-12-03
Author: zhiting.hu@petuum.com
File Name: txtgen/losses/mle_losses.py
Class Name:
Method Name: average_sequence_sparse_softmax_cross_entropy


Project Name: asyml/texar
Commit Name: 477c6ffca3eeccac0402d3530886e16cb5a6d7f7
Time: 2017-12-03
Author: zhiting.hu@petuum.com
File Name: txtgen/losses/mle_losses.py
Class Name:
Method Name: average_sequence_softmax_cross_entropy