Skip to content

Commit 590a209

Browse files
cleanup
1 parent 44d2912 commit 590a209

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/losses/functions.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ end
384384
Return how much the predicted distribution `ŷ` diverges from the expected Poisson
385385
distribution `y`. Calculated as
386386
387-
sum(ŷ .- y .* log.(ŷ)) / size(y, 2)
387+
agg(ŷ .- y .* log.(ŷ))
388388
389389
[More information](https://peltarion.com/knowledge-center/documentation/modeling-view/build-an-ai-model/loss-functions/poisson).
390390
"""
@@ -399,7 +399,7 @@ end
399399
Return the [hinge_loss loss](https://en.wikipedia.org/wiki/Hinge_loss) given the
400400
prediction `ŷ` and true labels `y` (containing 1 or -1). Calculated as
401401
402-
sum(max.(0, 1 .- ŷ .* y)) / size(y, 2)
402+
agg(max.(0, 1 .- ŷ .* y))
403403
404404
See also: [`squared_hinge_loss`](@ref).
405405
"""
@@ -412,7 +412,9 @@ end
412412
squared_hinge_loss(ŷ, y)
413413
414414
Return the squared hinge_loss loss given the prediction `ŷ` and true labels `y`
415-
(containing 1 or -1); calculated as `sum((max.(0, 1 .- ŷ .* y)).^2) / size(y, 2)`.
415+
(containing 1 or -1). Calculated as
416+
417+
agg((max.(0, 1 .- ŷ .* y)).^2)
416418
417419
See also [`hinge_loss`](@ref).
418420
"""
@@ -458,7 +460,7 @@ end
458460
binary_focal_loss(ŷ, y; agg=mean, γ=2, ϵ=eps(ŷ))
459461
460462
Return the [binary_focal_loss](https://arxiv.org/pdf/1708.02002.pdf)
461-
The input, 'ŷ', is expected to be normalized (i.e. [`softmax`](@ref) output).
463+
The input `ŷ` is expected to be normalized (i.e. [`softmax`](@ref) output).
462464
463465
For `γ == 0`, the loss is mathematically equivalent to [`binarycrossentropy`](@ref).
464466

0 commit comments

Comments
 (0)