JuliaML / LossFunctions.jl

Julia package of loss functions for machine learning.
https://juliaml.github.io/LossFunctions.jl/stable
Other
148 stars 34 forks source link

Code examples in "Getting Started" don't seem to work #174

Closed alex-s-gardner closed 11 months ago

alex-s-gardner commented 11 months ago
using LossFunctions
L2DistLoss()(0.5, 1.0)

ERROR: MethodError: no method matching (::L2DistLoss)(::Float64, ::Float64)
Stacktrace:
 [1] top-level scope
   @ REPL[35]:1

Same issue for other examples as well

alex-s-gardner commented 11 months ago

It looks like loss functions now accept vector inputs and do not use dispatch

juliohm commented 11 months ago

Can't reproduce the error. Are you positive that you are using the latest version?

alex-s-gardner commented 11 months ago

@juliohm you are very correct... not sure what was going on there. I must have been using an older version of LossFunctions.

It works fine with LossFunctions v0.11.1, apologies