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
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
In pattern: SUPERPATTERN
Frequency: 3
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: raghakot/keras-vis
Commit Name: e3c42a0b8371bd4944efd70111c2458c28b9eca3
Time: 2016-12-15
Author: ragha@outlook.com
File Name: visualization.py
Class Name: Saliency
Method Name: visualize
Project Name: tensorflow/ranking
Commit Name: 6bf3f51cd0a312da842157665663c2dad9983248
Time: 2021-01-29
Author: xuanhui@google.com
File Name: tensorflow_ranking/python/losses_impl.py
Class Name: ClickEMLoss
Method Name: _compute_latent_prob