I want to evaluate my federated learning model using tff.learning.build_federated_evaluation
. Initially, got reasonable results. but can I run the evaluation process for multiple rounds (as in the training phase done here) to get more stable results?
The evaluation code is provided below.
train, test = source.train_test_client_split(source, 2,seed=0)
test_client_ids = test.client_ids
test_data= [test.create_tf_dataset_from_all_clients().map(reshape_data)
.batch(batch_size=10)
for c in test_client_ids]
eval_process=tff.learning.build_federated_evaluation(model_fn)
eval_process(state.model, test_data)
The evaluation output.
OrderedDict([('eval',
OrderedDict([('sparse_categorical_accuracy', 0.53447974),
('loss', 1.0230521),
('num_examples', 11514),
('num_batches', 1152)]))])