@@ -167,7 +167,7 @@ Cross entropy is typically used as a loss in multi-class classification,
167
167
in which case the labels `y` are given in a one-hot format.
168
168
`dims` specifies the dimension (or the dimensions) containing the class probabilities.
169
169
The prediction `ŷ` is supposed to sum to one across `dims`,
170
- as would be the case with the output of a [` softmax` ](@ref) operation.
170
+ as would be the case with the output of a [softmax](@ref Softmax ) operation.
171
171
172
172
For numerical stability, it is recommended to use [`logitcrossentropy`](@ref)
173
173
rather than `softmax` followed by `crossentropy` .
@@ -225,7 +225,7 @@ Return the cross entropy calculated by
225
225
226
226
This is mathematically equivalent to `crossentropy(softmax(ŷ), y)`,
227
227
but is more numerically stable than using functions [`crossentropy`](@ref)
228
- and [` softmax` ](@ref) separately.
228
+ and [softmax](@ref Softmax ) separately.
229
229
230
230
See also: [`binarycrossentropy`](@ref), [`logitbinarycrossentropy`](@ref), [`label_smoothing`](@ref).
231
231
@@ -262,7 +262,7 @@ Return the binary cross-entropy loss, computed as
262
262
263
263
agg(@.(-y * log(ŷ + ϵ) - (1 - y) * log(1 - ŷ + ϵ)))
264
264
265
- Where typically, the prediction `ŷ` is given by the output of a [` sigmoid` ](@ref) activation.
265
+ Where typically, the prediction `ŷ` is given by the output of a [sigmoid](@ref Activation-Functions ) activation.
266
266
The `ϵ` term is included to avoid infinity. Using [`logitbinarycrossentropy`](@ref) is recomended
267
267
over `binarycrossentropy` for numerical stability.
268
268
452
452
binary_focal_loss(ŷ, y; agg=mean, γ=2, ϵ=eps(ŷ))
453
453
454
454
Return the [binary_focal_loss](https://arxiv.org/pdf/1708.02002.pdf)
455
- The input, 'ŷ', is expected to be normalized (i.e. [` softmax` ](@ref) output).
455
+ The input, 'ŷ', is expected to be normalized (i.e. [softmax](@ref Softmax ) output).
456
456
457
457
For `γ == 0`, the loss is mathematically equivalent to [`Losses.binarycrossentropy`](@ref).
458
458
493
493
Return the [focal_loss](https://arxiv.org/pdf/1708.02002.pdf)
494
494
which can be used in classification tasks with highly imbalanced classes.
495
495
It down-weights well-classified examples and focuses on hard examples.
496
- The input, 'ŷ', is expected to be normalized (i.e. [` softmax` ](@ref) output).
496
+ The input, 'ŷ', is expected to be normalized (i.e. [softmax](@ref Softmax ) output).
497
497
498
498
The modulating factor, `γ`, controls the down-weighting strength.
499
499
For `γ == 0`, the loss is mathematically equivalent to [`Losses.crossentropy`](@ref).
0 commit comments