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

    def more_negative():
        indices = keras_rcnn.backend.shuffle(
            keras.backend.reshape(bg_inds, (-1,)))[:size]
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: tensorflow/models
Commit Name: 6291404af8c48b0f9f7993abf5e895ce2de07f29
Time: 2020-06-28
Author: syiming@umich.edu
File Name: research/object_detection/utils/spatial_transform_ops.py
Class Name:
Method Name: multilevel_native_crop_and_resize


Project Name: tensorflow/transform
Commit Name: ff182f80aeba434765ecb396050916a5e40078b4
Time: 2019-06-18
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/tf_utils.py
Class Name:
Method Name: reduce_batch_count_mean_and_var