09.05.2023 Views

pdfcoffee

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TensorFlow for Mobile and IoT and TensorFlow.js

Each device runs the local training and sends a model update back to the global

services. Note that each device has an FL runtime providing federated learning

services to an app process that stores data in a local example store. The FL runtime

fetches the training examples from the example store:

Figure 11: An example of federated learning architecture

TensorFlow FL APIs

The TensorFlow Federated (TTF) platform has two layers:

• Federated learning (FL), a high-level interface that works well with

tf.keras and non tf.keras models. In the majority of situations you will

use this API for distributed training that is privacy preserving.

• Federated core (FC), a low-level interface that is highly customizable and

allows you to interact with low level communications and with federated

algorithms. You will need this API only if you intend to implement new and

sophisticated distributed learning algorithms. This topic is rather advanced,

and we are not going to cover it in this book. If you wish to learn more,

you can find more information online (https://www.tensorflow.org/

federated/federated_core).

The FL API has three key parts:

1. Models: Used to wrap existing models for enabling federating learning.

This can be achieved via the tff.learning.from_keras_model(), or via

subclassing of tff.learning.Model(). For instance, you can have the

following code fragment:

[ 476 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!