Open cscherrer opened 5 years ago
I think there was an earlier version that did something like this, but I think the current solution is better numerically when y
is close to 1
or 0
. But perhaps investigating this (eg by comparing to a higher precision float, or BigFloat
) and also benchmarking could be worthwhile.
Good point, definitely worth checking the numerical behavior
I noticed this bit of code:
There's a neat trick that can speed this up. If we write
σ=logistic
(for brevity) thenσ'=σ*(1-σ)
So something like