Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SoftMax precision by utilizing double in the internal calculations #3676

Merged
merged 4 commits into from
May 15, 2019

Conversation

najeeb-kazmi
Copy link
Member

@najeeb-kazmi najeeb-kazmi commented May 7, 2019

Fixes #3648

Uses double when calculating softmax exponent scores and only cast to float at the final step returning the probabilities.

cc: @rauhs

@codecov
Copy link

codecov bot commented May 7, 2019

Codecov Report

Merging #3676 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #3676      +/-   ##
==========================================
+ Coverage   72.77%   72.77%   +<.01%     
==========================================
  Files         808      808              
  Lines      145588   145589       +1     
  Branches    16250    16250              
==========================================
+ Hits       105956   105958       +2     
  Misses      35207    35207              
+ Partials     4425     4424       -1
Flag Coverage Δ
#Debug 72.77% <100%> (ø) ⬆️
#production 68.28% <100%> (ø) ⬆️
#test 89.03% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...rd/MulticlassClassification/OneVersusAllTrainer.cs 74.93% <100%> (+0.06%) ⬆️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.26% <0%> (+0.15%) ⬆️

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@najeeb-kazmi najeeb-kazmi self-assigned this May 14, 2019
codemzs and others added 3 commits May 14, 2019 21:46
* Brew install libomp 7.0.0 only.

* Brew install libomp 7.0.0 only.

* Brew install libomp 7.0.0 only.

* Brew install libomp 7.0.0 only.
@najeeb-kazmi najeeb-kazmi merged commit 715ba89 into dotnet:master May 15, 2019
@najeeb-kazmi najeeb-kazmi deleted the 3648 branch January 30, 2020 01:20
@ghost ghost locked as resolved and limited conversation to collaborators Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Softmax implementation in OneVersusAllModelParameters returns NaN even for scores of ~90.0f
4 participants