def test_client_update_with_non_finite_delta(self):
     client_dataset = create_dataset(has_nan=True)
     model = model_builder()
     client_optimizer = tf.keras.optimizers.SGD(0.1)
     client_update = fed_avg_schedule.create_client_update_fn()
     outputs = client_update(model, client_dataset,
                             fed_avg_schedule._get_weights(model),
                             client_optimizer)
     self.assertAllEqual(self.evaluate(outputs.client_weight), 0)
Exemplo n.º 2
0
 def test_client_update_with_non_finite_delta(self):
     federated_data = [_batch_fn(has_nan=True)]
     model = _uncompiled_model_builder()
     client_optimizer = tf.keras.optimizers.SGD(0.1)
     client_update = fed_avg_schedule.create_client_update_fn()
     outputs = client_update(model, federated_data,
                             fed_avg_schedule._get_weights(model),
                             client_optimizer)
     self.assertAllEqual(self.evaluate(outputs.client_weight), 0)