class_docstr: Returns triplets that form an angle greater than some threshold (angle).
  The angle is computed as defined in the angular loss paper:
  https://arxiv.org/abs/1708.01682
class_docstr_tok: ["Returns","triplets","that","form","an","angle","greater","than","some","threshold","(","angle",")",".","The","angle","is","computed","as","defined","in","the","angular","loss","paper",":","https",":","\/\/arxiv.org\/abs\/1708.01682"]
code: def mine(self, embeddings, labels, ref_emb, ref_labels):
      (
          anchor_idx,
          positive_idx,
          negative_idx,
      ) = lmu.get_all_triplets_indices(labels, ref_labels)
      anchors, positives, negatives = (
          embeddings[anchor_idx],
          ref_emb[positive_idx],
          ref_emb[negative_idx],
      )
      centers = (anchors + positives) / 2
      ap_dist = self.distance.pairwise_distance(anchors, positives)
      nc_dist = self.distance.pairwise_distance(negatives, centers)
      angles = torch.atan(ap_dist / (2 * nc_dist))
      threshold_condition = angles > self.angle
      self.set_stats(angles, threshold_condition)
      return (
          anchor_idx[threshold_condition],
          positive_idx[threshold_condition],
          negative_idx[threshold_condition],
      )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/miners/angular_miner.py
imports: import numpy
  import torch
  from ..distances import LpDistance
  from ..utils import common_functions
  from ..utils import loss_and_miner_utils
  from .base_miner import BaseMiner
label_desc: Use image node_id 2 for calling the AngularMiner obj's underlying member method code with example usage: obj.mine(embeddings, labels, ref_emb, ref_labels) and returns: anchor_idx,  positive_idx,  negative_idx