Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update probabilistic_metrics.py #20660

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions keras/src/metrics/probabilistic_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class Poisson(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.Poisson()
>>> m.update_state([[0, 1], [0, 0]], [[1, 1], [0, 0]])
Expand Down Expand Up @@ -119,9 +117,7 @@ class BinaryCrossentropy(reduction_metrics.MeanMetricWrapper):
e.g. `label_smoothing=0.2` means that we will use
a value of 0.1 for label "0" and 0.9 for label "1".

Example:

Example:
Examples:

>>> m = keras.metrics.BinaryCrossentropy()
>>> m.update_state([[0, 1], [0, 0]], [[0.6, 0.4], [0.4, 0.6]])
Expand Down Expand Up @@ -195,9 +191,7 @@ class CategoricalCrossentropy(reduction_metrics.MeanMetricWrapper):
axis: (Optional) Defaults to `-1`.
The dimension along which entropy is computed.

Example:

Example:
Examples:

>>> # EPSILON = 1e-7, y = y_true, y` = y_pred
>>> # y` = clip_ops.clip_by_value(output, EPSILON, 1. - EPSILON)
Expand Down Expand Up @@ -282,9 +276,7 @@ class SparseCategoricalCrossentropy(reduction_metrics.MeanMetricWrapper):
axis: (Optional) Defaults to `-1`.
The dimension along which entropy is computed.

Example:

Example:
Examples:

>>> # y_true = one_hot(y_true) = [[0, 1, 0], [0, 0, 1]]
>>> # logits = log(y_pred)
Expand Down
Loading