scalex.data.BatchSampler

class scalex.data.BatchSampler(batch_size, batch_id, drop_last=False)

Batch-specific Sampler sampled data of each batch is from the same dataset.

__init__(batch_size, batch_id, drop_last=False)

create a BatchSampler object

Parameters:
  • batch_size – batch size for each sampling

  • batch_id – batch id of all samples

  • drop_last – drop the last samples that not up to one batch

Methods

__init__(batch_size, batch_id[, drop_last])

create a BatchSampler object