| #ifndef PARAMETERS_H_ |
| #define PARAMETERS_H_ |
|
|
| #include "ap_fixed.h" |
| #include "ap_int.h" |
|
|
| #include "nnet_utils/nnet_code_gen.h" |
| #include "nnet_utils/nnet_helpers.h" |
| |
| #include "nnet_utils/nnet_activation.h" |
| #include "nnet_utils/nnet_activation_stream.h" |
| #include "nnet_utils/nnet_conv2d.h" |
| #include "nnet_utils/nnet_conv2d_stream.h" |
| #include "nnet_utils/nnet_image.h" |
| #include "nnet_utils/nnet_image_stream.h" |
| #include "nnet_utils/nnet_merge.h" |
| #include "nnet_utils/nnet_merge_stream.h" |
| #include "nnet_utils/nnet_padding.h" |
| #include "nnet_utils/nnet_padding_stream.h" |
| #include "nnet_utils/nnet_pooling.h" |
| #include "nnet_utils/nnet_pooling_stream.h" |
| #include "nnet_utils/nnet_sepconv2d_stream.h" |
| #include "nnet_utils/nnet_stream.h" |
|
|
| |
| #include "weights/w2.h" |
| #include "weights/b2.h" |
| #include "weights/w4.h" |
| #include "weights/b4.h" |
| #include "weights/w7.h" |
| #include "weights/b7.h" |
| #include "weights/w9.h" |
| #include "weights/b9.h" |
| #include "weights/w12.h" |
| #include "weights/b12.h" |
| #include "weights/w14.h" |
| #include "weights/b14.h" |
| #include "weights/w17.h" |
| #include "weights/b17.h" |
| #include "weights/w19.h" |
| #include "weights/b19.h" |
| #include "weights/w23.h" |
| #include "weights/b23.h" |
| #include "weights/w25.h" |
| #include "weights/b25.h" |
| #include "weights/w29.h" |
| #include "weights/b29.h" |
| #include "weights/w31.h" |
| #include "weights/b31.h" |
| #include "weights/w35.h" |
| #include "weights/b35.h" |
| #include "weights/w37.h" |
| #include "weights/b37.h" |
| #include "weights/w39.h" |
| #include "weights/b39.h" |
|
|
|
|
| |
| |
| struct config44 : nnet::padding2d_config { |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_chan = 1; |
| static const unsigned out_height = 66; |
| static const unsigned out_width = 66; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config2_mult : nnet::dense_config { |
| static const unsigned n_in = 9; |
| static const unsigned n_out = 8; |
| static const unsigned reuse_factor = 72; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv1_0_accum_t accum_t; |
| typedef conv1_0_bias_t bias_t; |
| typedef conv1_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config2 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 66; |
| static const unsigned in_width = 66; |
| static const unsigned n_chan = 1; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 8; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 64; |
| static const unsigned out_width = 64; |
| static const unsigned reuse_factor = 72; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 66; |
| static const unsigned min_width = 66; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 4096; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv1_0_accum_t accum_t; |
| typedef conv1_0_bias_t bias_t; |
| typedef conv1_0_weight_t weight_t; |
| typedef config2_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config2::filt_height * config2::filt_width> config2::pixels[] = {0}; |
|
|
| |
| struct relu_config3 : nnet::activ_config { |
| static const unsigned n_in = 32768; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 160; |
| typedef conv1_1_table_t table_t; |
| }; |
|
|
| |
| struct config45 : nnet::padding2d_config { |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_chan = 8; |
| static const unsigned out_height = 66; |
| static const unsigned out_width = 66; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config4_mult : nnet::dense_config { |
| static const unsigned n_in = 72; |
| static const unsigned n_out = 8; |
| static const unsigned reuse_factor = 144; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv1_2_accum_t accum_t; |
| typedef conv1_2_bias_t bias_t; |
| typedef conv1_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config4 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 66; |
| static const unsigned in_width = 66; |
| static const unsigned n_chan = 8; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 8; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 64; |
| static const unsigned out_width = 64; |
| static const unsigned reuse_factor = 144; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 66; |
| static const unsigned min_width = 66; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 4096; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv1_2_accum_t accum_t; |
| typedef conv1_2_bias_t bias_t; |
| typedef conv1_2_weight_t weight_t; |
| typedef config4_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config4::filt_height * config4::filt_width> config4::pixels[] = {0}; |
|
|
| |
| struct relu_config5 : nnet::activ_config { |
| static const unsigned n_in = 32768; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 160; |
| typedef conv1_3_table_t table_t; |
| }; |
|
|
| |
| struct config6 : nnet::pooling2d_config { |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_filt = 8; |
| static const unsigned stride_height = 2; |
| static const unsigned stride_width = 2; |
| static const unsigned pool_height = 2; |
| static const unsigned pool_width = 2; |
|
|
| static const unsigned filt_height = pool_height; |
| static const unsigned filt_width = pool_width; |
| static const unsigned n_chan = n_filt; |
|
|
| static const unsigned out_height = 32; |
| static const unsigned out_width = 32; |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const bool count_pad = true; |
| static const nnet::Pool_Op pool_op = nnet::Max; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned reuse_factor = 160; |
| typedef pool1_accum_t accum_t; |
| }; |
|
|
| |
| struct config46 : nnet::padding2d_config { |
| static const unsigned in_height = 32; |
| static const unsigned in_width = 32; |
| static const unsigned n_chan = 8; |
| static const unsigned out_height = 34; |
| static const unsigned out_width = 34; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config7_mult : nnet::dense_config { |
| static const unsigned n_in = 72; |
| static const unsigned n_out = 16; |
| static const unsigned reuse_factor = 144; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv2_0_accum_t accum_t; |
| typedef conv2_0_bias_t bias_t; |
| typedef conv2_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config7 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 34; |
| static const unsigned in_width = 34; |
| static const unsigned n_chan = 8; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 16; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 32; |
| static const unsigned out_width = 32; |
| static const unsigned reuse_factor = 144; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 34; |
| static const unsigned min_width = 34; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 1024; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv2_0_accum_t accum_t; |
| typedef conv2_0_bias_t bias_t; |
| typedef conv2_0_weight_t weight_t; |
| typedef config7_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config7::filt_height * config7::filt_width> config7::pixels[] = {0}; |
|
|
| |
| struct relu_config8 : nnet::activ_config { |
| static const unsigned n_in = 16384; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 160; |
| typedef conv2_1_table_t table_t; |
| }; |
|
|
| |
| struct config47 : nnet::padding2d_config { |
| static const unsigned in_height = 32; |
| static const unsigned in_width = 32; |
| static const unsigned n_chan = 16; |
| static const unsigned out_height = 34; |
| static const unsigned out_width = 34; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config9_mult : nnet::dense_config { |
| static const unsigned n_in = 144; |
| static const unsigned n_out = 16; |
| static const unsigned reuse_factor = 144; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv2_2_accum_t accum_t; |
| typedef conv2_2_bias_t bias_t; |
| typedef conv2_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_leq_nin<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config9 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 34; |
| static const unsigned in_width = 34; |
| static const unsigned n_chan = 16; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 16; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 32; |
| static const unsigned out_width = 32; |
| static const unsigned reuse_factor = 144; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 34; |
| static const unsigned min_width = 34; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 1024; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv2_2_accum_t accum_t; |
| typedef conv2_2_bias_t bias_t; |
| typedef conv2_2_weight_t weight_t; |
| typedef config9_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config9::filt_height * config9::filt_width> config9::pixels[] = {0}; |
|
|
| |
| struct relu_config10 : nnet::activ_config { |
| static const unsigned n_in = 16384; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 160; |
| typedef conv2_3_table_t table_t; |
| }; |
|
|
| |
| struct config11 : nnet::pooling2d_config { |
| static const unsigned in_height = 32; |
| static const unsigned in_width = 32; |
| static const unsigned n_filt = 16; |
| static const unsigned stride_height = 2; |
| static const unsigned stride_width = 2; |
| static const unsigned pool_height = 2; |
| static const unsigned pool_width = 2; |
|
|
| static const unsigned filt_height = pool_height; |
| static const unsigned filt_width = pool_width; |
| static const unsigned n_chan = n_filt; |
|
|
| static const unsigned out_height = 16; |
| static const unsigned out_width = 16; |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const bool count_pad = true; |
| static const nnet::Pool_Op pool_op = nnet::Max; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned reuse_factor = 160; |
| typedef pool2_accum_t accum_t; |
| }; |
|
|
| |
| struct config48 : nnet::padding2d_config { |
| static const unsigned in_height = 16; |
| static const unsigned in_width = 16; |
| static const unsigned n_chan = 16; |
| static const unsigned out_height = 18; |
| static const unsigned out_width = 18; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config12_mult : nnet::dense_config { |
| static const unsigned n_in = 144; |
| static const unsigned n_out = 32; |
| static const unsigned reuse_factor = 576; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv3_0_accum_t accum_t; |
| typedef conv3_0_bias_t bias_t; |
| typedef conv3_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config12 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 18; |
| static const unsigned in_width = 18; |
| static const unsigned n_chan = 16; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 32; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 16; |
| static const unsigned out_width = 16; |
| static const unsigned reuse_factor = 576; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 18; |
| static const unsigned min_width = 18; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 256; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv3_0_accum_t accum_t; |
| typedef conv3_0_bias_t bias_t; |
| typedef conv3_0_weight_t weight_t; |
| typedef config12_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config12::filt_height * config12::filt_width> config12::pixels[] = {0}; |
|
|
| |
| struct relu_config13 : nnet::activ_config { |
| static const unsigned n_in = 8192; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 512; |
| typedef conv3_1_table_t table_t; |
| }; |
|
|
| |
| struct config49 : nnet::padding2d_config { |
| static const unsigned in_height = 16; |
| static const unsigned in_width = 16; |
| static const unsigned n_chan = 32; |
| static const unsigned out_height = 18; |
| static const unsigned out_width = 18; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config14_mult : nnet::dense_config { |
| static const unsigned n_in = 288; |
| static const unsigned n_out = 32; |
| static const unsigned reuse_factor = 576; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv3_2_accum_t accum_t; |
| typedef conv3_2_bias_t bias_t; |
| typedef conv3_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config14 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 18; |
| static const unsigned in_width = 18; |
| static const unsigned n_chan = 32; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 32; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 16; |
| static const unsigned out_width = 16; |
| static const unsigned reuse_factor = 576; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 18; |
| static const unsigned min_width = 18; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 256; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv3_2_accum_t accum_t; |
| typedef conv3_2_bias_t bias_t; |
| typedef conv3_2_weight_t weight_t; |
| typedef config14_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config14::filt_height * config14::filt_width> config14::pixels[] = {0}; |
|
|
| |
| struct relu_config15 : nnet::activ_config { |
| static const unsigned n_in = 8192; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 512; |
| typedef conv3_3_table_t table_t; |
| }; |
|
|
| |
| struct config16 : nnet::pooling2d_config { |
| static const unsigned in_height = 16; |
| static const unsigned in_width = 16; |
| static const unsigned n_filt = 32; |
| static const unsigned stride_height = 2; |
| static const unsigned stride_width = 2; |
| static const unsigned pool_height = 2; |
| static const unsigned pool_width = 2; |
|
|
| static const unsigned filt_height = pool_height; |
| static const unsigned filt_width = pool_width; |
| static const unsigned n_chan = n_filt; |
|
|
| static const unsigned out_height = 8; |
| static const unsigned out_width = 8; |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const bool count_pad = true; |
| static const nnet::Pool_Op pool_op = nnet::Max; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned reuse_factor = 160; |
| typedef pool3_accum_t accum_t; |
| }; |
|
|
| |
| struct config50 : nnet::padding2d_config { |
| static const unsigned in_height = 8; |
| static const unsigned in_width = 8; |
| static const unsigned n_chan = 32; |
| static const unsigned out_height = 10; |
| static const unsigned out_width = 10; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config17_mult : nnet::dense_config { |
| static const unsigned n_in = 288; |
| static const unsigned n_out = 64; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv4_0_accum_t accum_t; |
| typedef conv4_0_bias_t bias_t; |
| typedef conv4_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config17 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 10; |
| static const unsigned in_width = 10; |
| static const unsigned n_chan = 32; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 64; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 8; |
| static const unsigned out_width = 8; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 10; |
| static const unsigned min_width = 10; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 64; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv4_0_accum_t accum_t; |
| typedef conv4_0_bias_t bias_t; |
| typedef conv4_0_weight_t weight_t; |
| typedef config17_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config17::filt_height * config17::filt_width> config17::pixels[] = {0}; |
|
|
| |
| struct relu_config18 : nnet::activ_config { |
| static const unsigned n_in = 4096; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 1024; |
| typedef conv4_1_table_t table_t; |
| }; |
|
|
| |
| struct config51 : nnet::padding2d_config { |
| static const unsigned in_height = 8; |
| static const unsigned in_width = 8; |
| static const unsigned n_chan = 64; |
| static const unsigned out_height = 10; |
| static const unsigned out_width = 10; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config19_mult : nnet::dense_config { |
| static const unsigned n_in = 576; |
| static const unsigned n_out = 64; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef conv4_2_accum_t accum_t; |
| typedef conv4_2_bias_t bias_t; |
| typedef conv4_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config19 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 10; |
| static const unsigned in_width = 10; |
| static const unsigned n_chan = 64; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 64; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 8; |
| static const unsigned out_width = 8; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 10; |
| static const unsigned min_width = 10; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 64; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef conv4_2_accum_t accum_t; |
| typedef conv4_2_bias_t bias_t; |
| typedef conv4_2_weight_t weight_t; |
| typedef config19_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config19::filt_height * config19::filt_width> config19::pixels[] = {0}; |
|
|
| |
| struct relu_config20 : nnet::activ_config { |
| static const unsigned n_in = 4096; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 1024; |
| typedef conv4_3_table_t table_t; |
| }; |
|
|
| |
| struct config21 : nnet::resize_config { |
| static const unsigned height = 8; |
| static const unsigned width = 8; |
| static const unsigned n_chan = 64; |
| static const unsigned new_height = 16; |
| static const unsigned new_width = 16; |
| }; |
|
|
| |
| struct config22 : nnet::concat_config { |
| static const unsigned n_elem1_0 = 16; |
| static const unsigned n_elem1_1 = 16; |
| static const unsigned n_elem1_2 = 64; |
| static const unsigned n_elem2_0 = 16; |
| static const unsigned n_elem2_1 = 16; |
| static const unsigned n_elem2_2 = 32; |
|
|
| static const int axis = 3; |
| }; |
|
|
| |
| struct config52 : nnet::padding2d_config { |
| static const unsigned in_height = 16; |
| static const unsigned in_width = 16; |
| static const unsigned n_chan = 96; |
| static const unsigned out_height = 18; |
| static const unsigned out_width = 18; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config23_mult : nnet::dense_config { |
| static const unsigned n_in = 864; |
| static const unsigned n_out = 32; |
| static const unsigned reuse_factor = 864; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv3_0_accum_t accum_t; |
| typedef deconv3_0_bias_t bias_t; |
| typedef deconv3_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_leq_nin<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config23 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 18; |
| static const unsigned in_width = 18; |
| static const unsigned n_chan = 96; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 32; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 16; |
| static const unsigned out_width = 16; |
| static const unsigned reuse_factor = 864; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 18; |
| static const unsigned min_width = 18; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 256; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv3_0_accum_t accum_t; |
| typedef deconv3_0_bias_t bias_t; |
| typedef deconv3_0_weight_t weight_t; |
| typedef config23_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config23::filt_height * config23::filt_width> config23::pixels[] = {0}; |
|
|
| |
| struct relu_config24 : nnet::activ_config { |
| static const unsigned n_in = 8192; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 1024; |
| typedef deconv3_1_table_t table_t; |
| }; |
|
|
| |
| struct config53 : nnet::padding2d_config { |
| static const unsigned in_height = 16; |
| static const unsigned in_width = 16; |
| static const unsigned n_chan = 32; |
| static const unsigned out_height = 18; |
| static const unsigned out_width = 18; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config25_mult : nnet::dense_config { |
| static const unsigned n_in = 288; |
| static const unsigned n_out = 32; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv3_2_accum_t accum_t; |
| typedef deconv3_2_bias_t bias_t; |
| typedef deconv3_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config25 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 18; |
| static const unsigned in_width = 18; |
| static const unsigned n_chan = 32; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 32; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 16; |
| static const unsigned out_width = 16; |
| static const unsigned reuse_factor = 1152; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 18; |
| static const unsigned min_width = 18; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 256; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv3_2_accum_t accum_t; |
| typedef deconv3_2_bias_t bias_t; |
| typedef deconv3_2_weight_t weight_t; |
| typedef config25_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config25::filt_height * config25::filt_width> config25::pixels[] = {0}; |
|
|
| |
| struct relu_config26 : nnet::activ_config { |
| static const unsigned n_in = 8192; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 1024; |
| typedef deconv3_3_table_t table_t; |
| }; |
|
|
| |
| struct config27 : nnet::resize_config { |
| static const unsigned height = 16; |
| static const unsigned width = 16; |
| static const unsigned n_chan = 32; |
| static const unsigned new_height = 32; |
| static const unsigned new_width = 32; |
| }; |
|
|
| |
| struct config28 : nnet::concat_config { |
| static const unsigned n_elem1_0 = 32; |
| static const unsigned n_elem1_1 = 32; |
| static const unsigned n_elem1_2 = 32; |
| static const unsigned n_elem2_0 = 32; |
| static const unsigned n_elem2_1 = 32; |
| static const unsigned n_elem2_2 = 16; |
|
|
| static const int axis = 3; |
| }; |
|
|
| |
| struct config54 : nnet::padding2d_config { |
| static const unsigned in_height = 32; |
| static const unsigned in_width = 32; |
| static const unsigned n_chan = 48; |
| static const unsigned out_height = 34; |
| static const unsigned out_width = 34; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config29_mult : nnet::dense_config { |
| static const unsigned n_in = 432; |
| static const unsigned n_out = 16; |
| static const unsigned reuse_factor = 432; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv2_0_accum_t accum_t; |
| typedef deconv2_0_bias_t bias_t; |
| typedef deconv2_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_leq_nin<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config29 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 34; |
| static const unsigned in_width = 34; |
| static const unsigned n_chan = 48; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 16; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 32; |
| static const unsigned out_width = 32; |
| static const unsigned reuse_factor = 432; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 34; |
| static const unsigned min_width = 34; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 1024; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv2_0_accum_t accum_t; |
| typedef deconv2_0_bias_t bias_t; |
| typedef deconv2_0_weight_t weight_t; |
| typedef config29_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config29::filt_height * config29::filt_width> config29::pixels[] = {0}; |
|
|
| |
| struct relu_config30 : nnet::activ_config { |
| static const unsigned n_in = 16384; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 512; |
| typedef deconv2_1_table_t table_t; |
| }; |
|
|
| |
| struct config55 : nnet::padding2d_config { |
| static const unsigned in_height = 32; |
| static const unsigned in_width = 32; |
| static const unsigned n_chan = 16; |
| static const unsigned out_height = 34; |
| static const unsigned out_width = 34; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config31_mult : nnet::dense_config { |
| static const unsigned n_in = 144; |
| static const unsigned n_out = 16; |
| static const unsigned reuse_factor = 576; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv2_2_accum_t accum_t; |
| typedef deconv2_2_bias_t bias_t; |
| typedef deconv2_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config31 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 34; |
| static const unsigned in_width = 34; |
| static const unsigned n_chan = 16; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 16; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 32; |
| static const unsigned out_width = 32; |
| static const unsigned reuse_factor = 576; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 34; |
| static const unsigned min_width = 34; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 1024; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv2_2_accum_t accum_t; |
| typedef deconv2_2_bias_t bias_t; |
| typedef deconv2_2_weight_t weight_t; |
| typedef config31_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config31::filt_height * config31::filt_width> config31::pixels[] = {0}; |
|
|
| |
| struct relu_config32 : nnet::activ_config { |
| static const unsigned n_in = 16384; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 512; |
| typedef deconv2_3_table_t table_t; |
| }; |
|
|
| |
| struct config33 : nnet::resize_config { |
| static const unsigned height = 32; |
| static const unsigned width = 32; |
| static const unsigned n_chan = 16; |
| static const unsigned new_height = 64; |
| static const unsigned new_width = 64; |
| }; |
|
|
| |
| struct config34 : nnet::concat_config { |
| static const unsigned n_elem1_0 = 64; |
| static const unsigned n_elem1_1 = 64; |
| static const unsigned n_elem1_2 = 16; |
| static const unsigned n_elem2_0 = 64; |
| static const unsigned n_elem2_1 = 64; |
| static const unsigned n_elem2_2 = 8; |
|
|
| static const int axis = 3; |
| }; |
|
|
| |
| struct config56 : nnet::padding2d_config { |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_chan = 24; |
| static const unsigned out_height = 66; |
| static const unsigned out_width = 66; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config35_mult : nnet::dense_config { |
| static const unsigned n_in = 216; |
| static const unsigned n_out = 8; |
| static const unsigned reuse_factor = 216; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv1_0_accum_t accum_t; |
| typedef deconv1_0_bias_t bias_t; |
| typedef deconv1_0_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_leq_nin<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config35 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 66; |
| static const unsigned in_width = 66; |
| static const unsigned n_chan = 24; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 8; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 64; |
| static const unsigned out_width = 64; |
| static const unsigned reuse_factor = 216; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 66; |
| static const unsigned min_width = 66; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 4096; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv1_0_accum_t accum_t; |
| typedef deconv1_0_bias_t bias_t; |
| typedef deconv1_0_weight_t weight_t; |
| typedef config35_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config35::filt_height * config35::filt_width> config35::pixels[] = {0}; |
|
|
| |
| struct relu_config36 : nnet::activ_config { |
| static const unsigned n_in = 32768; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 256; |
| typedef deconv1_1_table_t table_t; |
| }; |
|
|
| |
| struct config57 : nnet::padding2d_config { |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_chan = 8; |
| static const unsigned out_height = 66; |
| static const unsigned out_width = 66; |
| static const unsigned pad_top = 1; |
| static const unsigned pad_bottom = 1; |
| static const unsigned pad_left = 1; |
| static const unsigned pad_right = 1; |
| }; |
|
|
| |
| struct config37_mult : nnet::dense_config { |
| static const unsigned n_in = 72; |
| static const unsigned n_out = 8; |
| static const unsigned reuse_factor = 288; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef deconv1_2_accum_t accum_t; |
| typedef deconv1_2_bias_t bias_t; |
| typedef deconv1_2_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_gt_nin_rem0<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config37 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 66; |
| static const unsigned in_width = 66; |
| static const unsigned n_chan = 8; |
| static const unsigned filt_height = 3; |
| static const unsigned filt_width = 3; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 8; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 64; |
| static const unsigned out_width = 64; |
| static const unsigned reuse_factor = 288; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 66; |
| static const unsigned min_width = 66; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 4096; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef deconv1_2_accum_t accum_t; |
| typedef deconv1_2_bias_t bias_t; |
| typedef deconv1_2_weight_t weight_t; |
| typedef config37_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config37::filt_height * config37::filt_width> config37::pixels[] = {0}; |
|
|
| |
| struct relu_config38 : nnet::activ_config { |
| static const unsigned n_in = 32768; |
| static const unsigned table_size = 1024; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 256; |
| typedef deconv1_3_table_t table_t; |
| }; |
|
|
| |
| struct config58_mult : nnet::dense_config { |
| static const unsigned n_in = 8; |
| static const unsigned n_out = 1; |
| static const unsigned reuse_factor = 8; |
| static const unsigned strategy = nnet::resource; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = DIV_ROUNDUP(n_in * n_out, reuse_factor) - n_zeros / reuse_factor; |
| typedef final_conv_accum_t accum_t; |
| typedef final_conv_bias_t bias_t; |
| typedef final_conv_weight_t weight_t; |
| template<class data_T, class res_T, class CONFIG_T> |
| using kernel = nnet::DenseResource_rf_leq_nin<data_T, res_T, CONFIG_T>; |
| template<class x_T, class y_T> |
| using product = nnet::product::mult<x_T, y_T>; |
| }; |
|
|
| struct config58 : nnet::conv2d_config { |
| static const unsigned pad_top = 0; |
| static const unsigned pad_bottom = 0; |
| static const unsigned pad_left = 0; |
| static const unsigned pad_right = 0; |
| static const unsigned in_height = 64; |
| static const unsigned in_width = 64; |
| static const unsigned n_chan = 8; |
| static const unsigned filt_height = 1; |
| static const unsigned filt_width = 1; |
| static const unsigned kernel_size = filt_height * filt_width; |
| static const unsigned n_filt = 1; |
| static const unsigned stride_height = 1; |
| static const unsigned stride_width = 1; |
| static const unsigned out_height = 64; |
| static const unsigned out_width = 64; |
| static const unsigned reuse_factor = 8; |
| static const unsigned n_zeros = 0; |
| static const unsigned multiplier_limit = |
| DIV_ROUNDUP(kernel_size * n_chan * n_filt, reuse_factor) - n_zeros / reuse_factor; |
| static const bool store_weights_in_bram = false; |
| static const unsigned strategy = nnet::resource; |
| static const nnet::conv_implementation implementation = nnet::conv_implementation::linebuffer; |
| static const unsigned min_height = 64; |
| static const unsigned min_width = 64; |
| static const ap_uint<filt_height * filt_width> pixels[min_height * min_width]; |
| static const unsigned n_partitions = 4096; |
| static const unsigned n_pixels = out_height * out_width / n_partitions; |
| template<class data_T, class CONFIG_T> |
| using fill_buffer = nnet::FillConv2DBuffer<data_T, CONFIG_T>; |
| typedef final_conv_accum_t accum_t; |
| typedef final_conv_bias_t bias_t; |
| typedef final_conv_weight_t weight_t; |
| typedef config58_mult mult_config; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_height = nnet::scale_index_regular<K, S, W>; |
| template<unsigned K, unsigned S, unsigned W> |
| using scale_index_width = nnet::scale_index_regular<K, S, W>; |
| }; |
| const ap_uint<config58::filt_height * config58::filt_width> config58::pixels[] = {0}; |
|
|
| |
| struct sigmoid_config40 : nnet::activ_config { |
| static const unsigned n_in = 4096; |
| static const unsigned table_size = 2048; |
| static const unsigned io_type = nnet::io_stream; |
| static const unsigned reuse_factor = 160; |
| typedef sigmoid_table_t table_t; |
| }; |
|
|
|
|
|
|
| #endif |
|
|