TensorFlow 2.0 Beta is available Learn more

tff.learning.framework.ModelWeights

Class ModelWeights

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

Defined in python/learning/model_utils.py.

Note this does not include the model's local variables.

It may also be used to hold other values that are parallel to these variables, e.g., tensors corresponding to variable values, or updates to model variables.

Properties

trainable

non_trainable

Methods

assign_weights_to

assign_weights_to(keras_model)

Assign these TFF model weights to the weights of a tf.keras.Model.

Args:

  • keras_model: the tf.keras.Model object to assign weights to.

from_model

@classmethod
from_model(
    cls,
    model
)

from_tff_value

@classmethod
from_tff_value(
    cls,
    anon_tuple
)