4b8716fd4bd6f462a9db9eee958f2508576ec019,gluoncv/utils/nn/matcher.py,BipartiteMatcher,hybrid_forward,#BipartiteMatcher#Any#Any#,65

Before Change


    def hybrid_forward(self, F, x):
        match = F.contrib.bipartite_matching(x, threshold=self._threshold,
                                             is_ascend=self._is_ascend)
        return match[0]


class MaximumMatcher(gluon.HybridBlock):
    A Matcher implementing maximum matching strategy.

After Change


        // make sure if iou(a, y) == iou(b, y), then b should also be a good match
        // otherwise positive/negative samples are confusing
        // potential argmax and max
        pargmax = x.argmax(axis=-1, keepdims=True)  // (B, num_anchor, 1)
        maxs = x.max(axis=-2, keepdims=True)  // (B, 1, num_gt)
        pmax = F.pick(x, pargmax, axis=-1, keepdims=True)   // (B, num_anchor, 1)
        mask = F.broadcast_greater_equal(pmax + self._eps, maxs)  // (B, num_anchor, num_gt)
        mask = F.pick(mask, pargmax, axis=-1, keepdims=True)  // (B, num_anchor, 1)
        new_match = F.where(mask > 0, pargmax, F.ones_like(pargmax) * -1)
        result = F.where(match[0] < 0, new_match.squeeze(axis=-1), match[0])
        return result


class MaximumMatcher(gluon.HybridBlock):
    A Matcher implementing maximum matching strategy.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: dmlc/gluon-cv
Commit Name: 4b8716fd4bd6f462a9db9eee958f2508576ec019
Time: 2018-06-15
Author: cheungchih@gmail.com
File Name: gluoncv/utils/nn/matcher.py
Class Name: BipartiteMatcher
Method Name: hybrid_forward


Project Name: keras-team/keras
Commit Name: 01d5e7bc4782daafcfa99e035c1bdbe13a985145
Time: 2016-07-16
Author: francois.chollet@gmail.com
File Name: examples/lstm_text_generation.py
Class Name:
Method Name: sample


Project Name: keras-team/keras
Commit Name: 98d49754edd5b5757fb7c37c8a3cdc9a65d6f238
Time: 2015-07-20
Author: michael.d.oliver@gmail.com
File Name: examples/lstm_text_generation.py
Class Name:
Method Name: sample


Project Name: d2l-ai/d2l-zh
Commit Name: 3a770cbc97085c2cd4eaa0a46b2bc037f35389c2
Time: 2017-10-25
Author: muli@cs.cmu.edu
File Name: utils.py
Class Name:
Method Name: evaluate_accuracy


Project Name: keras-team/autokeras
Commit Name: d01d7d2f961c58e40135627dad07ccae7de65614
Time: 2019-02-22
Author: satyakesav123@gmail.com
File Name: autokeras/text/text_supervised.py
Class Name: TextClassifier
Method Name: inverse_transform_y