class_docstr: We could also write
  
  .. code::
  
      ds = dataset.Mnist('train')
      ds = JoinData([ds, ds])
      ds = MapData(ds, lambda dp: [dp[0], dp[2], dp[1] == dp[3]])
      ds = BatchData(ds, 128 // 2)
  
  but then the positives pairs would be really rare (p=0.1).
class_docstr_tok: ["We","could","also","write","..","code",":",":","ds","=","dataset.Mnist","(","'train","'",")","ds","=","JoinData","(","[","ds",",","ds","]",")","ds","=","MapData","(","ds",",","lambda","dp",":","[","dp","[","0","]",",","dp","[","2","]",",","dp","[","1","]","==","dp","[","3","]","]",")","ds","=","BatchData","(","ds",",","128","\/\/","2",")","but","then","the","positives","pairs","would","be","really","rare","(","p=0.1",")","."]
code: def __init__(self, train_or_test):
      super(MnistPairs, self).__init__(train_or_test, shuffle=False)
      # now categorize these digits
      self.data_dict = get_digits_by_label(self.images, self.labels)
  
file_path: tensorpack/examples/SimilarityLearning/embedding_data.py
imports: import numpy
  from tensorpack.dataflow import BatchData, dataset
label_desc: Use image node_id 1 to create a new MnistPairs object from inherited base classes: dataset with example: obj = MnistPairs(train_or_test)