![]() |
Libraries for building federated learning algorithms.
Currently, tff.learning
provides a few types of functionality.
- Algorithmic building blocks (see
tff.learning.templates
) for constructing federated learning algorithms. These are algorithms centered around the client work, server work, broadcast, or aggregation steps of a federated algorithms, and are intended to compose in a somewhat modular fashion. - End-to-end federated learning algorithms (such as
tff.learning.algorithms.build_weighted_fed_avg
) that combine broadcast, client work, aggregation, and server update logic into a single algorithm (often by composing the building blocks discussed above). This library also provides end-to-end algorithms for federated evaluation (seetff.learning.build_federated_evaluation
). - Functionality supporting the development of the algorithms above. This
includes
tff.learning.optimizers
,tff.learning.metrics
and recommended aggregators, such astff.learning.robust_aggregator
.
The library also contains classes of models that are used for the purposes of
model training. See tff.learning.models.VariableModel
for the overall base
class, and
tff.learning.models
for related model classes.
Modules
algorithms
module: Libraries providing implementations of federated learning algorithms.
framework
module: Libraries for developing federated learning algorithms.
metrics
module: Libraries for working with metrics in federated learning algorithms.
models
module: Libraries for working with models in federated learning algorithms.
optimizers
module: Libraries for optimization algorithms.
programs
module: Package of methods for compositional federated program logic.
reconstruction
module: Libraries for using federated reconstruction algorithms.
templates
module: Libraries of specialized processes used for building learning algorithms.
Classes
class BatchOutput
: A structure that holds the output of a tff.learning.models.VariableModel
.
class ClientWeighting
: Enum for built-in methods for weighing clients.
class Model
: Represents a variable-based model for use in TensorFlow Federated.
class ModelWeights
: A container for the trainable and non-trainable variables of a Model
.
Functions
add_debug_measurements(...)
: Adds measurements suitable for debugging learning processes.
add_debug_measurements_with_mixed_dtype(...)
: Adds measurements suitable for debugging learning processes.
build_federated_evaluation(...)
: Builds the TFF computation for federated evaluation of the given model.
build_local_evaluation(...)
: Builds the local TFF computation for evaluation of the given model.
build_personalization_eval(...)
: Builds the TFF computation for evaluating personalization strategies.
compression_aggregator(...)
: Creates aggregator with compression and adaptive zeroing and clipping.
ddp_secure_aggregator(...)
: Creates aggregator with adaptive zeroing and distributed DP.
dp_aggregator(...)
: Creates aggregator with adaptive zeroing and differential privacy.
entropy_compression_aggregator(...)
: Creates an aggregation factory for quantization and entropy coding.
federated_aggregate_keras_metric(...)
: Aggregates variables a keras metric placed at CLIENTS to SERVER.
robust_aggregator(...)
: Creates aggregator for mean with adaptive zeroing and clipping.
secure_aggregator(...)
: Creates secure aggregator with adaptive zeroing and clipping.
state_with_new_model_weights(...)
: Returns a ServerState
with updated model weights.