![]() |
Builds the local TFF computation for evaluation of the given model.
tff.learning.build_local_evaluation(
model_fn: Callable[[], tff.learning.Model
],
model_weights_type: tff.types.StructType
,
batch_type: tff.types.Type
,
use_experimental_simulation_loop: bool = False
) -> tff.Computation
This produces an unplaced function that evaluates a
tff.learning.models.VariableModel
on a tf.data.Dataset
. This function can be mapped to placed data, i.e.
is mapped to client placed data in build_federated_evaluation
.
The TFF type notation for the returned computation is:
(<M, D*> → <local_outputs=N, num_examples=tf.int64>)
Where M
is the model weights type structure, D
is the type structure of a
single data point, and N
is the type structure of the local metrics.
Args | |
---|---|
model_fn
|
A no-arg function that returns a
tff.learning.models.VariableModel .
|
model_weights_type
|
The tff.Type of the model parameters that will be used
to initialize the model during evaluation.
|
batch_type
|
The type of one entry in the dataset. |
use_experimental_simulation_loop
|
Controls the reduce loop function for input dataset. An experimental reduce loop is used for simulation. |
Returns | |
---|---|
A federated computation (an instance of tff.Computation ) that accepts
model parameters and sequential data, and returns the evaluation metrics.
|