mit-han-lab / tinyengine

[NeurIPS 2020] MCUNet: Tiny Deep Learning on IoT Devices; [NeurIPS 2021] MCUNetV2: Memory-Efficient Patch-based Inference for Tiny Deep Learning; [NeurIPS 2022] MCUNetV3: On-Device Training Under 256KB Memory
https://mcunet.mit.edu
MIT License
810 stars 131 forks source link

There is an error in the LogSoftmax function. #107

Open happy1004s opened 4 months ago

happy1004s commented 4 months ago

LogSoftmax

float max = FLT_MIN; --> float max = -FLT_MAX;

As you know, [FLT_MIN] represents the minimum positive value. Given the structure of the algorithm, I believe -FLT_MAX should be used instead of FLT_MIN. Because of this, when all the input data is negative, the maximum value among the negatives is not selected. Instead, [FLT_MIN] is chosen, resulting in strange output.