Skip to content

ARM下的精度问题 #61

@ghost

Description

我在代码中加入了ARM的编译选项,发现 softmax 测试(其余的测试都可以过)一直因为精度问题过不了,但是里面的实现已经是 std::exp 的实现了,还没有开始增加NEON相关的支持,想问下这里的真值是怎么产生的?

代码 : 95b8c8b

/root/Documents/code/KuiperInfer/test/test_layer/test_softmax.cpp:59: Failure
Expected: (std::abs(a - b)) <= (1e-5f), actual: 0.000335352495 vs 1e-05
a: 0.018315639346837997 b: 0.017980286851525307

[  FAILED  ] test_layer.forward_softmax_dim1 (22 ms)
[ RUN      ] test_layer.forward_softmax_dim1_minus2
/root/Documents/code/KuiperInfer/test/test_layer/test_softmax.cpp:94: Failure
Expected: (std::abs(a - b)) <= (1e-5f), actual: 0.000335352495 vs 1e-05
a: 0.018315639346837997 b: 0.017980286851525307 i:4

[  FAILED  ] test_layer.forward_softmax_dim1_minus2 (8 ms)
[ RUN      ] test_layer.forward_softmax_dim0
[       OK ] test_layer.forward_softmax_dim0 (29 ms)
[ RUN      ] test_layer.forward_softmax_dim2
/root/Documents/code/KuiperInfer/test/test_layer/test_softmax.cpp:159: Failure
Expected: (std::abs(a - b)) <= (1e-5f), actual: 0.0177284628 vs 1e-05
a: 0.049787066876888275 b: 0.032058604061603546 i:0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions