TFF: Does TFF support any other models except neurel networks?

Viewed 96

I'm trying to make a comparison between different federated learning frameworks. When looking on the TFF site, I could not find any information about which models are supported. Looking at the 'model' API they only talked about weights,...

Am I missing something or can TFF not be used for other models except neural networks?

2 Answers

You can also use Keras models, which is not limited to neural networks.

A Keras model can be converted to the tff.learning.Model format using tff.learning.from_keras_model, and this can be used together with the higher level computations like tff.learning.build_federated_averaging_process. For an example of logistic regression in TFF, see for instance https://github.com/google-research/federated/tree/master/optimization/stackoverflow_lr

I also second the other answer, you can write essentially anything if needed.

TFF has conceptually two levels of API:

The low level Federated Core API of TFF supports arbitrary computation on scalars, vectors, matrices, etc; doing anything TensorFlow can do. The notion of a model is not inherit at this level and there is greater freedom. The Custom Federated Algorithms, Part 1: Introduction to the Federated Core tutorial is a good introduction.

The higher level Federated Learning API is built on top of the Federated Core API and starts to add assumptions/constraints. For example the provided FedAvg algorithm implementation mostly expects backprop style training on a model's forward pass. Other federated algorithms are definitely interesting, but may need to be build on the Federated Core API.

Related