forked from hrx2010/dl_inference_c_lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.c
21 lines (17 loc) · 936 Bytes
/
Main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "dl_layers.h"
#include <stdio.h>
int main(){
// load input from file
struct cls_tensor_activations input = read_activations_from_file("./testing_data/input.bin" , 224 , 224 , 3);
// load weights from file
struct cls_tensor_weights weights = read_weights_from_file("./testing_data/weights.bin" , 3 , 3 , 3 , 8);
// load bias from file
struct cls_tensor_biases biases = read_biases_from_file("./testing_data/biases.bin" , 8);
// compute 2D convolution results
struct cls_tensor_activations output = convolution_2D(input , weights , biases , 1 , 1);
// load ground truth from file
struct cls_tensor_activations output_ground_truth = read_activations_from_file("./testing_data/output.bin" , output.height , output.width , output.depth);
// test convolution 2D results
printf("mean square error is %f\n" , compute_mean_square_error(output , output_ground_truth));
return 0;
}