b6443232013e8d248fe26f59630d43bc9688df06,losses.py,,loss,#Any#Any#Any#Any#,25
Before Change
targets = torch.stack((targets_dx, targets_dy, targets_dw, targets_dh))
targets = targets.t()
targets = targets/torch.Tensor([[0.2, 0.2, 0.3, 0.3]]).cuda()
negative_indices = 1 - positive_indices
//import pdb
After Change
if positive_indices.sum() > 0:
regression_losses.append(regression_loss[positive_indices, :].mean())
else:
regression_losses.append(torch.Tensor([0]).float().cuda())
return torch.stack(classification_losses).mean(), torch.stack(regression_losses).mean()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: yhenon/pytorch-retinanet
Commit Name: b6443232013e8d248fe26f59630d43bc9688df06
Time: 2018-04-29
Author: yannhenon@gmail.com
File Name: losses.py
Class Name:
Method Name: loss
Project Name: rusty1s/pytorch_geometric
Commit Name: ab1d74868183e211b8ae7aa155cdcbb5f43843d8
Time: 2020-05-27
Author: matthias.fey@tu-dortmund.de
File Name: examples/cluster_gcn.py
Class Name:
Method Name: test
Project Name: pyannote/pyannote-audio
Commit Name: 7f2dc586fb15ef4afc58e5468ee41c4339762876
Time: 2018-02-21
Author: bredin@limsi.fr
File Name: pyannote/audio/embedding/approaches/triplet_loss.py
Class Name: TripletLoss
Method Name: fit