Watch talks from the 2019 TensorFlow Dev Summit Watch now

tff.learning.framework.ModelWeights

Class ModelWeights

Defined in learning/model_utils.py.

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

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.

__new__

@staticmethod
__new__(
    cls,
    trainable,
    non_trainable
)

Properties

trainable

non_trainable

keras_weights

Returns a list of weights in the same order as tf.keras.Model.weights.

(Assuming that this ModelWeights object corresponds to the weights of a keras model).

Methods

from_model

@classmethod
from_model(
    cls,
    model
)

from_tff_value

@classmethod
from_tff_value(
    cls,
    anon_tuple
)