-
Notifications
You must be signed in to change notification settings - Fork 2
/
dl_layers.h
44 lines (30 loc) · 1.35 KB
/
dl_layers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef DL_LAYERS_H_INCLUDED
#define DL_LAYERS_H_INCLUDED
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
typedef char VALUE_TYPE;
struct cls_tensor_weights_1D{
int layer_index;
int num_filters , num_rows , num_cols;
VALUE_TYPE ***filters;
int *bias;
int shift;
bool wReLU;
};
struct cls_tensor_activations_1D{
int num_rows , num_cols;
VALUE_TYPE **feature_map;
};
int compute_output_cols_convolution_1D(int num_input_col , int num_weight_col);
struct cls_tensor_activations_1D convolution_1D_no_padding(struct cls_tensor_activations_1D input , struct cls_tensor_weights_1D weights);
struct cls_tensor_activations_1D read_activations_from_source_code(VALUE_TYPE *data , int num_rows , int num_cols);
struct cls_tensor_activations_1D flatten_activations(struct cls_tensor_activations_1D input);
struct cls_tensor_weights_1D read_weights_1D_from_source_code(int layer_idx, VALUE_TYPE *data , int *bias, int num_filters , int num_rows , int num_cols, int shift, bool wReLU);
void release_tensor_weights_1D(struct cls_tensor_weights_1D weights);
void release_tensor_activations_1D(struct cls_tensor_activations_1D input);
int arg_max(struct cls_tensor_activations_1D final_out, int numOut);
//VALUE_TYPE* read_values_from_file(char *filename , int number);
#endif // DL_LAYERS_H_INCLUDED