blob: 160e7f04f4b8f896d0267bd656fbe8b0fdfa4d5e [file] [log] [blame]
Georgios Pinitas652bde52018-01-10 15:33:28 +00001/*
SiCong Li4841c972021-02-03 12:17:35 +00002 * Copyright (c) 2017-2021 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"
SiCongLif466d752021-03-01 15:26:18 +000025#include "arm_compute/core/Types.h"
26#include "arm_compute/core/Utils.h"
Georgios Pinitas652bde52018-01-10 15:33:28 +000027#include "support/ToolchainSupport.h"
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010028#include "utils/CommonGraphOptions.h"
Georgios Pinitas652bde52018-01-10 15:33:28 +000029#include "utils/GraphUtils.h"
30#include "utils/Utils.h"
31
Georgios Pinitas652bde52018-01-10 15:33:28 +000032using namespace arm_compute::utils;
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010033using namespace arm_compute::graph::frontend;
Georgios Pinitas652bde52018-01-10 15:33:28 +000034using namespace arm_compute::graph_utils;
35
Georgios Pinitas108ab0b2018-09-14 18:35:11 +010036/** Example demonstrating how to implement InceptionV3's network using the Compute Library's graph API */
Georgios Pinitasd8734b52017-12-22 15:27:52 +000037class InceptionV3Example : public Example
Georgios Pinitas652bde52018-01-10 15:33:28 +000038{
39public:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010040 InceptionV3Example()
41 : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0, "InceptionV3")
Georgios Pinitas652bde52018-01-10 15:33:28 +000042 {
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010043 }
44 bool do_setup(int argc, char **argv) override
45 {
46 // Parse arguments
47 cmd_parser.parse(argc, argv);
Georgios Pinitascd60a5f2019-08-21 17:06:54 +010048 cmd_parser.validate();
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010049
50 // Consume common parameters
51 common_params = consume_common_graph_parameters(common_opts);
52
53 // Return when help menu is requested
54 if(common_params.help)
55 {
56 cmd_parser.print_help(argv[0]);
57 return false;
58 }
59
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010060 // Print parameter values
61 std::cout << common_params << std::endl;
62
63 // Get trainable parameters data path
64 std::string data_path = common_params.data_path;
Georgios Pinitas652bde52018-01-10 15:33:28 +000065
Georgios Pinitas140fdc72018-02-16 11:42:38 +000066 // Create a preprocessor object
Georgios Pinitas40f51a62020-11-21 03:04:18 +000067 std::unique_ptr<IPreprocessor> preprocessor = std::make_unique<TFPreproccessor>();
Georgios Pinitas652bde52018-01-10 15:33:28 +000068
Georgios Pinitase2220552018-07-20 13:23:44 +010069 // Create input descriptor
Sang-Hoon Park11fedda2020-01-15 14:44:04 +000070 const auto operation_layout = common_params.data_layout;
Georgios Pinitas450dfb12021-06-15 10:11:47 +010071 const TensorShape tensor_shape = permute_shape(TensorShape(299U, 299U, 3U, common_params.batches), DataLayout::NCHW, operation_layout);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +000072 TensorDescriptor input_descriptor = TensorDescriptor(tensor_shape, common_params.data_type).set_layout(operation_layout);
Georgios Pinitase2220552018-07-20 13:23:44 +010073
74 // Set weights trained layout
75 const DataLayout weights_layout = DataLayout::NCHW;
76
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010077 graph << common_params.target
78 << common_params.fast_math_hint
Georgios Pinitase2220552018-07-20 13:23:44 +010079 << InputLayer(input_descriptor, get_input_accessor(common_params, std::move(preprocessor), false))
Georgios Pinitas652bde52018-01-10 15:33:28 +000080 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010081 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +000082 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +010083 .set_name("Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +000084 << BatchNormalizationLayer(get_weights_accessor(data_path,
85 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
86 get_weights_accessor(data_path,
87 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +010088 nullptr, get_weights_accessor(data_path,
89 "/cnn_data/inceptionv3_model/Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +000090 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +010091 .set_name("Conv2d_1a_3x3/BatchNorm/batchnorm")
92 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_1a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +000093 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010094 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +000095 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +010096 .set_name("Conv2d_2a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +000097 << BatchNormalizationLayer(get_weights_accessor(data_path,
98 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_mean.npy"),
99 get_weights_accessor(data_path,
100 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100101 nullptr, get_weights_accessor(data_path,
102 "/cnn_data/inceptionv3_model/Conv2d_2a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000103 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100104 .set_name("Conv2d_2a_3x3/BatchNorm/batchnorm")
105 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000106
107 << ConvolutionLayer(3U, 3U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100108 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000109 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100110 .set_name("Conv2d_2b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000111 << BatchNormalizationLayer(get_weights_accessor(data_path,
112 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_mean.npy"),
113 get_weights_accessor(data_path,
114 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100115 nullptr, get_weights_accessor(data_path,
116 "/cnn_data/inceptionv3_model/Conv2d_2b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000117 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100118 .set_name("Conv2d_2b_3x3/BatchNorm/batchnorm")
119 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_2b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000120
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000121 << 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 +0000122
123 << ConvolutionLayer(1U, 1U, 80U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100124 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000125 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100126 .set_name("Conv2d_3b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000127 << BatchNormalizationLayer(get_weights_accessor(data_path,
128 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_mean.npy"),
129 get_weights_accessor(data_path,
130 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100131 nullptr, get_weights_accessor(data_path,
132 "/cnn_data/inceptionv3_model/Conv2d_3b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000133 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100134 .set_name("Conv2d_3b_1x1/BatchNorm/batchnorm")
135 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_3b_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000136
137 << ConvolutionLayer(3U, 3U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100138 get_weights_accessor(data_path, "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000139 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100140 .set_name("Conv2d_4a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000141 << BatchNormalizationLayer(get_weights_accessor(data_path,
142 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_mean.npy"),
143 get_weights_accessor(data_path,
144 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100145 nullptr, get_weights_accessor(data_path,
146 "/cnn_data/inceptionv3_model/Conv2d_4a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000147 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100148 .set_name("Conv2d_4a_3x3/BatchNorm/batchnorm")
149 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name("Conv2d_4a_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000150
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000151 << 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 +0000152
Georgios Pinitase2220552018-07-20 13:23:44 +0100153 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 +0100154 32U)
155 .set_name("Mixed_5b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100156 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 +0100157 64U, true)
158 .set_name("Mixed_5c/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100159 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 +0100160 64U)
161 .set_name("Mixed_5d/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000162
Georgios Pinitase2220552018-07-20 13:23:44 +0100163 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 +0000164
Georgios Pinitase2220552018-07-20 13:23:44 +0100165 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 +0100166 std::make_tuple(128U, 128U, 128U, 128U, 192U), 192U)
167 .set_name("Mixed_6b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100168 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 +0100169 std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U)
170 .set_name("Mixed_6c/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100171 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 +0100172 std::make_tuple(160U, 160U, 160U, 160U, 192U), 192U)
173 .set_name("Mixed_6d/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100174 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 +0100175 std::make_tuple(192U, 192U, 192U, 192U, 192U), 192U)
176 .set_name("Mixed_6e/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000177
Georgios Pinitase2220552018-07-20 13:23:44 +0100178 graph << get_inception_node_D(data_path, "Mixed_7a", weights_layout, std::make_tuple(192U, 320U),
Georgios Pinitas130986a2018-05-14 19:25:37 +0100179 std::make_tuple(192U, 192U, 192U, 192U))
180 .set_name("Mixed_7a/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000181
Georgios Pinitase2220552018-07-20 13:23:44 +0100182 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 +0100183 std::make_tuple(448U, 384U, 384U, 384U), 192U)
184 .set_name("Mixed_7b/concat");
Georgios Pinitase2220552018-07-20 13:23:44 +0100185 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 +0100186 std::make_tuple(448U, 384U, 384U, 384U), 192U, true)
187 .set_name("Mixed_7c/concat");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000188
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000189 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 +0000190 << ConvolutionLayer(1U, 1U, 1001U, get_weights_accessor(data_path,
Georgios Pinitase2220552018-07-20 13:23:44 +0100191 "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000192 get_weights_accessor(data_path,
193 "/cnn_data/inceptionv3_model/Logits_Conv2d_1c_1x1_biases.npy"),
194 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100195 .set_name("Logits/Conv2d_1c_1x1/convolution")
196 << ReshapeLayer(TensorShape(1001U)).set_name("Predictions/Reshape")
197 << SoftmaxLayer().set_name("Predictions/Softmax")
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100198 << OutputLayer(get_output_accessor(common_params, 5));
Gian Marcoc1b6e372018-02-21 18:03:26 +0000199
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000200 // Finalize graph
Georgios Pinitas9a8c6722018-03-21 17:52:35 +0000201 GraphConfig config;
SiCongLif466d752021-03-01 15:26:18 +0000202 config.num_threads = common_params.threads;
203 config.use_tuner = common_params.enable_tuner;
204 config.tuner_mode = common_params.tuner_mode;
205 config.tuner_file = common_params.tuner_file;
206 config.mlgo_file = common_params.mlgo_file;
207 config.use_synthetic_type = arm_compute::is_data_type_quantized(common_params.data_type);
208 config.synthetic_type = common_params.data_type;
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100209 graph.finalize(common_params.target, config);
210
211 return true;
Georgios Pinitas652bde52018-01-10 15:33:28 +0000212 }
213
214 void do_run() override
215 {
216 graph.run();
217 }
218
219private:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100220 CommandLineParser cmd_parser;
221 CommonGraphOptions common_opts;
222 CommonGraphParams common_params;
223 Stream graph;
Georgios Pinitas652bde52018-01-10 15:33:28 +0000224
225private:
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100226 ConcatLayer get_inception_node_A(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000227 unsigned int a_filt,
228 std::tuple<unsigned int, unsigned int> b_filters,
229 std::tuple<unsigned int, unsigned int, unsigned int> c_filters,
230 unsigned int d_filt,
231 bool is_name_different = false)
232 {
233 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitas652bde52018-01-10 15:33:28 +0000234
235 // This is due to a naming issue in the tf model
236 std::string conv_id0 = "_0a_";
237 std::string conv_id1 = "2d_0b_";
238 if(is_name_different)
239 {
240 conv_id0 = "_0b_";
241 conv_id1 = "_1_0c_";
242 }
243
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000244 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000245 i_a << ConvolutionLayer(
246 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100247 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000248 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
249 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100250 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000251 << BatchNormalizationLayer(
252 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
253 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100254 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000255 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000256 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100257 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
258 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000259
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000260 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000261 i_b << ConvolutionLayer(
262 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100263 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000264 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
265 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100266 .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000267 << BatchNormalizationLayer(
268 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_mean.npy"),
269 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100270 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000271 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id0 + "1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000272 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100273 .set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/BatchNorm/batchnorm")
274 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id0 + "1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000275 << ConvolutionLayer(
276 5U, 5U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100277 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000278 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
279 PadStrideInfo(1, 1, 2, 2))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100280 .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000281 << BatchNormalizationLayer(
282 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_mean.npy"),
283 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100284 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000285 get_weights_accessor(data_path, total_path + "Branch_1_Conv" + conv_id1 + "5x5_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000286 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100287 .set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/BatchNorm/batchnorm")
288 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id1 + "5x5/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000289
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000290 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000291 i_c << ConvolutionLayer(
292 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100293 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000294 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
295 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100296 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000297 << BatchNormalizationLayer(
298 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
299 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100300 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000301 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000302 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100303 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
304 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000305 << ConvolutionLayer(
306 3U, 3U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100307 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000308 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
309 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100310 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000311 << BatchNormalizationLayer(
312 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
313 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100314 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000315 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000316 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100317 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm")
318 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000319 << ConvolutionLayer(
320 3U, 3U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100321 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000322 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
323 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100324 .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000325 << BatchNormalizationLayer(
326 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_mean.npy"),
327 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100328 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000329 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000330 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100331 .set_name(param_path + "/Branch_2/Conv2d_0c_3x3/BatchNorm/batcnorm")
332 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000333
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000334 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000335 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
336 true))
337 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000338 << ConvolutionLayer(
339 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100340 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000341 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
342 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100343 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000344 << BatchNormalizationLayer(
345 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
346 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100347 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000348 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000349 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100350 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
351 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000352
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100353 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 +0000354 }
355
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100356 ConcatLayer get_inception_node_B(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000357 unsigned int a_filt,
358 std::tuple<unsigned int, unsigned int, unsigned int> b_filters)
359 {
360 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000361 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000362 i_a << ConvolutionLayer(
363 3U, 3U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100364 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000365 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
366 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100367 .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000368 << BatchNormalizationLayer(
369 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"),
370 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100371 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000372 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000373 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100374 .set_name(param_path + "/Branch_0/Conv2d_1a_1x1/BatchNorm/batchnorm")
375 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000376
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000377 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000378 i_b << ConvolutionLayer(
379 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100380 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000381 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
382 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100383 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000384 << BatchNormalizationLayer(
385 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
386 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100387 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000388 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000389 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100390 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
391 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000392 << ConvolutionLayer(
393 3U, 3U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100394 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000395 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
396 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100397 .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000398 << BatchNormalizationLayer(
399 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
400 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100401 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000402 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000403 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100404 .set_name(param_path + "/Branch_1/Conv2d_0b_3x3/BatchNorm/batchnorm")
405 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_3x3/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000406 << ConvolutionLayer(
407 3U, 3U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100408 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000409 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
410 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100411 .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000412 << BatchNormalizationLayer(
413 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_mean.npy"),
414 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100415 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000416 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000417 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100418 .set_name(param_path + "/Branch_1/Conv2d_1a_1x1/BatchNorm/batchnorm")
419 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000420
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000421 SubStream i_c(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000422 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 +0000423
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100424 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000425 }
426
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100427 ConcatLayer get_inception_node_C(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000428 unsigned int a_filt,
429 std::tuple<unsigned int, unsigned int, unsigned int> b_filters,
430 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int, unsigned int> c_filters,
431 unsigned int d_filt)
432 {
433 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000434 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000435 i_a << ConvolutionLayer(
436 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100437 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000438 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
439 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100440 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000441 << BatchNormalizationLayer(
442 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
443 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100444 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000445 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000446 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100447 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
448 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000449
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000450 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000451 i_b << ConvolutionLayer(
452 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100453 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000454 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
455 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100456 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000457 << BatchNormalizationLayer(
458 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
459 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100460 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000461 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000462 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100463 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
464 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000465 << ConvolutionLayer(
466 7U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100467 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000468 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
469 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100470 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000471 << BatchNormalizationLayer(
472 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
473 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100474 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000475 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000476 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100477 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm")
478 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000479 << ConvolutionLayer(
480 1U, 7U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100481 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000482 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
483 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100484 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000485 << BatchNormalizationLayer(
486 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
487 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100488 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000489 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000490 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100491 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm")
492 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0c_7x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000493
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000494 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000495 i_c << ConvolutionLayer(
496 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100497 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000498 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
499 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100500 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000501 << BatchNormalizationLayer(
502 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
503 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100504 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000505 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000506 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100507 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
508 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000509 << ConvolutionLayer(
510 1U, 7U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100511 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000512 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
513 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100514 .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000515 << BatchNormalizationLayer(
516 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_mean.npy"),
517 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100518 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000519 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000520 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100521 .set_name(param_path + "/Branch_2/Conv2d_0b_7x1/BatchNorm/batchnorm")
522 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000523 << ConvolutionLayer(
524 7U, 1U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100525 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000526 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
527 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100528 .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000529 << BatchNormalizationLayer(
530 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_mean.npy"),
531 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100532 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000533 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000534 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100535 .set_name(param_path + "/Branch_2/Conv2d_0c_1x7/BatchNorm/batchnorm")
536 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000537 << ConvolutionLayer(
538 1U, 7U, std::get<3>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100539 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000540 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
541 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100542 .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000543 << BatchNormalizationLayer(
544 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_mean.npy"),
545 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100546 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000547 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000548 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100549 .set_name(param_path + "/Branch_2/Conv2d_0d_7x1/BatchNorm/batchnorm")
550 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000551 << ConvolutionLayer(
552 7U, 1U, std::get<4>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100553 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000554 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
555 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100556 .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000557 << BatchNormalizationLayer(
558 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_mean.npy"),
559 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100560 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000561 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000562 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100563 .set_name(param_path + "/Branch_2/Conv2d_0e_1x7/BatchNorm/batchnorm")
564 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0e_1x7/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000565
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000566 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000567 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
568 true))
569 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000570 << ConvolutionLayer(
571 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100572 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000573 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
574 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100575 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000576 << BatchNormalizationLayer(
577 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
578 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100579 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000580 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000581 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100582 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
583 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000584
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100585 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 +0000586 }
587
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100588 ConcatLayer get_inception_node_D(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitase2220552018-07-20 13:23:44 +0100589 std::tuple<unsigned int, unsigned int> a_filters,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000590 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int> b_filters)
591 {
592 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000593 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000594 i_a << ConvolutionLayer(
595 1U, 1U, std::get<0>(a_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100596 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000597 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
598 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100599 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000600 << BatchNormalizationLayer(
601 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
602 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100603 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000604 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000605 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100606 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
607 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000608 << ConvolutionLayer(
609 3U, 3U, std::get<1>(a_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100610 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000611 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
612 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100613 .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000614 << BatchNormalizationLayer(
615 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
616 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100617 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000618 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000619 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100620 .set_name(param_path + "/Branch_0/Conv2d_1a_3x3/BatchNorm/batchnorm")
621 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_1a_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000622
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000623 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000624 i_b << ConvolutionLayer(
625 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100626 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000627 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
628 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100629 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000630 << BatchNormalizationLayer(
631 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
632 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100633 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000634 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000635 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100636 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
637 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000638 << ConvolutionLayer(
639 7U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100640 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000641 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
642 PadStrideInfo(1, 1, 3, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100643 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000644 << BatchNormalizationLayer(
645 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
646 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100647 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000648 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000649 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100650 .set_name(param_path + "/Branch_1/Conv2d_0b_1x7/BatchNorm/batchnorm")
651 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x7/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000652 << ConvolutionLayer(
653 1U, 7U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100654 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000655 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
656 PadStrideInfo(1, 1, 0, 3))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100657 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000658 << BatchNormalizationLayer(
659 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
660 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100661 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000662 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000663 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100664 .set_name(param_path + "/Branch_1/Conv2d_0c_7x1/BatchNorm/batchnorm")
665 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0c_7x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000666 << ConvolutionLayer(
667 3U, 3U, std::get<3>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100668 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000669 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
670 PadStrideInfo(2, 2, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100671 .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000672 << BatchNormalizationLayer(
673 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
674 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100675 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000676 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000677 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100678 .set_name(param_path + "/Branch_1/Conv2d_1a_3x3/BatchNorm/batchnorm")
679 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_1a_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000680
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000681 SubStream i_c(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000682 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 +0000683
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100684 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas652bde52018-01-10 15:33:28 +0000685 }
686
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100687 ConcatLayer get_inception_node_E(const std::string &data_path, std::string &&param_path, DataLayout weights_layout,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000688 unsigned int a_filt,
689 std::tuple<unsigned int, unsigned int, unsigned int> b_filters,
690 std::tuple<unsigned int, unsigned int, unsigned int, unsigned int> c_filters,
691 unsigned int d_filt,
692 bool is_name_different = false)
693 {
694 // This is due to a naming issue in the tf model
695 std::string conv_id = "_0b_";
696 if(is_name_different)
697 {
698 conv_id = "_0c_";
699 }
700
701 std::string total_path = "/cnn_data/inceptionv3_model/" + param_path + "_";
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000702 SubStream i_a(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000703 i_a << ConvolutionLayer(
704 1U, 1U, a_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100705 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000706 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
707 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100708 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000709 << BatchNormalizationLayer(
710 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
711 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100712 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000713 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000714 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100715 .set_name(param_path + "/Branch_0/Conv2d_0a_1x1/BatchNorm/batchnorm")
716 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_0/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000717
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000718 SubStream i_b(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000719 i_b << ConvolutionLayer(
720 1U, 1U, std::get<0>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100721 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000722 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
723 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100724 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000725 << BatchNormalizationLayer(
726 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
727 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100728 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000729 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000730 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100731 .set_name(param_path + "/Branch_1/Conv2d_0a_1x1/BatchNorm/batchnorm")
732 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0a_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000733
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100734 SubStream i_b1(i_b);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000735 i_b1 << ConvolutionLayer(
736 3U, 1U, std::get<1>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100737 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000738 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
739 PadStrideInfo(1, 1, 1, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100740 .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000741 << BatchNormalizationLayer(
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000742 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_mean.npy"),
743 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100744 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000745 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_beta.npy"),
746 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100747 .set_name(param_path + "/Branch_1/Conv2d_0b_1x3/BatchNorm/batchnorm")
748 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d_0b_1x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000749
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100750 SubStream i_b2(i_b);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000751 i_b2 << ConvolutionLayer(
752 1U, 3U, std::get<2>(b_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100753 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000754 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
755 PadStrideInfo(1, 1, 0, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100756 .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000757 << BatchNormalizationLayer(
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000758 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_mean.npy"),
759 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100760 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000761 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d" + conv_id + "3x1_BatchNorm_beta.npy"),
762 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100763 .set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/BatchNorm/batchnorm")
764 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_1/Conv2d" + conv_id + "3x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000765
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000766 // Merge b1 and b2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100767 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 +0000768
769 SubStream i_c(graph);
Georgios Pinitas652bde52018-01-10 15:33:28 +0000770 i_c << ConvolutionLayer(
771 1U, 1U, std::get<0>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100772 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000773 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
774 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100775 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000776 << BatchNormalizationLayer(
777 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
778 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100779 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000780 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000781 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100782 .set_name(param_path + "/Branch_2/Conv2d_0a_1x1/BatchNorm/batchnorm")
783 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0a_1x1/Relu")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000784 << ConvolutionLayer(
785 3U, 3U, std::get<1>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100786 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000787 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
788 PadStrideInfo(1, 1, 1, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100789 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000790 << BatchNormalizationLayer(
791 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
792 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100793 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000794 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000795 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100796 .set_name(param_path + "/Branch_2/Conv2d_0b_3x3/BatchNorm/batchnorm")
797 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0b_3x3/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000798
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100799 SubStream i_c1(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000800 i_c1 << ConvolutionLayer(
801 3U, 1U, std::get<2>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100802 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000803 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
804 PadStrideInfo(1, 1, 1, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100805 .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/convolution")
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000806 << BatchNormalizationLayer(
807 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_mean.npy"),
808 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100809 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000810 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_beta.npy"),
811 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100812 .set_name(param_path + "/Branch_2/Conv2d_0c_1x3/BatchNorm/batchnorm")
813 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0c_1x3/Relu");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000814
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100815 SubStream i_c2(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000816 i_c2 << ConvolutionLayer(
817 1U, 3U, std::get<3>(c_filters),
Georgios Pinitase2220552018-07-20 13:23:44 +0100818 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000819 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
820 PadStrideInfo(1, 1, 0, 1))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100821 .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/convolution")
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000822 << BatchNormalizationLayer(
823 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_mean.npy"),
824 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100825 nullptr,
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000826 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_3x1_BatchNorm_beta.npy"),
827 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100828 .set_name(param_path + "/Branch_2/Conv2d_0d_3x1/BatchNorm/batchnorm")
829 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_2/Conv2d_0d_3x1/Relu");
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000830
831 // Merge i_c1 and i_c2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100832 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 +0000833
834 SubStream i_d(graph);
Sang-Hoon Park11fedda2020-01-15 14:44:04 +0000835 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, common_params.data_layout, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL),
836 true))
837 .set_name(param_path + "/Branch_3/AvgPool_0a_3x3/AvgPool")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000838 << ConvolutionLayer(
839 1U, 1U, d_filt,
Georgios Pinitase2220552018-07-20 13:23:44 +0100840 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas652bde52018-01-10 15:33:28 +0000841 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
842 PadStrideInfo(1, 1, 0, 0))
Georgios Pinitas130986a2018-05-14 19:25:37 +0100843 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/convolution")
Georgios Pinitas652bde52018-01-10 15:33:28 +0000844 << BatchNormalizationLayer(
845 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
846 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
giuros01351bd132019-08-23 14:27:30 +0100847 nullptr,
Georgios Pinitas652bde52018-01-10 15:33:28 +0000848 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000849 0.001f)
Georgios Pinitas130986a2018-05-14 19:25:37 +0100850 .set_name(param_path + "/Branch_3/Conv2d_0b_1x1/BatchNorm/batchnorm")
851 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)).set_name(param_path + "/Branch_3/Conv2d_0b_1x1/Relu");
Georgios Pinitas652bde52018-01-10 15:33:28 +0000852
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100853 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 +0000854 }
855};
856
857/** Main program for Inception V3
858 *
Georgios Pinitasbdbbbe82018-11-07 16:06:47 +0000859 * Model is based on:
860 * https://arxiv.org/abs/1512.00567
861 * "Rethinking the Inception Architecture for Computer Vision"
862 * Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, Zbigniew Wojna
863 *
Georgios Pinitas588ebc52018-12-21 13:39:07 +0000864 * Provenance: download.tensorflow.org/models/inception_v3_2016_08_28.tar.gz
865 *
Georgios Pinitas9f28b392018-07-18 20:01:53 +0100866 * @note To list all the possible arguments execute the binary appended with the --help option
867 *
Georgios Pinitas652bde52018-01-10 15:33:28 +0000868 * @param[in] argc Number of arguments
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100869 * @param[in] argv Arguments
Georgios Pinitas652bde52018-01-10 15:33:28 +0000870 */
871int main(int argc, char **argv)
872{
873 return arm_compute::utils::run_example<InceptionV3Example>(argc, argv);
874}