class_docstr: Upon initialization, this will create num_triplets triplets based on
  the labels provided in labels_to_indices. This is for experimental purposes,
  to see how algorithms perform when the only ground truth is a set of
  triplets, rather than having explicit labels.
docstr: This creates self.fixed_set_of_triplets, which is a numpy array of size
  (num_triplets, 3). Each row is a triplet of indices: (a, p, n), where
  a=anchor, p=positive, and n=negative. Each triplet is created by first
  randomly sampling two classes, then randomly sampling an anchor, positive,
  and negative.
docstr_tok: ["This","creates","self.fixed_set_of_triplets",",","which","is","a","numpy","array","of","size","(","num_triplets",",","3",")",".","Each","row","is","a","triplet","of","indices",":","(","a",",","p",",","n",")",",","where","a=anchor",",","p=positive",",","and","n=negative",".","Each","triplet","is","created","by","first","randomly","sampling","two","classes",",","then","randomly","sampling","an","anchor",",","positive",",","and","negative","."]
code: def create_fixed_set_of_triplets(self):
      """
      This creates self.fixed_set_of_triplets, which is a numpy array of size
      (num_triplets, 3). Each row is a triplet of indices: (a, p, n), where
      a=anchor, p=positive, and n=negative. Each triplet is created by first
      randomly sampling two classes, then randomly sampling an anchor, positive,
      and negative.
      """
      assert self.num_triplets > 0
      self.fixed_set_of_triplets = (
          np.ones((self.num_triplets, 3), dtype=int) * -1
      )
      label_list = list(self.labels_to_indices.keys())
      for i in range(self.num_triplets):
          anchor_label, negative_label = c_f.NUMPY_RANDOM.choice(
              label_list, size=2, replace=False
          )
          anchor_list = self.labels_to_indices[anchor_label]
          negative_list = self.labels_to_indices[negative_label]
          anchor, positive = c_f.safe_random_choice(anchor_list, size=2)
          negative = c_f.NUMPY_RANDOM.choice(
              negative_list, replace=False
          )
          self.fixed_set_of_triplets[i, :] = np.array(
              [anchor, positive, negative]
          )
  
file_path: pytorch-metric-learning/src/pytorch_metric_learning/samplers/fixed_set_of_triplets.py
imports: import numpy
  import torch
  from torch.utils.data.sampler import Sampler
  from ..utils import common_functions
label_desc: Use image node_id 4 for calling the FixedSetOfTriplets obj's underlying member method code with example usage: obj.create_fixed_set_of_triplets() without return types