-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparameters.h
81 lines (74 loc) · 2.8 KB
/
parameters.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef PARAMETERS_H_
#define PARAMETERS_H_
#include <complex>
#include "ap_int.h"
#include "ap_fixed.h"
#include "nnet_utils/nnet_layer.h"
#include "nnet_utils/nnet_conv.h"
#include "nnet_utils/nnet_activation.h"
#include "nnet_utils/nnet_common.h"
#define STREAMSIZE 16384
//hls-fpga-machine-learning insert numbers
typedef ap_fixed<32,14> accum_default_t;
typedef ap_fixed<32,14> weight_default_t;
typedef ap_fixed<32,14> bias_default_t;
typedef ap_fixed<32,14> input_t;
typedef ap_fixed<32,14> result_t;
#define N_INPUTS 11
#define N_LAYER_1 15
#define N_LAYER_2 5
#define N_OUTPUTS 1
typedef ap_fixed<32,14> data32_t;
//hls-fpga-machine-learning insert layer-precision
typedef ap_fixed<32,14> layer1_t;
typedef ap_fixed<32,14> layer2_t;
//hls-fpga-machine-learning insert layer-config
struct config1 : nnet::layer_config {
static const unsigned n_in = N_INPUTS;
static const unsigned n_out = N_LAYER_1;
static const unsigned io_type = nnet::io_parallel;
static const unsigned reuse_factor = 1;
static const unsigned n_zeros = 0;
static const bool store_weights_in_bram = false;
typedef accum_default_t accum_t;
typedef bias_default_t bias_t;
typedef weight_default_t weight_t;
};
struct linear_config1 : nnet::activ_config {
static const unsigned n_in = N_LAYER_1;
static const unsigned table_size = 1024;
static const unsigned io_type = nnet::io_parallel;
};
struct config2 : nnet::layer_config {
static const unsigned n_in = N_LAYER_1;
static const unsigned n_out = N_LAYER_2;
static const unsigned io_type = nnet::io_parallel;
static const unsigned reuse_factor = 1;
static const unsigned n_zeros = 0;
static const bool store_weights_in_bram = false;
typedef accum_default_t accum_t;
typedef bias_default_t bias_t;
typedef weight_default_t weight_t;
};
struct linear_config2 : nnet::activ_config {
static const unsigned n_in = N_LAYER_2;
static const unsigned table_size = 1024;
static const unsigned io_type = nnet::io_parallel;
};
struct config3 : nnet::layer_config {
static const unsigned n_in = N_LAYER_2;
static const unsigned n_out = N_OUTPUTS;
static const unsigned io_type = nnet::io_parallel;
static const unsigned reuse_factor = 1;
static const unsigned n_zeros = 0;
static const bool store_weights_in_bram = false;
typedef accum_default_t accum_t;
typedef bias_default_t bias_t;
typedef weight_default_t weight_t;
};
struct linear_config3 : nnet::activ_config {
static const unsigned n_in = N_OUTPUTS;
static const unsigned table_size = 1024;
static const unsigned io_type = nnet::io_parallel;
};
#endif