FluxML / FluxTraining.jl

A flexible neural net training library inspired by fast.ai
https://fluxml.ai/FluxTraining.jl
MIT License
118 stars 25 forks source link

Unnecessary softmax in accuracy? #67

Closed DrChainsaw closed 3 years ago

DrChainsaw commented 3 years ago

Just stumbled on this as I was poking around:

function accuracy(y_pred, y)
    return mean(onecold(cpu(softmax(y_pred))) .== onecold(cpu(y)))
end

That softmax should not be needed as onecold afaik only does argmax + some plumbing under the hood and softmax should not change the outcome of that.