@@ -28,7 +28,6 @@ class MeanSquaredError(reduction_metrics.MeanMetricWrapper):
28
28
dtype: (Optional) data type of the metric result.
29
29
30
30
Example:
31
-
32
31
>>> m = keras.metrics.MeanSquaredError()
33
32
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
34
33
>>> m.result()
@@ -64,6 +63,7 @@ class MeanAbsoluteError(reduction_metrics.MeanMetricWrapper):
64
63
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
65
64
>>> m.result()
66
65
0.25
66
+
67
67
>>> m.reset_state()
68
68
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
69
69
... sample_weight=[1, 0])
@@ -103,14 +103,12 @@ class MeanAbsolutePercentageError(reduction_metrics.MeanMetricWrapper):
103
103
name: (Optional) string name of the metric instance.
104
104
dtype: (Optional) data type of the metric result.
105
105
106
- Example:
107
-
108
- Example:
109
-
106
+ Examples:
110
107
>>> m = keras.metrics.MeanAbsolutePercentageError()
111
108
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
112
109
>>> m.result()
113
110
250000000.0
111
+
114
112
>>> m.reset_state()
115
113
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
116
114
... sample_weight=[1, 0])
@@ -150,14 +148,13 @@ class MeanSquaredLogarithmicError(reduction_metrics.MeanMetricWrapper):
150
148
name: (Optional) string name of the metric instance.
151
149
dtype: (Optional) data type of the metric result.
152
150
153
- Example:
154
-
155
- Example:
151
+ Examples:
156
152
157
153
>>> m = keras.metrics.MeanSquaredLogarithmicError()
158
154
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
159
155
>>> m.result()
160
156
0.12011322
157
+
161
158
>>> m.reset_state()
162
159
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
163
160
... sample_weight=[1, 0])
@@ -197,9 +194,7 @@ class RootMeanSquaredError(reduction_metrics.Mean):
197
194
name: (Optional) string name of the metric instance.
198
195
dtype: (Optional) data type of the metric result.
199
196
200
- Example:
201
-
202
- Example:
197
+ Examples:
203
198
204
199
>>> m = keras.metrics.RootMeanSquaredError()
205
200
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
@@ -270,8 +265,7 @@ class CosineSimilarity(reduction_metrics.MeanMetricWrapper):
270
265
axis: (Optional) Defaults to `-1`. The dimension along which the cosine
271
266
similarity is computed.
272
267
273
-
274
- Example:
268
+ Examples:
275
269
276
270
>>> # l2_norm(y_true) = [[0., 1.], [1./1.414, 1./1.414]]
277
271
>>> # l2_norm(y_pred) = [[1., 0.], [1./1.414, 1./1.414]]
@@ -282,6 +276,7 @@ class CosineSimilarity(reduction_metrics.MeanMetricWrapper):
282
276
>>> m.update_state([[0., 1.], [1., 1.]], [[1., 0.], [1., 1.]])
283
277
>>> m.result()
284
278
0.49999997
279
+
285
280
>>> m.reset_state()
286
281
>>> m.update_state([[0., 1.], [1., 1.]], [[1., 0.], [1., 1.]],
287
282
... sample_weight=[0.3, 0.7])
@@ -322,14 +317,13 @@ class LogCoshError(reduction_metrics.MeanMetricWrapper):
322
317
name: (Optional) string name of the metric instance.
323
318
dtype: (Optional) data type of the metric result.
324
319
325
- Example:
326
-
327
- Example:
320
+ Examples:
328
321
329
322
>>> m = keras.metrics.LogCoshError()
330
323
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
331
324
>>> m.result()
332
325
0.10844523
326
+
333
327
>>> m.reset_state()
334
328
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]],
335
329
... sample_weight=[1, 0])
0 commit comments