BatchIterator¶
-
class
BatchIterator(batch_size: int = 32, shuffle: bool = True)¶ Bases:
bluebird.data.DataIteratorDefault iterator, returns batches of input, target pairs.
Batches are randomized by default.
Example:
iterator = BatchIterator() for batch in iterator(Data): # do something
__call__(inputs: Tensor, targets: Tensor) -> Iterator[Batch]:Returns batches of data.
- Args:
inputs (
Tensor): input to the network targets (Tensor): expected value- Returns:
Iterator[Batch]: Batches of data
-
__init__(batch_size: int = 32, shuffle: bool = True) → None¶ Initalizes the object.
- Parameters
batch_size (int) – length of every batch size, defaults to 32
shuffle (bool) – shuffles data if true, defaults to True
Methods
__init__([batch_size, shuffle])Initalizes the object.