class_docstr: Custom ``Sampler`` for HDF5 data, with each sampled item being a start index and a batch size
  to use in ``HDF5Interactions.__getitem__``.
  
  Parameters
  ----------
  hdf5_interactions: HDF5Interactions
  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. Note that
      this will not perform a true shuffle of the data, but will instead shuffle the order of
      batches. While this is an approximation of true sampling, it allows us a greater speed up
      during model training for a negligible effect on model performance
  seed: int
      Seed for shuffling if ``shuffle is True``
class_docstr_tok: ["Custom","``","Sampler","``","for","HDF5","data",",","with","each","sampled","item","being","a","start","index","and","a","batch","size","to","use","in","``","HDF5Interactions.__getitem__","``",".","Parameters","--","--","--","--","--","hdf5_interactions",":","HDF5Interactions","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",".","Note","that","this","will","not","perform","a","true","shuffle","of","the","data",",","but","will","instead","shuffle","the","order","of","batches",".","While","this","is","an","approximation","of","true","sampling",",","it","allows","us","a","greater","speed","up","during","model","training","for","a","negligible","effect","on","model","performance","seed",":","int","Seed","for","shuffling","if","``","shuffle","is","True","``"]
docstr: Number of batches returned in the sampler.
docstr_tok: ["Number","of","batches","returned","in","the","sampler","."]
code: def __len__(self) -> int:
      """Number of batches returned in the sampler."""
      return math.ceil(len(self.hdf5_interactions) / self.batch_size)
  
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 4 for calling the HDF5Sampler obj's underlying member method code with example usage: obj.__len__() and returns: math