crested.tl.data.AnnDataLoader#
- class crested.tl.data.AnnDataLoader(dataset, batch_size, shuffle=False, drop_remainder=True)#
Pytorch-like DataLoader class for AnnDataset with options for batching, shuffling, and one-hot encoding.
- Parameters:
dataset (
AnnDataset
) – The dataset instance provided.batch_size (
int
) – Number of samples per batch.shuffle (
bool
(default:False
)) – Indicates whether shuffling is enabled.drop_remainder (
bool
(default:True
)) – Indicates whether to drop the last incomplete batch.
Examples
>>> dataset = AnnDataset(...) # Your dataset instance >>> batch_size = 32 >>> dataloader = AnnDataLoader( ... dataset, batch_size, shuffle=True, drop_remainder=True ... ) >>> for x, y in dataloader.data: ... # Your training loop here
Attributes table#
Return the dataset as a tf.data.Dataset instance. |
Methods table#
Attributes#
- AnnDataLoader.data#
Return the dataset as a tf.data.Dataset instance.