nip.utils.torch.FastForwardableBatchSampler#
- class nip.utils.torch.FastForwardableBatchSampler(sampler: Sampler[int] | Iterable[int], batch_size: int, drop_last: bool, initial_skip: int = 0)[source]#
A batch sampler which can skip an initial number of items.
See the docs for PyTorch’s
BatchSampler
for details.- Parameters:
sampler (Sampler[int] | Iterable[int]) – Base sampler. Can be any iterable object
batch_size (int) – The size of the mini-batch
drop_last (bool) – If
True
, the sampler will drop the last batch if its size would be less thanbatch_size
initial_skip (int, default=0) – The number of items to skip at the start of the sampler.
Methods Summary
Methods