Skip to content

Commit

Permalink
CMSIS-NN: Add maxpool unit test
Browse files Browse the repository at this point in the history
* Add new max pool unit test with relu.
* Add some old unit tests that were missing in the generate script so
  that it can be regenerated if needed.
* Add check in generate script for unit tests that are not in the list.
  • Loading branch information
mansnils authored and felix-johnny committed Feb 23, 2021
1 parent e8d26dd commit 07bb28e
Show file tree
Hide file tree
Showing 184 changed files with 748 additions and 552 deletions.
4 changes: 2 additions & 2 deletions CMSIS/NN/Source/PoolingFunctions/arm_max_pool_s8.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* Title: arm_max_pool_s8.c
* Description: Pooling function implementations
*
* $Date: 09. October 2020
* $Revision: V.2.0.1
* $Date: 19. Februari 2021
* $Revision: V.2.0.2
*
* Target Processor: Cortex-M CPUs
*
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/NN/Tests/UnitTest/PregeneratedData/basic/bias.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# 1
0.000000000000000000e+00
2.000000000000000000e+00
80 changes: 40 additions & 40 deletions CMSIS/NN/Tests/UnitTest/PregeneratedData/basic/input.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# 1,8,5,1
-4.000000000000000000e+00
4.000000000000000000e+00
3.000000000000000000e+00
-1.000000000000000000e+00
0.000000000000000000e+00
-6.000000000000000000e+00
-4.000000000000000000e+00
3.000000000000000000e+00
-7.000000000000000000e+00
-2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
-3.000000000000000000e+00
-7.000000000000000000e+00
-3.000000000000000000e+00
-3.000000000000000000e+00
4.000000000000000000e+00
-3.000000000000000000e+00
-3.000000000000000000e+00
3.000000000000000000e+00
-4.000000000000000000e+00
-6.000000000000000000e+00
-7.000000000000000000e+00
-6.000000000000000000e+00
-3.000000000000000000e+00
-5.000000000000000000e+00
-3.000000000000000000e+00
-5.000000000000000000e+00
-2.000000000000000000e+00
-2.000000000000000000e+00
4.000000000000000000e+00
-6.000000000000000000e+00
6.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
-2.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
14 changes: 7 additions & 7 deletions CMSIS/NN/Tests/UnitTest/PregeneratedData/basic/kernel.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# 4,2,1,1
-2.000000000000000000e+00
-1.000000000000000000e+00
2.000000000000000000e+00
-7.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
6.000000000000000000e+00
-6.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 1,2,4,1
-1.500000000000000000e+01
-2.000000000000000000e+01
-7.000000000000000000e+00
-1.900000000000000000e+01
-1.400000000000000000e+01
-1.000000000000000000e+01
-1.600000000000000000e+01
-8.000000000000000000e+00
12 changes: 12 additions & 0 deletions CMSIS/NN/Tests/UnitTest/PregeneratedData/maxpooling_7/params.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1
1
4
2
2
2
2
2
0
0
1
0
98 changes: 49 additions & 49 deletions CMSIS/NN/Tests/UnitTest/PregeneratedData/stride2pad1/input.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
# 1,7,7,1
-7.000000000000000000e+00
-6.000000000000000000e+00
6.000000000000000000e+00
-4.000000000000000000e+00
-7.000000000000000000e+00
6.000000000000000000e+00
5.000000000000000000e+00
0.000000000000000000e+00
-2.000000000000000000e+00
-1.000000000000000000e+00
0.000000000000000000e+00
-1.000000000000000000e+00
-3.000000000000000000e+00
0.000000000000000000e+00
-7.000000000000000000e+00
3.000000000000000000e+00
-5.000000000000000000e+00
4.000000000000000000e+00
-2.000000000000000000e+00
0.000000000000000000e+00
-4.000000000000000000e+00
-4.000000000000000000e+00
-7.000000000000000000e+00
-6.000000000000000000e+00
2.000000000000000000e+00
-6.000000000000000000e+00
6.000000000000000000e+00
6.000000000000000000e+00
-5.000000000000000000e+00
6.000000000000000000e+00
-1.000000000000000000e+00
1.000000000000000000e+00
-5.000000000000000000e+00
0.000000000000000000e+00
-1.000000000000000000e+00
1.000000000000000000e+00
6.000000000000000000e+00
-5.000000000000000000e+00
0.000000000000000000e+00
0.000000000000000000e+00
-6.000000000000000000e+00
5.000000000000000000e+00
5.000000000000000000e+00
-1.000000000000000000e+00
3.000000000000000000e+00
-6.000000000000000000e+00
-4.000000000000000000e+00
-5.000000000000000000e+00
5.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
18 changes: 9 additions & 9 deletions CMSIS/NN/Tests/UnitTest/PregeneratedData/stride2pad1/kernel.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 3,3,1,1
-1.000000000000000000e+00
-5.000000000000000000e+00
-1.000000000000000000e+00
0.000000000000000000e+00
5.000000000000000000e+00
-6.000000000000000000e+00
-7.000000000000000000e+00
-3.000000000000000000e+00
0.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
3.000000000000000000e+00
1.000000000000000000e+00
3.000000000000000000e+00
2.000000000000000000e+00
1.000000000000000000e+00
2.000000000000000000e+00
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
3
2
2
0
0
1
1
1
1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#define AVGPOOLING_OUT_CH 8
#define AVGPOOLING_IN_CH 8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#include "config_data.h"
#include "input_data.h"
#include "output_ref_data.h"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#define AVGPOOLING_1_OUT_CH 3
#define AVGPOOLING_1_IN_CH 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#pragma once
#include <stdint.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Arm Limited or its affiliates. All rights reserved.
* Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,7 +16,7 @@
* limitations under the License.
*/

// Generated by generate_test_data.py using TFL version 2.3.1 as reference.
// Generated by generate_test_data.py using TFL version 2.4.1 as reference.
#include "config_data.h"
#include "input_data.h"
#include "output_ref_data.h"
Loading

0 comments on commit 07bb28e

Please sign in to comment.