Apply suggestions from code review

Co-Authored-By: David Lung <lungd@users.noreply.github.com>
This commit is contained in:
Adarsh Kumar 2020-02-27 23:23:53 +05:30 committed by GitHub
parent 9dce623214
commit 8afed01345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -79,8 +79,8 @@ function huber_loss(ŷ, y,delta=1.0)
hub_loss+=delta*(abs_error[i]- dtype(0.5*delta))
end
return hub_loss*1//length(y)
end
hub_loss*1//length(y)
end

View File

@ -18,7 +18,7 @@ const ϵ = 1e-7
end
@testset "huber_loss" begin
@test Flux.huber_loss(ŷ, y) 0.0012499999999999994
@test Flux.huber_loss(ŷ, y) 0.20500000000000002
end
y = [123.0,456.0,789.0]