From 9726fc6f8137093c01d20a7a268839b840e004fc Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Fri, 24 Feb 2023 18:28:22 -0600 Subject: [PATCH] Fix name of f1_score. --- src/TensorFlowNET.Core/Keras/Metrics/IMetricsApi.cs | 2 +- src/TensorFlowNET.Keras/Metrics/MetricsApi.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TensorFlowNET.Core/Keras/Metrics/IMetricsApi.cs b/src/TensorFlowNET.Core/Keras/Metrics/IMetricsApi.cs index 271ca6e1..b814a259 100644 --- a/src/TensorFlowNET.Core/Keras/Metrics/IMetricsApi.cs +++ b/src/TensorFlowNET.Core/Keras/Metrics/IMetricsApi.cs @@ -78,7 +78,7 @@ public interface IMetricsApi IMetricFunc F1Score(int num_classes, string? average = null, float threshold = -1f, - string name = "fbeta_score", + string name = "f1_score", TF_DataType dtype = TF_DataType.TF_FLOAT); /// diff --git a/src/TensorFlowNET.Keras/Metrics/MetricsApi.cs b/src/TensorFlowNET.Keras/Metrics/MetricsApi.cs index 5230fe59..b9fbe180 100644 --- a/src/TensorFlowNET.Keras/Metrics/MetricsApi.cs +++ b/src/TensorFlowNET.Keras/Metrics/MetricsApi.cs @@ -86,7 +86,7 @@ public IMetricFunc CosineSimilarity(string name = "cosine_similarity", TF_DataType dtype = TF_DataType.TF_FLOAT, Axis? axis = null) => new CosineSimilarity(name: name, dtype: dtype, axis: axis ?? -1); - public IMetricFunc F1Score(int num_classes, string? average = null, float threshold = -1, string name = "fbeta_score", TF_DataType dtype = TF_DataType.TF_FLOAT) + public IMetricFunc F1Score(int num_classes, string? average = null, float threshold = -1, string name = "f1_score", TF_DataType dtype = TF_DataType.TF_FLOAT) => new F1Score(num_classes, average: average, threshold: threshold, name: name, dtype: dtype); public IMetricFunc FBetaScore(int num_classes, string? average = null, float beta = 0.1F, float threshold = -1, string name = "fbeta_score", TF_DataType dtype = TF_DataType.TF_FLOAT)