fair_forge.utils¶
Utility functions for Fair Forge.
Functions
|
Yield slices of indices for batching data. |
Create a random state that is reproducible across Python versions and platforms. |
- fair_forge.utils.batched(len_data: int, batch_size: int, *, drop_last: bool = False) Generator[slice, None, None] [source]¶
Yield slices of indices for batching data.
- Parameters:
len_data – The total number of data points.
batch_size – The size of each batch.
drop_last – If True, the last batch will be dropped if it is smaller than batch_size.