def test_config(): # mcc object mcc1 = MatthewsCorrelationCoefficient(num_classes=1) assert mcc1.num_classes == 1 assert mcc1.dtype == tf.float32 # check configure mcc2 = MatthewsCorrelationCoefficient.from_config(mcc1.get_config()) assert mcc2.num_classes == 1 assert mcc2.dtype == tf.float32
def test_config(self): # mcc object mcc1 = MatthewsCorrelationCoefficient(num_classes=1) self.assertEqual(mcc1.num_classes, 1) self.assertEqual(mcc1.dtype, tf.float32) # check configure mcc2 = MatthewsCorrelationCoefficient.from_config(mcc1.get_config()) self.assertEqual(mcc2.num_classes, 1) self.assertEqual(mcc2.dtype, tf.float32)