91e003f969109dce7f2274e6f7145a4e9dbc4ef9,chainercv/links/model/light_head_rcnn/light_head_rcnn_train_chain.py,,_ohem_loss,#Any#Any#Any#Any#Any#Any#,188

Before Change


    n_ohem_sample = min(n_ohem_sample, n_sample)
    // sort in CPU because of GPU memory
    roi_cls_loc_loss = cuda.to_cpu(roi_loc_loss.array + roi_cls_loss.array)
    indices = roi_cls_loc_loss.argsort(axis=0)[::-1][:n_ohem_sample]
    if cuda.get_array_module(roi_loc_loss.array) != np:
        indices = cuda.to_gpu(indices)
    roi_loc_loss = F.sum(roi_loc_loss[indices]) / len(indices)
    roi_cls_loss = F.sum(roi_cls_loss[indices]) / len(indices)

After Change


    roi_cls_loc_loss = cuda.to_cpu(roi_loc_loss.array + roi_cls_loss.array)
    indices = roi_cls_loc_loss.argsort(axis=0)[::-1]
    // filter nan
    indices = np.array(
        [i for i in indices if not np.isnan(roi_cls_loc_loss[i])],
        dtype=np.int32)
    indices = indices[:n_ohem_sample]
    if cuda.get_array_module(roi_loc_loss.array) != np:
        indices = cuda.to_gpu(indices)
    if len(indices) > 0:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: chainer/chainercv
Commit Name: 91e003f969109dce7f2274e6f7145a4e9dbc4ef9
Time: 2019-06-08
Author: shingogo@hotmail.co.jp
File Name: chainercv/links/model/light_head_rcnn/light_head_rcnn_train_chain.py
Class Name:
Method Name: _ohem_loss


Project Name: dmlc/gluon-nlp
Commit Name: a549f1511760278ad4459446d4831405f0dd9a23
Time: 2018-11-14
Author: szha@users.noreply.github.com
File Name: docs/examples/machine_translation/dataprocessor.py
Class Name:
Method Name: load_cached_dataset


Project Name: uber/ludwig
Commit Name: 5667af96dade79ef77194d519182d4989494b3a4
Time: 2019-08-25
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data


Project Name: uber/ludwig
Commit Name: 7d9db23a389499c2764fb850cd19f853cc3e8565
Time: 2019-08-08
Author: smiryala@uber.com
File Name: ludwig/features/image_feature.py
Class Name: ImageBaseFeature
Method Name: add_feature_data