Hi everyone,
why could I get the same values in all rounds iterative_process.next?
train_client_ids: [[1.0], [8.0], [9.0], [5.0], [6.0]]
def create_tf_dataset_for_client_fn(client_id):
…
I checked return, everythung is working properly
train_data_tf = tff.simulation.datasets.ClientData.from_clients_and_tf_fn(
client_ids=train_client_ids,
serializable_dataset_fn=create_tf_dataset_for_client_fn
)
test_data_tf = tff.simulation.datasets.ClientData.from_clients_and_tf_fn(
client_ids=test_client_ids,
serializable_dataset_fn=create_tf_dataset_for_client_fn
)
def make_federated_data(client_data, client_ids):
return [
client_data.create_tf_dataset_for_client(x)
for x in client_ids
]
federated_train_data = make_federated_data(train_data_tf, train_client_ids) #all clients handled, all ok
def create_tff_model(): #I changed the parameters of the model, the result does not change
…
iterative_process = tff.learning.build_federated_averaging_process(
model_fn,
client_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=0.01),
server_optimizer_fn=lambda: tf.keras.optimizers.SGD(learning_rate=1.0)
)
state = iterative_process.initialize()
NUM_ROUNDS = 6
for round_num in range(1, NUM_ROUNDS):
state, metrics = iterative_process.next(state, federated_train_data)
print(‘round {:2d}, metrics={}’.format(round_num, metrics))
print(metrics[‘train’][‘loss’])
I got any errors, all funktions is working, but at the ends I sot the same accuracy and loss values in all rounds?
Thank you for your help and ideas.