70e4855f5608c4481dfffd5f762e310d631d06c3,test_model_CAM.py,,returnCAM,#Any#Any#Any#,45

Before Change


    nc, h, w = feature_conv.shape
    output_cam = []
    for idx in class_idx:
        cam = weight_softmax[class_idx].dot(feature_conv.reshape((nc, h*w)))
        cam = cam.reshape(h, w)
        cam = cam - np.min(cam)
        cam_img = cam / np.max(cam)
        cam_img = np.uint8(255 * cam_img)
        output_cam.append(imresize(cam_img, size_upsample))
    return output_cam

After Change


    output_cam = []
    for idx in class_idx:
        cam = (weight_softmax[class_idx]@feature_conv.view(nc, h*w))
        cam.add_(-cam.min()).div_(cam.max()).mul_(255)
        cam = F.interpolate(cam.view(1,1,h,w), size=size_upsample, mode="bilinear",
                            align_corners=False).squeeze()
        cam = np.uint8(cam.numpy())
        output_cam.append(cam)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: metalbubble/moments_models
Commit Name: 70e4855f5608c4481dfffd5f762e310d631d06c3
Time: 2020-10-09
Author: mmonfort@mit.edu
File Name: test_model_CAM.py
Class Name:
Method Name: returnCAM


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 5c38bd81f92f4fb3dc29c8a69c84027b95d694af
Time: 2018-03-31
Author: petrochukm@gmail.com
File Name: torchnlp/nn/sru.py
Class Name: SRU_Compute
Method Name: backward


Project Name: kymatio/kymatio
Commit Name: b37fdf43bd950c4872d8ea39975d98a1b5d75866
Time: 2019-03-02
Author: github@jan-schlueter.de
File Name: kymatio/scattering2d/backend/backend_torch.py
Class Name:
Method Name: cdgmm


Project Name: cornellius-gp/gpytorch
Commit Name: 308a18094d31d5cd2fbb7d942212669141dd8cec
Time: 2019-04-01
Author: jake.gardner@uber.com
File Name: gpytorch/utils/cholesky.py
Class Name:
Method Name: psd_safe_cholesky