Builds MeasuredProcess
for weights of model returned by model_fn
.
tff.learning.framework.build_encoded_broadcast_process_from_model(
model_fn: tff.learning.Model
,
encoder_fn: _EncoderConstructor
) -> tff.templates.MeasuredProcess
Used in the notebooks
This method creates a SimpleEncoder
for every weight of model created by
model_fn
, as returned by encoder_fn
.
Args |
model_fn
|
A Python callable with no arguments function that returns a
tff.learning.Model .
|
encoder_fn
|
A Python callable with a single argument, which is expected to
be a tf.Tensor of shape and dtype to be encoded. The function must
return a tensor_encoding.core.SimpleEncoder , which expects a tf.Tensor
with compatible type as the input to its encode method.
|
Returns |
A MeasuredProcess for encoding and broadcasting the weights of model
created by model_fn .
|
Raises |
TypeError
|
If model_fn or encoder_fn are not callable objects.
|