blob: 4b6dc8d29651847c7f15ee3598dc1bf3c1ed45c0 [file] [log] [blame]
Georgios Pinitas652bde52018-01-10 15:33:28 +00001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +01002 * Copyright (c) 2017-2020 Arm Limited.
Georgios Pinitas652bde52018-01-10 15:33:28 +00003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010024#include "arm_compute/graph.h"
Georgios Pinitas652bde52018-01-10 15:33:28 +000025#include "support/ToolchainSupport.h"
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010026#include "utils/CommonGraphOptions.h"
Georgios Pinitas652bde52018-01-10 15:33:28 +000027#include "utils/GraphUtils.h"
28#include "utils/Utils.h"
29
Georgios Pinitas652bde52018-01-10 15:33:28 +000030using namespace arm_compute::utils;
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010031using namespace arm_compute::graph::frontend;
Georgios Pinitas652bde52018-01-10 15:33:28 +000032using namespace arm_compute::graph_utils;
33
Georgios Pinitas108ab0b2018-09-14 18:35:11 +010034/** Example demonstrating how to implement InceptionV3's network using the Compute Library's graph API */
Georgios Pinitasd8734b52017-12-22 15:27:52 +000035class InceptionV3Example : public Example
Georgios Pinitas652bde52018-01-10 15:33:28 +000036{
37public:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010038 InceptionV3Example()
39 : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0, "InceptionV3")
Georgios Pinitas652bde52018-01-10 15:33:28 +000040 {
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010041 }
42 bool do_setup(int argc, char **argv) override
43 {
44 // Parse arguments
45 cmd_parser.parse(argc, argv);
Georgios Pinitascd60a5f2019-08-21 17:06:54 +010046 cmd_parser.validate();
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010047
48 // Consume common parameters
49 common_params = consume_common_graph_parameters(common_opts);
50
51 // Return when help menu is requested
52 if(common_params.help)
53 {
54 cmd_parser.print_help(argv[0]);
55 return false;
56 }
57
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010058 // Print parameter values
59 std::cout << common_params << std::endl;
60
61 // Get trainable parameters data path
62 std::string data_path = common_params.data_path;
Georgios Pinitas652bde52018-01-10 15:33:28 +000063
Georgios Pinitas140fdc72018-02-16 11:42:38 +000064 // Create a preprocessor object
65 std::unique_ptr<IPreprocessor> preprocessor = arm_compute::support::cpp14::make_unique<TFPreproccessor>();
Georgios Pinitas652bde52018-01-10 15:33:28 +000066
Georgios Pinitase2220552018-07-20 13:23:44 +010067 // Create input descriptor
Sang-Hoon Park11fedda2020-01-15 14:44:04 +000068 const auto operation_layout = common_params.data_layout;
69 const TensorShape tensor_shape = permute_shape(TensorShape(299U, 299U, 3U, 1U), DataLayout::NCHW, operation_layout);
70 TensorDescriptor input_descriptor = TensorDescriptor(tensor_shape, common_params.data_type).set_layout(operation_layout);
Georgios Pinitase2220552018-07-20 13:23:44 +010071
72 // Set weights trained layout
73 const DataLayout weights_layout = DataLayout::NCHW;
74
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010075 graph << common_params.target
76 << common_params.fast_math_hint
Georgios Pinitase2220552018-07-20 13:23:44 +010077 << InputLayer(input_descriptor, get_input_accessor(common_params, std::move(preprocessor), false))
Georgios Pinitas652bde52018-01-10 15:33:28 +000078 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010079 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +000080 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +010081 .set_name("Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +000082 << BatchNormalizationLayer(get_weights_accessor(data_path,
83 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
84 get_weights_accessor(data_path,
85 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +010086 nullptr, get_weights_accessor(data_path,
87 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +000088 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +010089 .set_name("Conv2d_1a_3x3/BatchNorm/batchnorm")
90 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_1a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +000091 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010092 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +000093 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +010094 .set_name("Conv2d_2a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +000095 << BatchNormalizationLayer(get_weights_accessor(data_path,
96 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_mean.npy"),
97 get_weights_accessor(data_path,
98 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +010099 nullptr, get_weights_accessor(data_path,
100 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000101 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100102 .set_name("Conv2d_2a_3x3/BatchNorm/batchnorm")
103 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000104
105 << ConvolutionLayer(3U, 3U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100106 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000107 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100108 .set_name("Conv2d_2b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000109 << BatchNormalizationLayer(get_weights_accessor(data_path,
110 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_mean.npy"),
111 get_weights_accessor(data_path,
112 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100113 nullptr, get_weights_accessor(data_path,
114 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000115 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100116 .set_name("Conv2d_2b_3x3/BatchNorm/batchnorm")
117 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000118
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000119 << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, operation_layout, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name("MaxPool_3a_3x3/MaxPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000120
121 << ConvolutionLayer(1U, 1U, 80U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100122 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000123 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100124 .set_name("Conv2d_3b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000125 << BatchNormalizationLayer(get_weights_accessor(data_path,
126 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_mean.npy"),
127 get_weights_accessor(data_path,
128 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100129 nullptr, get_weights_accessor(data_path,
130 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000131 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100132 .set_name("Conv2d_3b_1x1/BatchNorm/batchnorm")
133 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_3b_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000134
135 << ConvolutionLayer(3U, 3U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100136 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000137 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100138 .set_name("Conv2d_4a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000139 << BatchNormalizationLayer(get_weights_accessor(data_path,
140 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_mean.npy"),
141 get_weights_accessor(data_path,
142 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100143 nullptr, get_weights_accessor(data_path,
144 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000145 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100146 .set_name("Conv2d_4a_3x3/BatchNorm/batchnorm")
147 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_4a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000148
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000149 << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, operation_layout, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name("MaxPool_5a_3x3/MaxPool");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000150
Georgios Pinitase2220552018-07-20 13:23:44 +0100151 graph << get_inception_node_A(data_path, "Mixed_5b", weights_layout, 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100152 32U)
153 .set_name("Mixed_5b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100154 graph << get_inception_node_A(data_path, "Mixed_5c", weights_layout, 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100155 64U, true)
156 .set_name("Mixed_5c/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100157 graph << get_inception_node_A(data_path, "Mixed_5d", weights_layout, 64U, std::make_tuple(48U, 64U), std::make_tuple(64U, 96U, 96U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100158 64U)
159 .set_name("Mixed_5d/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000160
Georgios Pinitase2220552018-07-20 13:23:44 +0100161 graph << get_inception_node_B(data_path, "Mixed_6a", weights_layout, 384U, std::make_tuple(64U, 96U, 96U)).set_name("Mixed_6a/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000162
Georgios Pinitase2220552018-07-20 13:23:44 +0100163 graph << get_inception_node_C(data_path, "Mixed_6b", weights_layout, 192U, std::make_tuple(128U, 128U, 192U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100164 std::make_tuple(128U, 128U, 128U, 128U, 192U), 192U)
165 .set_name("Mixed_6b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100166 graph << get_inception_node_C(data_path, "Mixed_6c", weights_layout, 192U, std::make_tuple(160U, 160U, 192U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100167 std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U)
168 .set_name("Mixed_6c/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100169 graph << get_inception_node_C(data_path, "Mixed_6d", weights_layout, 192U, std::make_tuple(160U, 160U, 192U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100170 std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U)
171 .set_name("Mixed_6d/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100172 graph << get_inception_node_C(data_path, "Mixed_6e", weights_layout, 192U, std::make_tuple(192U, 192U, 192U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100173 std::make_tuple(192U, 192U, 192U, 192U, 192U), 192U)
174 .set_name("Mixed_6e/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000175
Georgios Pinitase2220552018-07-20 13:23:44 +0100176 graph << get_inception_node_D(data_path, "Mixed_7a", weights_layout, std::make_tuple(192U, 320U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100177 std::make_tuple(192U, 192U, 192U, 192U))
178 .set_name("Mixed_7a/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000179
Georgios Pinitase2220552018-07-20 13:23:44 +0100180 graph << get_inception_node_E(data_path, "Mixed_7b", weights_layout, 320U, std::make_tuple(384U, 384U, 384U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100181 std::make_tuple(448U, 384U, 384U, 384U), 192U)
182 .set_name("Mixed_7b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100183 graph << get_inception_node_E(data_path, "Mixed_7c", weights_layout, 320U, std::make_tuple(384U, 384U, 384U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100184 std::make_tuple(448U, 384U, 384U, 384U), 192U, true)
185 .set_name("Mixed_7c/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000186
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000187 graph << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 8, operation_layout, PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::CEIL))).set_name("Logits/AvgPool_1a_8x8/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000188 << ConvolutionLayer(1U, 1U, 1001U, get_weights_accessor(data_path,
Georgios Pinitase2220552018-07-20 13:23:44 +0100189 "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000190 get_weights_accessor(data_path,
191 "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_biases.npy"),
192 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100193 .set_name("Logits/Conv2d_1c_1x1/convolution")
194 << ReshapeLayer(TensorShape(1001U)).set_name("Predictions/Reshape")
195 << SoftmaxLayer().set_name("Predictions/Softmax")
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100196 << OutputLayer(get_output_accessor(common_params, 5));
Gian Marcoc1b6e372018-02-21 18:03:26 +0000197
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000198 // Finalize graph
Georgios Pinitas9a8c6722018-03-21 17:52:35 +0000199 GraphConfig config;
Georgios Pinitasf4261ad2019-12-02 11:58:19 +0000200 config.num_threads = common_params.threads;
201 config.use_tuner = common_params.enable_tuner;
202 config.tuner_mode = common_params.tuner_mode;
203 config.tuner_file = common_params.tuner_file;
204 config.convert_to_uint8 = (common_params.data_type == DataType::QASYMM8);
Anthony Barbier7b607dc2018-07-13 15:55:24 +0100205
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100206 graph.finalize(common_params.target, config);
207
208 return true;
Georgios Pinitas652bde52018-01-10 15:33:28 +0000209 }
210
211 void do_run() override
212 {
213 graph.run();
214 }
215
216private:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100217 CommandLineParser cmd_parser;
218 CommonGraphOptions common_opts;
219 CommonGraphParams common_params;
220 Stream graph;
Georgios Pinitas652bde52018-01-10 15:33:28 +0000221
222private:
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100223 ConcatLayer get_inception_node_A(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000224 unsigned int a_filt,
225 std::tuple<unsigned int, unsigned int> b_filters,
226 std::tuple<unsigned int, unsigned int, unsigned int> c_filters,
227 unsigned int d_filt,
228 bool is_name_different = false)
229 {
230 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitas652bde52018-01-10 15:33:28 +0000231
232 // This is due to a naming issue in the tf model
233 std::string conv_id0 = "_0a_";
234 std::string conv_id1 = "2d_0b_";
235 if(is_name_different)
236 {
237 conv_id0 = "_0b_";
238 conv_id1 = "_1_0c_";
239 }
240
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000241 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000242 i_a << ConvolutionLayer(
243 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100244 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000245 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
246 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100247 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000248 << BatchNormalizationLayer(
249 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
250 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100251 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000252 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000253 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100254 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
255 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000256
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000257 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000258 i_b << ConvolutionLayer(
259 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100260 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000261 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
262 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100263 .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000264 << BatchNormalizationLayer(
265 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_mean.npy"),
266 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100267 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000268 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000269 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100270 .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/BatchNorm/batchnorm")
271 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000272 << ConvolutionLayer(
273 5U, 5U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100274 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000275 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
276 PadStrideInfo(1, 1, 2, 2))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100277 .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000278 << BatchNormalizationLayer(
279 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_mean.npy"),
280 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100281 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000282 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000283 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100284 .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/BatchNorm/batchnorm")
285 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000286
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000287 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000288 i_c << ConvolutionLayer(
289 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100290 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000291 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
292 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100293 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000294 << BatchNormalizationLayer(
295 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
296 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100297 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000298 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000299 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100300 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
301 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000302 << ConvolutionLayer(
303 3U, 3U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100304 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000305 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
306 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100307 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000308 << BatchNormalizationLayer(
309 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
310 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100311 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000312 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000313 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100314 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm")
315 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000316 << ConvolutionLayer(
317 3U, 3U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100318 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000319 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
320 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100321 .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000322 << BatchNormalizationLayer(
323 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_mean.npy"),
324 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100325 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000326 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000327 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100328 .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/BatchNorm/batcnorm")
329 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000330
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000331 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000332 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
333 true))
334 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000335 << ConvolutionLayer(
336 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100337 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000338 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
339 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100340 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000341 << BatchNormalizationLayer(
342 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
343 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100344 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000345 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000346 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100347 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
348 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000349
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100350 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000351 }
352
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100353 ConcatLayer get_inception_node_B(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000354 unsigned int a_filt,
355 std::tuple<unsigned int, unsigned int, unsigned int> b_filters)
356 {
357 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000358 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000359 i_a << ConvolutionLayer(
360 3U, 3U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100361 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000362 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
363 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100364 .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000365 << BatchNormalizationLayer(
366 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"),
367 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100368 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000369 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000370 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100371 .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/BatchNorm/batchnorm")
372 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000373
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000374 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000375 i_b << ConvolutionLayer(
376 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100377 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000378 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
379 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100380 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000381 << BatchNormalizationLayer(
382 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
383 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100384 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000385 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000386 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100387 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
388 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000389 << ConvolutionLayer(
390 3U, 3U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100391 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000392 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
393 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100394 .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000395 << BatchNormalizationLayer(
396 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
397 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100398 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000399 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000400 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100401 .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/BatchNorm/batchnorm")
402 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000403 << ConvolutionLayer(
404 3U, 3U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100405 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000406 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
407 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100408 .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000409 << BatchNormalizationLayer(
410 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"),
411 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100412 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000413 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000414 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100415 .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/BatchNorm/batchnorm")
416 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000417
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000418 SubStream i_c(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000419 i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, common_params.data_layout, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name(param_path + "/Branch_2/MaxPool_1a_3x3/MaxPool");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000420
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100421 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000422 }
423
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100424 ConcatLayer get_inception_node_C(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000425 unsigned int a_filt,
426 std::tuple<unsigned int, unsigned int, unsigned int> b_filters,
427 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int> c_filters,
428 unsigned int d_filt)
429 {
430 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000431 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000432 i_a << ConvolutionLayer(
433 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100434 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000435 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
436 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100437 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000438 << BatchNormalizationLayer(
439 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
440 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100441 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000442 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000443 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100444 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
445 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000446
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000447 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000448 i_b << ConvolutionLayer(
449 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100450 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000451 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
452 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100453 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000454 << BatchNormalizationLayer(
455 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
456 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100457 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000458 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000459 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100460 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
461 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000462 << ConvolutionLayer(
463 7U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100464 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000465 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
466 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100467 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000468 << BatchNormalizationLayer(
469 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
470 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100471 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000472 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000473 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100474 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm")
475 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000476 << ConvolutionLayer(
477 1U, 7U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100478 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000479 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
480 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100481 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000482 << BatchNormalizationLayer(
483 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
484 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100485 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000486 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000487 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100488 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm")
489 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0c_7x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000490
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000491 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000492 i_c << ConvolutionLayer(
493 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100494 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000495 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
496 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100497 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000498 << BatchNormalizationLayer(
499 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
500 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100501 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000502 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000503 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100504 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
505 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000506 << ConvolutionLayer(
507 1U, 7U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100508 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000509 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
510 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100511 .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000512 << BatchNormalizationLayer(
513 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_mean.npy"),
514 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100515 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000516 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000517 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100518 .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/BatchNorm/batchnorm")
519 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000520 << ConvolutionLayer(
521 7U, 1U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100522 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000523 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
524 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100525 .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000526 << BatchNormalizationLayer(
527 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_mean.npy"),
528 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100529 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000530 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000531 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100532 .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/BatchNorm/batchnorm")
533 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000534 << ConvolutionLayer(
535 1U, 7U, std::get<3>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100536 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000537 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
538 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100539 .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000540 << BatchNormalizationLayer(
541 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_mean.npy"),
542 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100543 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000544 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000545 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100546 .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/BatchNorm/batchnorm")
547 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000548 << ConvolutionLayer(
549 7U, 1U, std::get<4>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100550 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000551 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
552 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100553 .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000554 << BatchNormalizationLayer(
555 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_mean.npy"),
556 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100557 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000558 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000559 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100560 .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/BatchNorm/batchnorm")
561 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0e_1x7/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000562
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000563 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000564 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
565 true))
566 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000567 << ConvolutionLayer(
568 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100569 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000570 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
571 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100572 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000573 << BatchNormalizationLayer(
574 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
575 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100576 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000577 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000578 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100579 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
580 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000581
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100582 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000583 }
584
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100585 ConcatLayer get_inception_node_D(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitase2220552018-07-20 13:23:44 +0100586 std::tuple<unsigned int, unsigned int> a_filters,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000587 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int> b_filters)
588 {
589 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000590 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000591 i_a << ConvolutionLayer(
592 1U, 1U, std::get<0>(a_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100593 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000594 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
595 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100596 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000597 << BatchNormalizationLayer(
598 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
599 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100600 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000601 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000602 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100603 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
604 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000605 << ConvolutionLayer(
606 3U, 3U, std::get<1>(a_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100607 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000608 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
609 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100610 .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000611 << BatchNormalizationLayer(
612 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
613 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100614 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000615 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000616 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100617 .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/BatchNorm/batchnorm")
618 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000619
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000620 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000621 i_b << ConvolutionLayer(
622 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100623 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000624 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
625 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100626 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000627 << BatchNormalizationLayer(
628 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
629 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100630 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000631 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000632 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100633 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
634 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000635 << ConvolutionLayer(
636 7U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100637 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000638 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
639 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100640 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000641 << BatchNormalizationLayer(
642 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
643 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100644 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000645 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000646 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100647 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm")
648 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000649 << ConvolutionLayer(
650 1U, 7U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100651 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000652 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
653 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100654 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000655 << BatchNormalizationLayer(
656 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
657 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100658 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000659 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000660 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100661 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm")
662 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0c_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000663 << ConvolutionLayer(
664 3U, 3U, std::get<3>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100665 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000666 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
667 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100668 .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000669 << BatchNormalizationLayer(
670 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
671 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100672 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000673 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000674 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100675 .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/BatchNorm/batchnorm")
676 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000677
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000678 SubStream i_c(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000679 i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, common_params.data_layout, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))).set_name(param_path + "/Branch_2/MaxPool_1a_3x3/MaxPool");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000680
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100681 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000682 }
683
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100684 ConcatLayer get_inception_node_E(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000685 unsigned int a_filt,
686 std::tuple<unsigned int, unsigned int, unsigned int> b_filters,
687 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int> c_filters,
688 unsigned int d_filt,
689 bool is_name_different = false)
690 {
691 // This is due to a naming issue in the tf model
692 std::string conv_id = "_0b_";
693 if(is_name_different)
694 {
695 conv_id = "_0c_";
696 }
697
698 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000699 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000700 i_a << ConvolutionLayer(
701 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100702 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000703 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
704 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100705 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000706 << BatchNormalizationLayer(
707 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
708 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100709 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000710 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000711 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100712 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
713 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000714
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000715 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000716 i_b << ConvolutionLayer(
717 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100718 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000719 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
720 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100721 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000722 << BatchNormalizationLayer(
723 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
724 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100725 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000726 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000727 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100728 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
729 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000730
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100731 SubStream i_b1(i_b);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000732 i_b1 << ConvolutionLayer(
733 3U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100734 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000735 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
736 PadStrideInfo(1, 1, 1, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100737 .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000738 << BatchNormalizationLayer(
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000739 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_mean.npy"),
740 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100741 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000742 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_beta.npy"),
743 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100744 .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/BatchNorm/batchnorm")
745 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000746
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100747 SubStream i_b2(i_b);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000748 i_b2 << ConvolutionLayer(
749 1U, 3U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100750 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000751 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
752 PadStrideInfo(1, 1, 0, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100753 .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000754 << BatchNormalizationLayer(
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000755 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_mean.npy"),
756 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100757 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000758 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_beta.npy"),
759 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100760 .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/BatchNorm/batchnorm")
761 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000762
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000763 // Merge b1 and b2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100764 i_b << ConcatLayer(std::move(i_b1), std::move(i_b2)).set_name(param_path + "/Branch_1/concat");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000765
766 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000767 i_c << ConvolutionLayer(
768 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100769 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000770 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
771 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100772 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000773 << BatchNormalizationLayer(
774 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
775 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100776 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000777 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000778 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100779 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
780 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000781 << ConvolutionLayer(
782 3U, 3U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100783 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000784 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
785 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100786 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000787 << BatchNormalizationLayer(
788 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
789 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100790 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000791 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000792 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100793 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm")
794 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000795
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100796 SubStream i_c1(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000797 i_c1 << ConvolutionLayer(
798 3U, 1U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100799 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000800 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
801 PadStrideInfo(1, 1, 1, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100802 .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/convolution")
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000803 << BatchNormalizationLayer(
804 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_mean.npy"),
805 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100806 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000807 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_beta.npy"),
808 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100809 .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/BatchNorm/batchnorm")
810 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x3/Relu");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000811
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100812 SubStream i_c2(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000813 i_c2 << ConvolutionLayer(
814 1U, 3U, std::get<3>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100815 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000816 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
817 PadStrideInfo(1, 1, 0, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100818 .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/convolution")
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000819 << BatchNormalizationLayer(
820 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_mean.npy"),
821 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100822 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000823 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_beta.npy"),
824 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100825 .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/BatchNorm/batchnorm")
826 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_3x1/Relu");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000827
828 // Merge i_c1 and i_c2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100829 i_c << ConcatLayer(std::move(i_c1), std::move(i_c2)).set_name(param_path + "/Branch_2/concat");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000830
831 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000832 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
833 true))
834 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000835 << ConvolutionLayer(
836 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100837 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000838 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
839 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100840 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000841 << BatchNormalizationLayer(
842 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
843 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100844 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000845 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000846 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100847 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
848 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000849
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100850 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000851 }
852};
853
854/** Main program for Inception V3
855 *
Georgios Pinitasbdbbbe82018-11-07 16:06:47 +0000856 * Model is based on:
857 * https://arxiv.org/abs/1512.00567
858 * "Rethinking the Inception Architecture for Computer Vision"
859 * Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, Zbigniew Wojna
860 *
Georgios Pinitas588ebc52018-12-21 13:39:07 +0000861 * Provenance: download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz
862 *
Georgios Pinitas9f28b392018-07-18 20:01:53 +0100863 * @note To list all the possible arguments execute the binary appended with the --help option
864 *
Georgios Pinitas652bde52018-01-10 15:33:28 +0000865 * @param[in] argc Number of arguments
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100866 * @param[in] argv Arguments
Georgios Pinitas652bde52018-01-10 15:33:28 +0000867 */
868int main(int argc, char **argv)
869{
870 return arm_compute::utils::run_example<InceptionV3Example>(argc, argv);
871}