Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tff.learning.ModelWeights

View source on GitHub

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

tff.learning.ModelWeights(
    trainable, non_trainable
)

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.

Methods

assign_weights_to

View source

assign_weights_to(
    keras_model
)

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

Args:

from_model

View source

@classmethod
from_model(
    cls, model
)

from_tff_result

View source

@classmethod
from_tff_result(
    cls, anon_tuple
)

Class Variables

  • non_trainable
  • trainable