Skip to content

The implementation of a numerically stable log(1-softmax(x)) function

Notifications You must be signed in to change notification settings

HichemAK/stable-log1msoftmax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Numerically stable log(1-softmax(x))

This repository contains the implementation of a numerically stable log(1-softmax(x)) function in PyTorch.

  • The implementation is located in log1msoftmax.py under the name log1m_softmax_kfrank
  • The evaluation of this function compared to the naive unstable implementation can be found in the notebook test.ipynb
  • The unit tests of this implementation can be found in the folder tests

This is the PyTorch-quality-of-life version of the numerically stable log(1-softmax) function proposed by KFrank in a PyTorch forum discussion

About

The implementation of a numerically stable log(1-softmax(x)) function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published