These are MATLAB program files used to genereate the test results in the reference below.
-
chop_test_softmax
is the main m-file that produces the figures for the manuscript. -
bfloat_chop_test_softmax
is an alterantative that uses bfloat rather than fp16. -
lse_basic_high
computes lse and softmax in standard precision using the basic algorithms. -
lse_chop
computes lse and softmax usinig chopped arithmetic with the unshifted algorithms. -
lse_chopshift
computes lse and softmax using chopped arithmetic with the shifted algorithms. -
data_presoftmax.mat
holds the test data.
See function headers for full details.
- Functions
chop
androundit
are copied from the chop repository. See there for documentation and possible updated versions.
The code was developed in MATLAB R2019a.
Pierre Blanchard, Desmond J. Higham and Nicholas J. Higham, Accurate Computation of the Log-Sum-Exp and Softmax Functions. IMA J. Numer. Anal., 2020, https://doi.org/10.1093/imanum/draa038.
See license.txt
for licensing information.