Module: tff.learning.models

Libraries for working with models in federated learning algorithms.

Classes

class BatchOutput: A structure that holds the output of a tff.learning.models.VariableModel.

class FunctionalModel: A model that parameterizes forward pass by model weights.

class ModelWeights: A container for the trainable and non-trainable variables of a Model.

class ReconstructionModel: Represents a reconstruction model for use in Tensorflow Federated.

class VariableModel: Represents a variable-based model for use in TensorFlow Federated.

Functions

from_keras_model(...)

functional_model_from_keras(...): Converts a tf.keras.Model to a tff.learning.models.FunctionalModel.

load(...): Deserializes a TensorFlow SavedModel at path to a tff.learning.models.VariableModel.

load_functional_model(...): Deserializes a TensorFlow SavedModel at path to a functional model.

model_from_functional(...): Converts a FunctionalModel to a tff.learning.models.VariableModel.

save(...): Serializes model as a TensorFlow SavedModel to path.

save_functional_model(...): Serializes a FunctionalModel as a tf.SavedModel to path.

weights_type_from_model(...): Creates a tff.Type from a tff.learning.models.VariableModel or callable that constructs a model.

Type Aliases

ReconstructionDatasetSplitFn