srvk / eesen

The official repository of the Eesen project
http://arxiv.org/abs/1507.08240
Apache License 2.0
825 stars 343 forks source link

Potential overflow when calculating exp #209

Open HaisongDing opened 6 years ago

HaisongDing commented 6 years ago

https://github.com/srvk/eesen/blob/c64c152aa60729e6b754c9274dc2bd4b386f45d6/asr_egs/wsj/utils/nnet_notf.py#L228

One simple fix would be: mat_array = np.asarray(mat) mat_array = (mat_array.transpose() - mat_array.max(axis=1)).transpose() scoreMatExp = np.exp(mat_array)