# Module: tff.learning.templates

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Libraries of specialized processes used for building learning algorithms.

## Classes

[`class ClientResult`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/ClientResult): A structure containing the result of [`ClientWorkProcess.next`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/IterativeProcess#next) computation.

[`class ClientWorkProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/ClientWorkProcess): A stateful process capturing work at clients during learning.

[`class DistributionProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/DistributionProcess): A stateful process that distributes values.

[`class FinalizerProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/FinalizerProcess): A stateful process for finalization of a round of training.

[`class LearningAlgorithmState`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/LearningAlgorithmState): A structure representing the state of a learning process.

[`class LearningProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/LearningProcess): A stateful process for learning tasks that produces metrics.

[`class LearningProcessOutput`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/LearningProcessOutput): A structure containing the output of a [`LearningProcess.next`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/LearningProcess#next) computation.

## Functions

[`build_apply_optimizer_finalizer(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/build_apply_optimizer_finalizer): Builds finalizer that applies a step of an optimizer.

[`build_broadcast_process(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/build_broadcast_process): Builds `DistributionProcess` directly broadcasting values.

[`build_functional_model_delta_client_work(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/build_functional_model_delta_client_work): Creates a `ClientWorkProcess` for federated averaging.

[`build_model_delta_client_work(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/build_model_delta_client_work): Creates a `ClientWorkProcess` for federated averaging.

[`compose_learning_process(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/compose_learning_process): Composes specialized measured processes into a learning process.

[`reject_non_finite_update(...)`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/templates/reject_non_finite_update): Rejects the update if any non-finite value is in the update.