def personalization_eval(server_model_weights, federated_client_input): """TFF orchestration logic.""" client_init_weights = intrinsics.federated_broadcast( server_model_weights) client_final_metrics = intrinsics.federated_map( _client_computation, (client_init_weights, federated_client_input)) # WARNING: Collecting information from clients can be risky. Users have to # make sure that it is proper to collect those metrics from clients. # TODO(b/147889283): Add a link to the TFF doc once it exists. results = federated_aggregations.federated_sample( client_final_metrics, max_num_clients) return results
def call_federated_sample(value): return federated_aggregations.federated_sample(value)