Neural Network Tools for STM32 family v1.7.0 (stm.ai v8.1.0-19520) Created date : 2024-07-24 15:15:55 Parameters : validate --name offlinetest -m C:/Users/mehmet/Desktop/adem offline test/104 ML model/par_104_model.h5 --type keras --compression none --verbosity 1 --workspace C:\Users\mehmet\AppData\Local\Temp\mxAI_workspace11435612028714001304179832728160913 --output C:\Users\mehmet\.stm32cubemx\network_output --allocate-inputs --allocate-outputs --valoutput C:/Users/mehmet/Desktop/outai - Copy.csv --valinput C:/Users/mehmet/PycharmProjects/Scaleup_Datasets/inputdatas.csv Exec/report summary (validate) -------------------------------------------------------------------------------------------------------------- model file : C:\Users\mehmet\Desktop\adem offline test\104 ML model\par_104_model.h5 type : keras c_name : offlinetest compression : none options : allocate-inputs, allocate-outputs optimization : balanced workspace dir : C:\Users\mehmet\AppData\Local\Temp\mxAI_workspace11435612028714001304179832728160913 output dir : C:\Users\mehmet\.stm32cubemx\network_output vinput files : C:\Users\mehmet\PycharmProjects\Scaleup_Datasets\inputdatas.csv vinput files : C:\Users\mehmet\Desktop\outai - Copy.csv voutput files : C:\Users\mehmet\Desktop\outai - Copy.csv model_fmt : float model_name : par_104_model model_hash : b6eaa97be6bd4ed63f26faa8be229126 params # : 11,609 items (45.35 KiB) -------------------------------------------------------------------------------------------------------------- input 1/1 : 'input_1' (domain:activations/**default**) : 3300 items, 12.89 KiB, ai_float, float, (1,100,33,1) output 1/1 : 'dense_2' (domain:activations/**default**) : 1 items, 4 B, ai_float, float, (1,1) macc : 192,615 weights (ro) : 44,932 B (43.88 KiB) (1 segment) / -1,504(-3.2%) vs float model activations (rw) : 14,668 B (14.32 KiB) (1 segment) * ram (total) : 14,668 B (14.32 KiB) = 14,668 + 0 + 0 -------------------------------------------------------------------------------------------------------------- (*) 'input'/'output' buffers can be used from the activations buffer Model name - par_104_model ['input_1'] ['dense_2'] ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- m_id layer (type,original) oshape param/size macc connected to | c_size c_macc c_type ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 0 input_1 (Input, InputLayer) [b:None,h:100,h:100,w:33,c:1] | ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 1 conv2d_conv2d (Conv2D, Conv2D) [b:None,h:20,h:20,w:10,c:16] 496/1,984 96,016 input_1 | +3,200(+3.3%) conv2d_of32/nl_of32[0, 1] conv2d (Nonlinearity, Conv2D) [b:None,h:20,h:20,w:10,c:16] 3,200 conv2d_conv2d | -3,200(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 2 batch_normalization (ScaleBias, BatchNormalization) [b:None,h:20,h:20,w:10,c:16] 32/128 6,400 conv2d | bn_of32[2] ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 3 max_pooling2d (Pool, MaxPooling2D) [b:None,h:10,h:10,w:4,c:16] 5,120 batch_normalization | pool_of32[3] ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 4 conv2d_1_conv2d (Conv2D, Conv2D) [b:None,h:8,h:8,w:2,c:32] 4,640/18,560 73,760 max_pooling2d | +512(+0.7%) conv2d_of32/nl_of32[4, 5] conv2d_1 (Nonlinearity, Conv2D) [b:None,h:8,h:8,w:2,c:32] 512 conv2d_1_conv2d | -512(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 5 batch_normalization_1 (ScaleBias, BatchNormalization) [b:None,h:8,h:8,w:2,c:32] 64/256 1,024 conv2d_1 | bn_of32[6] ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 6 max_pooling2d_1 (Pool, MaxPooling2D) [b:None,h:4,h:4,w:1,c:32] 512 batch_normalization_1 | pool_of32[7] ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 7 flatten (Reshape, Flatten) [b:None,c:128] max_pooling2d_1 | ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 9 batch_normalization_2 (ScaleBias, BatchNormalization) [b:None,c:128] 256/1,024 256 flatten | -1,024(-100.0%) -256(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 10 dense_dense (Dense, Dense) [b:None,c:40] 5,160/20,640 5,160 batch_normalization_2 | +40(+0.8%) dense_of32/nl_of32[8, 9] dense (Nonlinearity, Dense) [b:None,c:40] 40 dense_dense | -40(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 11 batch_normalization_3 (ScaleBias, BatchNormalization) [b:None,c:40] 80/320 80 dense | -320(-100.0%) -80(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 12 dense_1_dense (Dense, Dense) [b:None,c:20] 820/3,280 820 batch_normalization_3 | +20(+2.4%) dense_of32/nl_of32[10, 11] dense_1 (Nonlinearity, Dense) [b:None,c:20] 20 dense_1_dense | -20(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 13 batch_normalization_4 (ScaleBias, BatchNormalization) [b:None,c:20] 40/160 40 dense_1 | -160(-100.0%) -40(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- 14 dense_2_dense (Dense, Dense) [b:None,c:1] 21/84 21 batch_normalization_4 | +10(+47.6%) dense_of32/nl_of32[o][12, 13] dense_2 (Nonlinearity, Dense) [b:None,c:1] 10 dense_2_dense | -10(-100.0%) ------ ------------------------------------------------------- ------------------------------- -------------- -------- ----------------------- --- ----------------- ----------------- ------------------------------- model/c-model: macc=192,991/192,615 -376(-0.2%) weights=46,436/44,932 -1,504(-3.2%) activations=--/14,668 io=--/0 Generated C-graph summary ------------------------------------------------------------------------------------------------------------------------ model name : par_104_model c-name : offlinetest c-node # : 14 c-array # : 29 activations size : 14668 (1 segment) weights size : 44932 (1 segment) macc : 192615 inputs : ['input_1_output'] outputs : ['dense_2_output'] C-Arrays (29) ------ ------------------------------ ------------ ------------------------- ------------- --------- --------- c_id name (*_array) item/size domain/mem-pool c-type fmt comment ------ ------------------------------ ------------ ------------------------- ------------- --------- --------- 0 max_pooling2d_1_output 128/512 activations/**default** float float32 1 dense_dense_output 40/160 activations/**default** float float32 2 dense_output 40/160 activations/**default** float float32 3 dense_1_dense_output 20/80 activations/**default** float float32 4 dense_1_output 20/80 activations/**default** float float32 5 dense_2_dense_output 1/4 activations/**default** float float32 6 dense_2_output 1/4 activations/**default** float float32 /output 7 conv2d_conv2d_weights 480/1920 weights/weights const float float32 8 conv2d_conv2d_bias 16/64 weights/weights const float float32 9 batch_normalization_scale 16/64 weights/weights const float float32 10 batch_normalization_bias 16/64 weights/weights const float float32 11 conv2d_1_conv2d_weights 4608/18432 weights/weights const float float32 12 conv2d_1_conv2d_bias 32/128 weights/weights const float float32 13 batch_normalization_1_scale 32/128 weights/weights const float float32 14 batch_normalization_1_bias 32/128 weights/weights const float float32 15 dense_dense_weights 5120/20480 weights/weights const float float32 16 dense_dense_bias 40/160 weights/weights const float float32 17 dense_1_dense_weights 800/3200 weights/weights const float float32 18 dense_1_dense_bias 20/80 weights/weights const float float32 19 dense_2_dense_weights 20/80 weights/weights const float float32 20 dense_2_dense_bias 1/4 weights/weights const float float32 21 input_1_output 3300/13200 activations/**default** float float32 /input 22 conv2d_conv2d_output 3200/12800 activations/**default** float float32 23 conv2d_output 3200/12800 activations/**default** float float32 24 batch_normalization_output 3200/12800 activations/**default** float float32 25 max_pooling2d_output 640/2560 activations/**default** float float32 26 conv2d_1_conv2d_output 512/2048 activations/**default** float float32 27 conv2d_1_output 512/2048 activations/**default** float float32 28 batch_normalization_1_output 512/2048 activations/**default** float float32 ------ ------------------------------ ------------ ------------------------- ------------- --------- --------- C-Layers (14) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- c_id name (*_layer) id layer_type macc rom tensors shape (array id) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 0 conv2d_conv2d 1 conv2d 96016 1984 I: input_1_output (1,100,33,1) (21) W: conv2d_conv2d_weights (1,5,6,16) (7) W: conv2d_conv2d_bias (16,) (8) O: conv2d_conv2d_output (1,20,10,16) (22) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 1 conv2d 1 nl 3200 0 I: conv2d_conv2d_output (1,20,10,16) (22) O: conv2d_output (1,20,10,16) (23) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 2 batch_normalization 2 bn 6400 128 I: conv2d_output (1,20,10,16) (23) W: batch_normalization_scale (16,) (9) W: batch_normalization_bias (16,) (10) O: batch_normalization_output (1,20,10,16) (24) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 3 max_pooling2d 3 pool 5120 0 I: batch_normalization_output (1,20,10,16) (24) O: max_pooling2d_output (1,10,4,16) (25) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 4 conv2d_1_conv2d 4 conv2d 73760 18560 I: max_pooling2d_output (1,10,4,16) (25) W: conv2d_1_conv2d_weights (16,3,3,32) (11) W: conv2d_1_conv2d_bias (32,) (12) O: conv2d_1_conv2d_output (1,8,2,32) (26) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 5 conv2d_1 4 nl 512 0 I: conv2d_1_conv2d_output (1,8,2,32) (26) O: conv2d_1_output (1,8,2,32) (27) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 6 batch_normalization_1 5 bn 1024 256 I: conv2d_1_output (1,8,2,32) (27) W: batch_normalization_1_scale (32,) (13) W: batch_normalization_1_bias (32,) (14) O: batch_normalization_1_output (1,8,2,32) (28) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 7 max_pooling2d_1 6 pool 512 0 I: batch_normalization_1_output (1,8,2,32) (28) O: max_pooling2d_1_output (1,4,1,32) (0) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 8 dense_dense 10 dense 5160 20640 I: max_pooling2d_1_output0 (1,128) (0) W: dense_dense_weights (128,40) (15) W: dense_dense_bias (40,) (16) O: dense_dense_output (1,40) (1) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 9 dense 10 nl 40 0 I: dense_dense_output (1,40) (1) O: dense_output (1,40) (2) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 10 dense_1_dense 12 dense 820 3280 I: dense_output (1,40) (2) W: dense_1_dense_weights (40,20) (17) W: dense_1_dense_bias (20,) (18) O: dense_1_dense_output (1,20) (3) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 11 dense_1 12 nl 20 0 I: dense_1_dense_output (1,20) (3) O: dense_1_output (1,20) (4) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 12 dense_2_dense 14 dense 21 84 I: dense_1_output (1,20) (4) W: dense_2_dense_weights (20,1) (19) W: dense_2_dense_bias (1,) (20) O: dense_2_dense_output (1,1) (5) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- 13 dense_2 14 nl 10 0 I: dense_2_dense_output (1,1) (5) O: dense_2_output (1,1) (6) ------ ----------------------- ---- ------------ ------- ------- --------------------------------- ------------------- Setting validation data... loading file: C:\Users\mehmet\PycharmProjects\Scaleup_Datasets\inputdatas.csv - samples are reshaped: (16, 3300) -> (16, 100, 33, 1) loading file: C:\Users\mehmet\Desktop\outai - Copy.csv - samples are reshaped: (16, 1) -> (16, 1, 1, 1) I[1]: (16, 100, 33, 1)/float32, min/max=[2.669, 24.810], mean/std=[9.430, 4.400], input_1 O[1]: (16, 1, 1, 1)/float32, min/max=[0.000, 1.000], mean/std=[0.500, 0.500], dense_2 Running the STM AI c-model (AI RUNNER)...(name=offlinetest, mode=x86) X86 shared lib (C:\Users\mehmet\AppData\Local\Temp\mxAI_workspace11435612028714001304179832728160913\inspector_offlinetest\workspace\lib\libai_offlinetest.dll) ['offlinetest'] Summary "offlinetest" - ['offlinetest'] --------------------------------------------------------------------------------------------- inputs/ouputs : 1/1 input_1 : input_1, (1,100,33,1), float32, 13,200 bytes, in activations buffer output_1 : output_1, (1,1,1,1), float32, 4 bytes, in activations buffer n_nodes : 14 compile_datetime : Jul 24 2024 15:15:53 activations : 14668 weights : 44932 macc : 192615 --------------------------------------------------------------------------------------------- runtime : STM.AI(/) 8.1.0 (Tools 8.1.0) - capabilities : IO_ONLY, PER_LAYER, PER_LAYER_WITH_DATA device : AMD64 Intel64 Family 6 Model 167 Stepping 1, GenuineIntel (Windows) NOTE: duration and exec time per layer is just an indication. They are dependent of the HOST-machine work-load. STM.AI Profiling results v1.2 - offlinetest ------------------------------------------------------------ nb sample(s) : 16 duration : 0.199ms by sample (0.168/0.321/0.039) macc : 192615 ------------------------------------------------------------ HOST duration : 0.018s (total) ------------------------------------------------------------ Inference time per node ----------------------------------------------------------------------- c_id m_id type dur (ms) % name ----------------------------------------------------------------------- 0 1 Conv2D (0x103) 0.104 52.2% ai_node_0 1 1 NL (0x107) 0.006 3.2% ai_node_1 2 2 BN (0x102) 0.003 1.4% ai_node_2 3 3 Pool (0x10b) 0.004 2.1% ai_node_3 4 4 Conv2D (0x103) 0.070 35.3% ai_node_4 5 4 NL (0x107) 0.002 0.8% ai_node_5 6 5 BN (0x102) 0.001 0.3% ai_node_6 7 6 Pool (0x10b) 0.001 0.5% ai_node_7 8 10 Dense (0x104) 0.004 2.2% ai_node_8 9 10 NL (0x107) 0.000 0.1% ai_node_9 10 12 Dense (0x104) 0.001 0.3% ai_node_10 11 12 NL (0x107) 0.000 0.2% ai_node_11 12 14 Dense (0x104) 0.000 0.1% ai_node_12 13 14 NL (0x107) 0.002 0.8% ai_node_13 ----------------------------------------------------------------------- total 0.198 ----------------------------------------------------------------------- Statistic per tensor ------------------------------------------------------------------------------ tensor shape/type min max mean std name ------------------------------------------------------------------------------ I.0 (1,100,33,1)/float32 2.669 24.810 9.430 4.400 input_1 O.0 (1,1,1,1)/float32 0.006 0.991 0.482 0.471 output_1 ------------------------------------------------------------------------------ Saving validation data... output directory: C:\Users\mehmet\.stm32cubemx\network_output creating C:\Users\mehmet\.stm32cubemx\network_output\offlinetest_val_io.npz m_outputs_1: (16, 1, 1, 1)/float32, min/max=[0.006, 0.991], mean/std=[0.482, 0.471], dense_2 c_outputs_1: (16, 1, 1, 1)/float32, min/max=[0.006, 0.991], mean/std=[0.482, 0.471], dense_2 Computing the metrics... Accuracy report #1 for the generated x86 C-model ---------------------------------------------------------------------------------------------------- notes: - computed against the provided ground truth values - 16 samples (1 items per sample) acc=n.a., rmse=0.043537192, mae=0.030179504, l2r=0.064640373, nse=99.29%, cos=99.92% Accuracy report #1 for the reference model ---------------------------------------------------------------------------------------------------- notes: - computed against the provided ground truth values - 16 samples (1 items per sample) acc=n.a., rmse=0.043537170, mae=0.030179486, l2r=0.064640343, nse=99.29%, cos=99.92% Cross accuracy report #1 (reference vs C-model) ---------------------------------------------------------------------------------------------------- notes: - the output of the reference model is used as ground truth/reference value - 16 samples (1 items per sample) acc=n.a., rmse=0.000000045, mae=0.000000028, l2r=0.000000067, nse=100.00%, cos=100.00% Number of operations per c-layer ------- ------ ---------------------------- --------- -------------- -------- ---------- c_id m_id name (type) #op type #param sparsity ------- ------ ---------------------------- --------- -------------- -------- ---------- 0 1 conv2d_conv2d (conv2d) 96,016 smul_f32_f32 496 0.0000 1 1 conv2d (nl) 3,200 op_f32_f32 2 2 batch_normalization (bn) 6,400 smul_f32_f32 32 0.0000 3 3 max_pooling2d (pool) 5,120 op_f32_f32 4 4 conv2d_1_conv2d (conv2d) 73,760 smul_f32_f32 4,640 0.0000 5 4 conv2d_1 (nl) 512 op_f32_f32 6 5 batch_normalization_1 (bn) 1,024 smul_f32_f32 64 0.0000 7 6 max_pooling2d_1 (pool) 512 op_f32_f32 8 10 dense_dense (dense) 5,160 smul_f32_f32 5,160 0.0000 9 10 dense (nl) 40 op_f32_f32 10 12 dense_1_dense (dense) 820 smul_f32_f32 820 0.0000 11 12 dense_1 (nl) 20 op_f32_f32 12 14 dense_2_dense (dense) 21 smul_f32_f32 21 0.0000 13 14 dense_2 (nl) 10 op_f32_f32 ------- ------ ---------------------------- --------- -------------- -------- ---------- total 192,615 11,233 0.0000 Number of operation types ---------------- --------- ----------- operation type # % ---------------- --------- ----------- smul_f32_f32 183,201 95.1% op_f32_f32 9,414 4.9% Complexity report (model) ------ ----------------------- ------------------------- ------------------------- ---------- -------- ------------------ m_id name c_macc c_rom c_id c_dur l2r (X-CROSS) ------ ----------------------- ------------------------- ------------------------- ---------- -------- ------------------ 1 conv2d_conv2d |||||||||||||||| 51.5% || 4.4% [0, 1] 56.5% 2 batch_normalization | 3.3% | 0.3% [2] 1.1% 3 max_pooling2d | 2.7% | 0.0% [3] 1.7% 4 conv2d_1_conv2d |||||||||||| 38.6% |||||||||||||| 41.3% [4, 5] 37.0% 5 batch_normalization_1 | 0.5% | 0.6% [6] 0.3% 6 max_pooling2d_1 | 0.3% | 0.0% [7] 0.5% 10 dense_dense | 2.7% |||||||||||||||| 45.9% [8, 9] 1.9% 12 dense_1_dense | 0.4% ||| 7.3% [10, 11] 0.5% 14 dense_2_dense | 0.0% | 0.2% [12, 13] 0.5% 6.65439330e-08 * ------ ----------------------- ------------------------- ------------------------- ---------- -------- ------------------ macc=192,615 weights=44,932 act=14,668 ram_io=0 Evaluation report (summary) ----------------------------------------------------------------------------------------------------------------------------------------------------- Output acc rmse mae l2r mean std nse cos tensor ----------------------------------------------------------------------------------------------------------------------------------------------------- x86 c-model #1 n.a. 0.0435372 0.0301795 0.0646404 0.0180742 0.0409072 0.9928919 0.9991937 dense_2, ai_float, (1,1), m_id=[14] original model #1 n.a. 0.0435372 0.0301795 0.0646403 0.0180742 0.0409072 0.9928919 0.9991937 dense_2, ai_float, (1,1), m_id=[14] X-cross #1 n.a. 0.0000000 0.0000000 0.0000001 0.0000000 0.0000000 1.0000000 1.0000000 dense_2, ai_float, (1,1), m_id=[14] ----------------------------------------------------------------------------------------------------------------------------------------------------- acc : Classification accuracy (all classes) rmse : Root Mean Squared Error mae : Mean Absolute Error l2r : L2 relative error nse : Nash-Sutcliffe efficiency criteria cos : COsine Similarity