Skip to content

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

Merged
najeeb-kazmi merged 4 commits into
dotnet:masterfrom
najeeb-kazmi:3648
May 15, 2019
Merged

Fix SoftMax precision by utilizing double in the internal calculations#3676
najeeb-kazmi merged 4 commits into
dotnet:masterfrom
najeeb-kazmi:3648

Conversation

@najeeb-kazmi

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

Copy link
Copy Markdown
Member

Fixes #3648

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

cc: @rauhs

@codecov

codecov Bot commented May 7, 2019

Copy link
Copy Markdown

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%) ⬆️

@Ivanidzo4ka Ivanidzo4ka left a comment

Copy link
Copy Markdown
Contributor

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

5 participants