I use TFF version 0.12.0 In order to compute performance of model, I would like to add (with accuracy ) sensitivity and specificity metrics,
def specificity
...
def create_compiled_keras_model():
....
model.compile(optimizer=tf.keras.optimizers.SGD(lr=0.001, momentum =0.9),
loss=tf.keras.losses.BinaryCrossentropy(),
metrics=([tf.keras.metrics.BinaryAccuracy()], sensitivity, specificity))
return model
I found this error:
TypeError: Type of `metrics` argument not understood. Expected a list or dictionary, found: ([<tensorflow.python.keras.metrics.BinaryAccuracy object at 0x7fb5b0711748>], <function sensitivity at 0x7fb6adf45e18>, <function specificity at 0x7fb5fdaf5f28>)
So how can I add metrics in Tensorflow federated Thanks