jax_privacy.batch_selection.BatchSelectionStrategy

class jax_privacy.batch_selection.BatchSelectionStrategy[source]

Bases: ABC

Abstract base class for batch selection strategies.

A batch selection strategy is a function that takes a random number generator and returns an iterator of batches of data indices. The strategy can either be deterministic or random, it may produce equal-sized batches or variable-sized batches. Note that the batches of indices, which specify which examples contribute in which iterations, are generally considered sensitive, and should not be inspected directly.

This API does not prescribe a specific dataset format, but it is expected that the format used supports efficient random access to individual examples.

Methods

__init__

batch_iterator

Yields 1D batches of data indices.

abstractmethod batch_iterator(num_examples, rng=None)[source]

Yields 1D batches of data indices.

Return type:

Iterator[ndarray]