logcosh averaged

This commit is contained in:
thebhatman 2019-03-26 23:23:02 +05:30
parent 930adb122d
commit 4efcc69ba5
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ poisson(ŷ, y) = sum(ŷ .- y .* log.(ŷ)) *1 // size(y,2)
""" """
Logcosh Loss function 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) hinge(, y) = sum(max.(0, 1 .- .* y)) *1 // size(y,2)

View File

@ -72,7 +72,7 @@ const ϵ = 1e-7
end end
@testset "logcosh" begin @testset "logcosh" begin
@test Flux.logcosh(y, y1) 0.13302230977782092 @test Flux.logcosh(y, y1) 0.044340769925940306
@test Flux.logcosh(y, y) 0 @test Flux.logcosh(y, y) 0
end end