Skip to content

Commit

Permalink
Example title two times removed in regression_metrics.py (#20565)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhantule authored Nov 29, 2024
1 parent 1d5774e commit 461fbf3
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions keras/src/metrics/regression_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class MeanSquaredError(reduction_metrics.MeanMetricWrapper):
dtype: (Optional) data type of the metric result.
Example:
>>> m = keras.metrics.MeanSquaredError()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
>>> m.result()
Expand Down Expand Up @@ -64,6 +63,7 @@ class MeanAbsoluteError(reduction_metrics.MeanMetricWrapper):
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
>>> m.result()
0.25
>>> m.reset_state()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
... sample_weight=[1, 0])
Expand Down Expand Up @@ -103,14 +103,12 @@ class MeanAbsolutePercentageError(reduction_metrics.MeanMetricWrapper):
name: (Optional) string name of the metric instance.
dtype: (Optional) data type of the metric result.
Example:
Example:
Examples:
>>> m = keras.metrics.MeanAbsolutePercentageError()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
>>> m.result()
250000000.0
>>> m.reset_state()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
... sample_weight=[1, 0])
Expand Down Expand Up @@ -150,14 +148,13 @@ class MeanSquaredLogarithmicError(reduction_metrics.MeanMetricWrapper):
name: (Optional) string name of the metric instance.
dtype: (Optional) data type of the metric result.
Example:
Example:
Examples:
>>> m = keras.metrics.MeanSquaredLogarithmicError()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
>>> m.result()
0.12011322
>>> m.reset_state()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
... sample_weight=[1, 0])
Expand Down Expand Up @@ -197,9 +194,7 @@ class RootMeanSquaredError(reduction_metrics.Mean):
name: (Optional) string name of the metric instance.
dtype: (Optional) data type of the metric result.
Example:
Example:
Examples:
>>> m = keras.metrics.RootMeanSquaredError()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
Expand Down Expand Up @@ -270,8 +265,7 @@ class CosineSimilarity(reduction_metrics.MeanMetricWrapper):
axis: (Optional) Defaults to `-1`. The dimension along which the cosine
similarity is computed.
Example:
Examples:
>>> # l2_norm(y_true) = [[0., 1.], [1./1.414, 1./1.414]]
>>> # l2_norm(y_pred) = [[1., 0.], [1./1.414, 1./1.414]]
Expand All @@ -282,6 +276,7 @@ class CosineSimilarity(reduction_metrics.MeanMetricWrapper):
>>> m.update_state([[0., 1.], [1., 1.]], [[1., 0.], [1., 1.]])
>>> m.result()
0.49999997
>>> m.reset_state()
>>> m.update_state([[0., 1.], [1., 1.]], [[1., 0.], [1., 1.]],
... sample_weight=[0.3, 0.7])
Expand Down Expand Up @@ -322,14 +317,13 @@ class LogCoshError(reduction_metrics.MeanMetricWrapper):
name: (Optional) string name of the metric instance.
dtype: (Optional) data type of the metric result.
Example:
Example:
Examples:
>>> m = keras.metrics.LogCoshError()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
>>> m.result()
0.10844523
>>> m.reset_state()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
... sample_weight=[1, 0])
Expand Down

0 comments on commit 461fbf3

Please sign in to comment.