ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more

Module: tff.simulation

Libraries for running TensorFlow Federated simulations.


datasets module: Datasets for running TensorFlow Federated simulations.

models module: Models for running TensorFlow Federated simulations.


class CSVMetricsManager: Utility class for saving/loading experiment metrics via a CSV file.

class FileCheckpointManager: A checkpoint manager backed by a file system.

class MetricsManager: An abstract base class for metrics managers.

class TensorBoardManager: Utility class for saving metrics using tf.summary.


build_uniform_sampling_fn(...): Builds the function for sampling from the input iterator at each round.

compose_dataset_computation_with_computation(...): Builds a new tff.Computation which constructs datasets on clients.

compose_dataset_computation_with_iterative_process(...): Builds a new iterative process which constructs datasets on clients.

run_server(...): Runs a gRPC server hosting a simulation component in this process.

run_simulation(...): Runs a federated training simulation for a given iterative process.

run_simulation_with_callbacks(...): Runs federated training for a given tff.templates.IterativeProcess.

server_context(...): Context manager yielding gRPC server hosting simulation component.

TRAIN_STEPS_PER_HOUR_KEY 'train_steps_per_hour'
TRAIN_STEP_TIME_KEY 'train_step_time_in_seconds'
VALIDATION_TIME_KEY 'validation/validation_time_in_seconds'