logcosh averaged
This commit is contained in:
parent
930adb122d
commit
4efcc69ba5
|
@ -77,7 +77,7 @@ poisson(ŷ, y) = sum(ŷ .- y .* log.(ŷ)) *1 // size(y,2)
|
|||
"""
|
||||
Logcosh Loss function
|
||||
"""
|
||||
logcosh(ŷ, y) = sum(log.(cosh.(ŷ .- y)))
|
||||
logcosh(ŷ, y) = sum(log.(cosh.(ŷ .- y))) *1 // size(y,2)
|
||||
|
||||
hinge(ŷ, y) = sum(max.(0, 1 .- ŷ .* y)) *1 // size(y,2)
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ const ϵ = 1e-7
|
|||
end
|
||||
|
||||
@testset "logcosh" begin
|
||||
@test Flux.logcosh(y, y1) ≈ 0.13302230977782092
|
||||
@test Flux.logcosh(y, y1) ≈ 0.044340769925940306
|
||||
@test Flux.logcosh(y, y) ≈ 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue