Skip to content

Commit

Permalink
CMSIS-NN: Change relu to relu6 in pooling unit test
Browse files Browse the repository at this point in the history
* Changing to relu6 to cover both out activation min/max other that the
  default.
* Removing input/output offsets from pooling test data.
  • Loading branch information
mansnils authored and felix-johnny committed Feb 23, 2021
1 parent 07bb28e commit 1cc6043
Show file tree
Hide file tree
Showing 31 changed files with 57 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define AVGPOOLING_INPUT_H 12
#define AVGPOOLING_DST_SIZE 72
#define AVGPOOLING_INPUT_SIZE 2112
#define AVGPOOLING_INPUT_OFFSET 0
#define AVGPOOLING_OUTPUT_OFFSET 0
#define AVGPOOLING_OUT_ACTIVATION_MIN -128
#define AVGPOOLING_OUT_ACTIVATION_MAX 127
#define AVGPOOLING_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define AVGPOOLING_1_INPUT_H 5
#define AVGPOOLING_1_DST_SIZE 3
#define AVGPOOLING_1_INPUT_SIZE 135
#define AVGPOOLING_1_INPUT_OFFSET 0
#define AVGPOOLING_1_OUTPUT_OFFSET 0
#define AVGPOOLING_1_OUT_ACTIVATION_MIN -128
#define AVGPOOLING_1_OUT_ACTIVATION_MAX 127
#define AVGPOOLING_1_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define AVGPOOLING_2_INPUT_H 1
#define AVGPOOLING_2_DST_SIZE 60
#define AVGPOOLING_2_INPUT_SIZE 60
#define AVGPOOLING_2_INPUT_OFFSET 0
#define AVGPOOLING_2_OUTPUT_OFFSET 0
#define AVGPOOLING_2_OUT_ACTIVATION_MIN -128
#define AVGPOOLING_2_OUT_ACTIVATION_MAX 127
#define AVGPOOLING_2_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define AVGPOOLING_3_INPUT_H 1
#define AVGPOOLING_3_DST_SIZE 10
#define AVGPOOLING_3_INPUT_SIZE 18
#define AVGPOOLING_3_INPUT_OFFSET 0
#define AVGPOOLING_3_OUTPUT_OFFSET 0
#define AVGPOOLING_3_OUT_ACTIVATION_MIN -128
#define AVGPOOLING_3_OUT_ACTIVATION_MAX 127
#define AVGPOOLING_3_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define AVGPOOLING_4_INPUT_H 20
#define AVGPOOLING_4_DST_SIZE 14
#define AVGPOOLING_4_INPUT_SIZE 40
#define AVGPOOLING_4_INPUT_OFFSET 0
#define AVGPOOLING_4_OUTPUT_OFFSET 0
#define AVGPOOLING_4_OUT_ACTIVATION_MIN -128
#define AVGPOOLING_4_OUT_ACTIVATION_MAX 127
#define AVGPOOLING_4_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define BASIC_INPUT_H 8
#define BASIC_DST_SIZE 20
#define BASIC_INPUT_SIZE 40
#define BASIC_INPUT_OFFSET 128
#define BASIC_OUTPUT_OFFSET 0
#define BASIC_OUT_ACTIVATION_MIN -128
#define BASIC_OUT_ACTIVATION_MAX 127
#define BASIC_INPUT_BATCHES 1
#define BASIC_INPUT_OFFSET 128
#define BASIC_OUTPUT_OFFSET 0
#define BASIC_FILTER_X 2
#define BASIC_FILTER_Y 4
#define BASIC_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_1_X_N_1_INPUT_H 5
#define CONV_1_X_N_1_DST_SIZE 60
#define CONV_1_X_N_1_INPUT_SIZE 75
#define CONV_1_X_N_1_INPUT_OFFSET 0
#define CONV_1_X_N_1_OUTPUT_OFFSET 0
#define CONV_1_X_N_1_OUT_ACTIVATION_MIN -128
#define CONV_1_X_N_1_OUT_ACTIVATION_MAX 127
#define CONV_1_X_N_1_INPUT_BATCHES 2
#define CONV_1_X_N_1_INPUT_OFFSET 0
#define CONV_1_X_N_1_OUTPUT_OFFSET 0
#define CONV_1_X_N_1_FILTER_X 2
#define CONV_1_X_N_1_FILTER_Y 1
#define CONV_1_X_N_1_STRIDE_X 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_1_X_N_2_INPUT_H 11
#define CONV_1_X_N_2_DST_SIZE 121
#define CONV_1_X_N_2_INPUT_SIZE 363
#define CONV_1_X_N_2_INPUT_OFFSET 0
#define CONV_1_X_N_2_OUTPUT_OFFSET 0
#define CONV_1_X_N_2_OUT_ACTIVATION_MIN -128
#define CONV_1_X_N_2_OUT_ACTIVATION_MAX 127
#define CONV_1_X_N_2_INPUT_BATCHES 1
#define CONV_1_X_N_2_INPUT_OFFSET 0
#define CONV_1_X_N_2_OUTPUT_OFFSET 0
#define CONV_1_X_N_2_FILTER_X 11
#define CONV_1_X_N_2_FILTER_Y 1
#define CONV_1_X_N_2_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_1_X_N_3_INPUT_H 11
#define CONV_1_X_N_3_DST_SIZE 363
#define CONV_1_X_N_3_INPUT_SIZE 121
#define CONV_1_X_N_3_INPUT_OFFSET 0
#define CONV_1_X_N_3_OUTPUT_OFFSET 0
#define CONV_1_X_N_3_OUT_ACTIVATION_MIN -128
#define CONV_1_X_N_3_OUT_ACTIVATION_MAX 127
#define CONV_1_X_N_3_INPUT_BATCHES 1
#define CONV_1_X_N_3_INPUT_OFFSET 0
#define CONV_1_X_N_3_OUTPUT_OFFSET 0
#define CONV_1_X_N_3_FILTER_X 1
#define CONV_1_X_N_3_FILTER_Y 11
#define CONV_1_X_N_3_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_2_INPUT_H 3
#define CONV_2_DST_SIZE 72
#define CONV_2_INPUT_SIZE 36
#define CONV_2_INPUT_OFFSET 128
#define CONV_2_OUTPUT_OFFSET -1
#define CONV_2_OUT_ACTIVATION_MIN -128
#define CONV_2_OUT_ACTIVATION_MAX 127
#define CONV_2_INPUT_BATCHES 1
#define CONV_2_INPUT_OFFSET 128
#define CONV_2_OUTPUT_OFFSET -1
#define CONV_2_FILTER_X 3
#define CONV_2_FILTER_Y 3
#define CONV_2_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_3_INPUT_H 49
#define CONV_3_DST_SIZE 250
#define CONV_3_INPUT_SIZE 1470
#define CONV_3_INPUT_OFFSET 0
#define CONV_3_OUTPUT_OFFSET 0
#define CONV_3_OUT_ACTIVATION_MIN -128
#define CONV_3_OUT_ACTIVATION_MAX 127
#define CONV_3_INPUT_BATCHES 1
#define CONV_3_INPUT_OFFSET 0
#define CONV_3_OUTPUT_OFFSET 0
#define CONV_3_FILTER_X 4
#define CONV_3_FILTER_Y 10
#define CONV_3_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define CONV_4_INPUT_H 5
#define CONV_4_DST_SIZE 36
#define CONV_4_INPUT_SIZE 75
#define CONV_4_INPUT_OFFSET 0
#define CONV_4_OUTPUT_OFFSET 0
#define CONV_4_OUT_ACTIVATION_MIN -128
#define CONV_4_OUT_ACTIVATION_MAX 127
#define CONV_4_INPUT_BATCHES 3
#define CONV_4_INPUT_OFFSET 0
#define CONV_4_OUTPUT_OFFSET 0
#define CONV_4_FILTER_X 2
#define CONV_4_FILTER_Y 3
#define CONV_4_STRIDE_X 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define DEPTHWISE_2_INPUT_H 5
#define DEPTHWISE_2_DST_SIZE 81
#define DEPTHWISE_2_INPUT_SIZE 90
#define DEPTHWISE_2_INPUT_OFFSET 0
#define DEPTHWISE_2_OUTPUT_OFFSET -1
#define DEPTHWISE_2_OUT_ACTIVATION_MIN -128
#define DEPTHWISE_2_OUT_ACTIVATION_MAX 127
#define DEPTHWISE_2_INPUT_BATCHES 1
#define DEPTHWISE_2_INPUT_OFFSET 0
#define DEPTHWISE_2_OUTPUT_OFFSET -1
#define DEPTHWISE_2_FILTER_X 3
#define DEPTHWISE_2_FILTER_Y 4
#define DEPTHWISE_2_STRIDE_X 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define DEPTHWISE_EQ_IN_OUT_CH_INPUT_H 5
#define DEPTHWISE_EQ_IN_OUT_CH_DST_SIZE 120
#define DEPTHWISE_EQ_IN_OUT_CH_INPUT_SIZE 120
#define DEPTHWISE_EQ_IN_OUT_CH_INPUT_OFFSET 0
#define DEPTHWISE_EQ_IN_OUT_CH_OUTPUT_OFFSET -1
#define DEPTHWISE_EQ_IN_OUT_CH_OUT_ACTIVATION_MIN -128
#define DEPTHWISE_EQ_IN_OUT_CH_OUT_ACTIVATION_MAX 127
#define DEPTHWISE_EQ_IN_OUT_CH_INPUT_BATCHES 1
#define DEPTHWISE_EQ_IN_OUT_CH_INPUT_OFFSET 0
#define DEPTHWISE_EQ_IN_OUT_CH_OUTPUT_OFFSET -1
#define DEPTHWISE_EQ_IN_OUT_CH_FILTER_X 2
#define DEPTHWISE_EQ_IN_OUT_CH_FILTER_Y 3
#define DEPTHWISE_EQ_IN_OUT_CH_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define DEPTHWISE_KERNEL_3X3_INPUT_H 5
#define DEPTHWISE_KERNEL_3X3_DST_SIZE 30
#define DEPTHWISE_KERNEL_3X3_INPUT_SIZE 100
#define DEPTHWISE_KERNEL_3X3_INPUT_OFFSET 0
#define DEPTHWISE_KERNEL_3X3_OUTPUT_OFFSET -1
#define DEPTHWISE_KERNEL_3X3_OUT_ACTIVATION_MIN -128
#define DEPTHWISE_KERNEL_3X3_OUT_ACTIVATION_MAX 127
#define DEPTHWISE_KERNEL_3X3_INPUT_BATCHES 1
#define DEPTHWISE_KERNEL_3X3_INPUT_OFFSET 0
#define DEPTHWISE_KERNEL_3X3_OUTPUT_OFFSET -1
#define DEPTHWISE_KERNEL_3X3_FILTER_X 3
#define DEPTHWISE_KERNEL_3X3_FILTER_Y 3
#define DEPTHWISE_KERNEL_3X3_STRIDE_X 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define FULLY_CONNECTED_INPUT_H 1
#define FULLY_CONNECTED_DST_SIZE 18
#define FULLY_CONNECTED_INPUT_SIZE 20
#define FULLY_CONNECTED_INPUT_OFFSET 50
#define FULLY_CONNECTED_OUTPUT_OFFSET -2
#define FULLY_CONNECTED_OUT_ACTIVATION_MIN -128
#define FULLY_CONNECTED_OUT_ACTIVATION_MAX 127
#define FULLY_CONNECTED_INPUT_BATCHES 3
#define FULLY_CONNECTED_INPUT_OFFSET 50
#define FULLY_CONNECTED_OUTPUT_OFFSET -2
#define FULLY_CONNECTED_WEIGHTS_OFFSET 22
#define FULLY_CONNECTED_OUTPUT_MULTIPLIER 1073741824
#define FULLY_CONNECTED_OUTPUT_SHIFT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define FULLY_CONNECTED_MVE_0_INPUT_H 1
#define FULLY_CONNECTED_MVE_0_DST_SIZE 9
#define FULLY_CONNECTED_MVE_0_INPUT_SIZE 16
#define FULLY_CONNECTED_MVE_0_INPUT_OFFSET 3
#define FULLY_CONNECTED_MVE_0_OUTPUT_OFFSET -2
#define FULLY_CONNECTED_MVE_0_OUT_ACTIVATION_MIN -128
#define FULLY_CONNECTED_MVE_0_OUT_ACTIVATION_MAX 127
#define FULLY_CONNECTED_MVE_0_INPUT_BATCHES 1
#define FULLY_CONNECTED_MVE_0_INPUT_OFFSET 3
#define FULLY_CONNECTED_MVE_0_OUTPUT_OFFSET -2
#define FULLY_CONNECTED_MVE_0_WEIGHTS_OFFSET 0
#define FULLY_CONNECTED_MVE_0_OUTPUT_MULTIPLIER 1073741824
#define FULLY_CONNECTED_MVE_0_OUTPUT_SHIFT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define FULLY_CONNECTED_MVE_1_INPUT_H 1
#define FULLY_CONNECTED_MVE_1_DST_SIZE 4
#define FULLY_CONNECTED_MVE_1_INPUT_SIZE 20
#define FULLY_CONNECTED_MVE_1_INPUT_OFFSET 1
#define FULLY_CONNECTED_MVE_1_OUTPUT_OFFSET 3
#define FULLY_CONNECTED_MVE_1_OUT_ACTIVATION_MIN -128
#define FULLY_CONNECTED_MVE_1_OUT_ACTIVATION_MAX 127
#define FULLY_CONNECTED_MVE_1_INPUT_BATCHES 1
#define FULLY_CONNECTED_MVE_1_INPUT_OFFSET 1
#define FULLY_CONNECTED_MVE_1_OUTPUT_OFFSET 3
#define FULLY_CONNECTED_MVE_1_WEIGHTS_OFFSET -3
#define FULLY_CONNECTED_MVE_1_OUTPUT_MULTIPLIER 1073741824
#define FULLY_CONNECTED_MVE_1_OUTPUT_SHIFT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define FULLY_CONNECTED_NULL_BIAS_0_INPUT_H 1
#define FULLY_CONNECTED_NULL_BIAS_0_DST_SIZE 10
#define FULLY_CONNECTED_NULL_BIAS_0_INPUT_SIZE 33
#define FULLY_CONNECTED_NULL_BIAS_0_INPUT_OFFSET 1
#define FULLY_CONNECTED_NULL_BIAS_0_OUTPUT_OFFSET 0
#define FULLY_CONNECTED_NULL_BIAS_0_OUT_ACTIVATION_MIN -128
#define FULLY_CONNECTED_NULL_BIAS_0_OUT_ACTIVATION_MAX 127
#define FULLY_CONNECTED_NULL_BIAS_0_INPUT_BATCHES 2
#define FULLY_CONNECTED_NULL_BIAS_0_INPUT_OFFSET 1
#define FULLY_CONNECTED_NULL_BIAS_0_OUTPUT_OFFSET 0
#define FULLY_CONNECTED_NULL_BIAS_0_WEIGHTS_OFFSET -3
#define FULLY_CONNECTED_NULL_BIAS_0_OUTPUT_MULTIPLIER 1073741824
#define FULLY_CONNECTED_NULL_BIAS_0_OUTPUT_SHIFT 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define KERNEL1X1_INPUT_H 15
#define KERNEL1X1_DST_SIZE 3825
#define KERNEL1X1_INPUT_SIZE 900
#define KERNEL1X1_INPUT_OFFSET 128
#define KERNEL1X1_OUTPUT_OFFSET -1
#define KERNEL1X1_OUT_ACTIVATION_MIN -128
#define KERNEL1X1_OUT_ACTIVATION_MAX 127
#define KERNEL1X1_INPUT_BATCHES 1
#define KERNEL1X1_INPUT_OFFSET 128
#define KERNEL1X1_OUTPUT_OFFSET -1
#define KERNEL1X1_FILTER_X 1
#define KERNEL1X1_FILTER_Y 1
#define KERNEL1X1_STRIDE_X 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_INPUT_H 12
#define MAXPOOLING_DST_SIZE 72
#define MAXPOOLING_INPUT_SIZE 2112
#define MAXPOOLING_INPUT_OFFSET 0
#define MAXPOOLING_OUTPUT_OFFSET 0
#define MAXPOOLING_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_1_INPUT_H 5
#define MAXPOOLING_1_DST_SIZE 3
#define MAXPOOLING_1_INPUT_SIZE 135
#define MAXPOOLING_1_INPUT_OFFSET 0
#define MAXPOOLING_1_OUTPUT_OFFSET 0
#define MAXPOOLING_1_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_1_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_1_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_2_INPUT_H 1
#define MAXPOOLING_2_DST_SIZE 60
#define MAXPOOLING_2_INPUT_SIZE 60
#define MAXPOOLING_2_INPUT_OFFSET 0
#define MAXPOOLING_2_OUTPUT_OFFSET 0
#define MAXPOOLING_2_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_2_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_2_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_3_INPUT_H 1
#define MAXPOOLING_3_DST_SIZE 10
#define MAXPOOLING_3_INPUT_SIZE 18
#define MAXPOOLING_3_INPUT_OFFSET 0
#define MAXPOOLING_3_OUTPUT_OFFSET 0
#define MAXPOOLING_3_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_3_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_3_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_4_INPUT_H 20
#define MAXPOOLING_4_DST_SIZE 14
#define MAXPOOLING_4_INPUT_SIZE 40
#define MAXPOOLING_4_INPUT_OFFSET 0
#define MAXPOOLING_4_OUTPUT_OFFSET 0
#define MAXPOOLING_4_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_4_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_4_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_5_INPUT_H 1
#define MAXPOOLING_5_DST_SIZE 20
#define MAXPOOLING_5_INPUT_SIZE 20
#define MAXPOOLING_5_INPUT_OFFSET 0
#define MAXPOOLING_5_OUTPUT_OFFSET 0
#define MAXPOOLING_5_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_5_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_5_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define MAXPOOLING_6_INPUT_H 5
#define MAXPOOLING_6_DST_SIZE 34
#define MAXPOOLING_6_INPUT_SIZE 85
#define MAXPOOLING_6_INPUT_OFFSET 0
#define MAXPOOLING_6_OUTPUT_OFFSET 0
#define MAXPOOLING_6_OUT_ACTIVATION_MIN -128
#define MAXPOOLING_6_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_6_INPUT_BATCHES 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
#define MAXPOOLING_7_INPUT_H 2
#define MAXPOOLING_7_DST_SIZE 2
#define MAXPOOLING_7_INPUT_SIZE 8
#define MAXPOOLING_7_INPUT_OFFSET -128
#define MAXPOOLING_7_OUTPUT_OFFSET 0
#define MAXPOOLING_7_OUT_ACTIVATION_MIN 0
#define MAXPOOLING_7_OUT_ACTIVATION_MAX 127
#define MAXPOOLING_7_OUT_ACTIVATION_MAX 6
#define MAXPOOLING_7_INPUT_BATCHES 1
#define MAXPOOLING_7_FILTER_X 2
#define MAXPOOLING_7_FILTER_Y 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
#pragma once
#include <stdint.h>

const int8_t maxpooling_7_output_ref[2] = {0, 23};
const int8_t maxpooling_7_output_ref[2] = {0, 6};
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define STRIDE2PAD1_INPUT_H 7
#define STRIDE2PAD1_DST_SIZE 16
#define STRIDE2PAD1_INPUT_SIZE 49
#define STRIDE2PAD1_INPUT_OFFSET 128
#define STRIDE2PAD1_OUTPUT_OFFSET 0
#define STRIDE2PAD1_OUT_ACTIVATION_MIN -128
#define STRIDE2PAD1_OUT_ACTIVATION_MAX 127
#define STRIDE2PAD1_INPUT_BATCHES 1
#define STRIDE2PAD1_INPUT_OFFSET 128
#define STRIDE2PAD1_OUTPUT_OFFSET 0
#define STRIDE2PAD1_FILTER_X 3
#define STRIDE2PAD1_FILTER_Y 3
#define STRIDE2PAD1_STRIDE_X 2
Expand Down
Loading

0 comments on commit 1cc6043

Please sign in to comment.