class_docstr: Custom ``Sampler`` for bulk-sampling approximate negative items in ``Interactions`` data.
  
  Parameters
  ----------
  interactions: Interactions
  batch_size: int
      Number of samples per batch to load
  shuffle: bool
      Whether to shuffle the order of batches returned or not. This is especially useful for
      training data to ensure the model does not overfit to a specific order of data
  seed: int
      Seed for shuffling if ``shuffle is True``
class_docstr_tok: ["Custom","``","Sampler","``","for","bulk-sampling","approximate","negative","items","in","``","Interactions","``","data",".","Parameters","--","--","--","--","--","interactions",":","Interactions","batch_size",":","int","Number","of","samples","per","batch","to","load","shuffle",":","bool","Whether","to","shuffle","the","order","of","batches","returned","or","not",".","This","is","especially","useful","for","training","data","to","ensure","the","model","does","not","overfit","to","a","specific","order","of","data","seed",":","int","Seed","for","shuffling","if","``","shuffle","is","True","``"]
docstr: Setup iteration through ``ApproximateNegativeSamplingInteractionsDataLoader`` data.
docstr_tok: ["Setup","iteration","through","``","ApproximateNegativeSamplingInteractionsDataLoader","``","data","."]
code: def __iter__(self) -> "ApproximateNegativeSampler":
      """Setup iteration through ``ApproximateNegativeSamplingInteractionsDataLoader`` data."""
      if self.shuffle:
          np.random.shuffle(self.iteration_order)
  
      # reset pointer
      self._pointer = 0
  
      return self
  
file_path: collie/collie/interactions/samplers.py
imports: import math
  import random
  from typing import List, Optional, Tuple
  import numpy
  import torch
  from collie.interactions.datasets import HDF5Interactions, Interactions
label_desc: Use image node_id 2 for calling the ApproximateNegativeSampler obj's underlying member method code with example usage: obj.__iter__() and returns: self