添加功能:sendblock

验证通过
This commit is contained in:
Qiea
2024-11-12 10:59:42 +08:00
parent edd76c2871
commit 15e6a6e1dc
6 changed files with 94 additions and 6 deletions

View File

@@ -278,7 +278,7 @@ void cnn_run(){
calculate_statistics(data,&value[0]);
if (check_threshold(data,&value[0])){
float* _data = generateMatrix(data,&value[0]);
send_blocks(_data);
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>\r\n");
//<2F><>һ<EFBFBD><EFBFBD><E3A3BA><EFBFBD><EFBFBD>102 * 102
@@ -286,12 +286,14 @@ void cnn_run(){
float* conv_rlst_1 = convolution(conv1_weight,conv1_bias,expand_matrix_1, 102);
float* pool_rslt_1 = pooling(conv1_weight, conv_rlst_1, 100);
{
myfree(SRAMEX,_data);
_data = NULL;
myfree(SRAMEX,expand_matrix_1);
expand_matrix_1 = NULL;
myfree(SRAMEX,conv_rlst_1);
conv_rlst_1 = NULL;
}
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD>ڶ<EFBFBD><EFBFBD><EFBFBD>\r\n");
@@ -300,13 +302,14 @@ void cnn_run(){
float* conv_rlst_2 = convolution(conv2_weight,conv2_bias,expand_matrix_2, 52);
float* pool_rslt_2 = pooling(conv2_weight, conv_rlst_2, 50);
{
myfree(SRAMEX,pool_rslt_1);
pool_rslt_1 = NULL;
myfree(SRAMEX,expand_matrix_2);
expand_matrix_2 = NULL;
myfree(SRAMEX,conv_rlst_2);
conv_rlst_2 = NULL;
}
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3A3BA><EFBFBD><EFBFBD> 64 * 27 * 27
@@ -314,12 +317,14 @@ void cnn_run(){
float* conv_rlst_3 = convolution(conv3_weight,conv3_bias,expand_matrix_3, 27);
float* pool_rslt_3 = pooling(conv3_weight, conv_rlst_3, 25);
{
myfree(SRAMEX,pool_rslt_2);
pool_rslt_2 = NULL;
myfree(SRAMEX,expand_matrix_3);
expand_matrix_3 = NULL;
myfree(SRAMEX,conv_rlst_3);
conv_rlst_3 = NULL;
}
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD>\r\n");
float* affine1_rslt = hidden(pool_rslt_3);
@@ -327,12 +332,14 @@ void cnn_run(){
DEBUG_PRINTF("<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\r\n");
float* affine2_rslt = output(affine1_rslt);
{
myfree(SRAMEX,pool_rslt_3);
pool_rslt_3 = NULL;
myfree(SRAMEX,affine1_rslt);
affine1_rslt = NULL;
myfree(SRAMEX,affine2_rslt);
affine2_rslt = NULL;
}
} else{
printf("δ<EFBFBD>ŵ磡<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ:%f ƽ<><C6BD>ֵ:%f <20><>׼<EFBFBD><D7BC>:%f\r\n",value[0],value[1],value[2]);