blob: 3de61dac7dc8b6cb04d0ba4bf7384f5a735015c1 [file] [log] [blame]
Georgios Pinitas240cfa62018-02-26 19:58:04 +00001/*
2 * Copyright (c) 2018 ARM Limited.
3 *
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 Pinitas240cfa62018-02-26 19:58:04 +000025#include "support/ToolchainSupport.h"
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010026#include "utils/CommonGraphOptions.h"
Georgios Pinitas240cfa62018-02-26 19:58:04 +000027#include "utils/GraphUtils.h"
28#include "utils/Utils.h"
29
Georgios Pinitas240cfa62018-02-26 19:58:04 +000030using namespace arm_compute::utils;
Georgios Pinitasd9eb2752018-04-03 13:44:29 +010031using namespace arm_compute::graph::frontend;
Georgios Pinitas240cfa62018-02-26 19:58:04 +000032using namespace arm_compute::graph_utils;
33
Georgios Pinitas108ab0b2018-09-14 18:35:11 +010034/** Example demonstrating how to implement InceptionV4's network using the Compute Library's graph API */
Georgios Pinitas240cfa62018-02-26 19:58:04 +000035class InceptionV4Example final : public Example
36{
37public:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010038 InceptionV4Example()
39 : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0, "InceptionV4")
Georgios Pinitas240cfa62018-02-26 19:58:04 +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);
46
47 // Consume common parameters
48 common_params = consume_common_graph_parameters(common_opts);
49
50 // Return when help menu is requested
51 if(common_params.help)
52 {
53 cmd_parser.print_help(argv[0]);
54 return false;
55 }
56
57 // Checks
Anthony Barbiercdd68c02018-08-23 15:03:41 +010058 ARM_COMPUTE_EXIT_ON_MSG(arm_compute::is_data_type_quantized_asymmetric(common_params.data_type), "QASYMM8 not supported for this graph");
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010059
60 // 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 Pinitas240cfa62018-02-26 19:58:04 +000065
66 // Create a preprocessor object
67 std::unique_ptr<IPreprocessor> preprocessor = arm_compute::support::cpp14::make_unique<TFPreproccessor>();
68
Georgios Pinitase2220552018-07-20 13:23:44 +010069 // Create input descriptor
70 const TensorShape tensor_shape = permute_shape(TensorShape(299U, 299U, 3U, 1U), DataLayout::NCHW, common_params.data_layout);
71 TensorDescriptor input_descriptor = TensorDescriptor(tensor_shape, common_params.data_type).set_layout(common_params.data_layout);
72
73 // Set weights trained layout
74 const DataLayout weights_layout = DataLayout::NCHW;
75
Georgios Pinitas12be7ab2018-07-03 12:06:23 +010076 graph << common_params.target
77 << common_params.fast_math_hint
Georgios Pinitase2220552018-07-20 13:23:44 +010078 << InputLayer(input_descriptor, get_input_accessor(common_params, std::move(preprocessor), false))
Georgios Pinitas240cfa62018-02-26 19:58:04 +000079 // Conv2d_1a_3x3
80 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010081 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +000082 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
83 << BatchNormalizationLayer(get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
84 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
85 get_random_accessor(1.f, 1.f),
86 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_1a_3x3_BatchNorm_beta.npy"),
87 0.001f)
88 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
89 // Conv2d_2a_3x3
90 << ConvolutionLayer(3U, 3U, 32U,
Georgios Pinitase2220552018-07-20 13:23:44 +010091 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +000092 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
93 << BatchNormalizationLayer(get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2a_3x3_BatchNorm_moving_mean.npy"),
94 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2a_3x3_BatchNorm_moving_variance.npy"),
95 get_random_accessor(1.f, 1.f),
96 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2a_3x3_BatchNorm_beta.npy"),
97 0.001f)
98 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
99 // Conv2d_2b_3x3
100 << ConvolutionLayer(3U, 3U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100101 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2b_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000102 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
103 << BatchNormalizationLayer(get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2b_3x3_BatchNorm_moving_mean.npy"),
104 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2b_3x3_BatchNorm_moving_variance.npy"),
105 get_random_accessor(1.f, 1.f),
106 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Conv2d_2b_3x3_BatchNorm_beta.npy"),
107 0.001f)
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100108 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000109
Georgios Pinitase2220552018-07-20 13:23:44 +0100110 graph << get_mixed_3a(data_path, weights_layout);
111 graph << get_mixed_4a(data_path, weights_layout);
112 graph << get_mixed_5a(data_path, weights_layout);
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100113 // 4 inception A blocks
Georgios Pinitase2220552018-07-20 13:23:44 +0100114 graph << get_inceptionA_block(data_path, weights_layout, "Mixed_5b");
115 graph << get_inceptionA_block(data_path, weights_layout, "Mixed_5c");
116 graph << get_inceptionA_block(data_path, weights_layout, "Mixed_5d");
117 graph << get_inceptionA_block(data_path, weights_layout, "Mixed_5e");
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100118 // reduction A block
Georgios Pinitase2220552018-07-20 13:23:44 +0100119 graph << get_reductionA_block(data_path, weights_layout);
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100120 // 7 inception B blocks
Georgios Pinitase2220552018-07-20 13:23:44 +0100121 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6b");
122 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6c");
123 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6d");
124 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6e");
125 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6f");
126 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6g");
127 graph << get_inceptionB_block(data_path, weights_layout, "Mixed_6h");
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100128 // reduction B block
Georgios Pinitase2220552018-07-20 13:23:44 +0100129 graph << get_reductionB_block(data_path, weights_layout);
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100130 // 3 inception C blocks
Georgios Pinitase2220552018-07-20 13:23:44 +0100131 graph << get_inceptionC_block(data_path, weights_layout, "Mixed_7b");
132 graph << get_inceptionC_block(data_path, weights_layout, "Mixed_7c");
133 graph << get_inceptionC_block(data_path, weights_layout, "Mixed_7d");
Georgios Pinitas41c482d2018-04-17 13:23:26 +0100134 graph << PoolingLayer(PoolingLayerInfo(PoolingType::AVG))
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000135 << FlattenLayer()
136 << FullyConnectedLayer(
137 1001U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100138 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Logits_Logits_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000139 get_weights_accessor(data_path, "/cnn_data/inceptionv4_model/Logits_Logits_biases.npy"))
140 << SoftmaxLayer()
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100141 << OutputLayer(get_output_accessor(common_params, 5));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000142
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000143 // Finalize graph
Georgios Pinitas9a8c6722018-03-21 17:52:35 +0000144 GraphConfig config;
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100145 config.num_threads = common_params.threads;
146 config.use_tuner = common_params.enable_tuner;
Anthony Barbier7b607dc2018-07-13 15:55:24 +0100147 config.tuner_file = common_params.tuner_file;
148
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100149 graph.finalize(common_params.target, config);
150
151 return true;
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000152 }
153
154 void do_run() override
155 {
156 graph.run();
157 }
158
159private:
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100160 CommandLineParser cmd_parser;
161 CommonGraphOptions common_opts;
162 CommonGraphParams common_params;
163 Stream graph;
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000164
165private:
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100166 ConcatLayer get_mixed_3a(const std::string &data_path, DataLayout weights_layout)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000167 {
168 std::string total_path = "/cnn_data/inceptionv4_model/Mixed_3a_";
169
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000170 SubStream i_a(graph);
171 i_a << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000172
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000173 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000174 i_b << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100175 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000176 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
177 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_3x3_BatchNorm_moving_mean.npy"),
178 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_3x3_BatchNorm_moving_variance.npy"),
179 get_random_accessor(1.f, 1.f),
180 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_3x3_BatchNorm_beta.npy"),
181 0.001f)
182 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
183
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100184 return ConcatLayer(std::move(i_a), std::move(i_b));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000185 }
186
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100187 ConcatLayer get_mixed_4a(const std::string &data_path, DataLayout weights_layout)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000188 {
189 std::string total_path = "/cnn_data/inceptionv4_model/Mixed_4a_";
190
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000191 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000192 i_a << ConvolutionLayer(1U, 1U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100193 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000194 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
195 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
196 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
197 get_random_accessor(1.f, 1.f),
198 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
199 0.001f)
200 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
201 << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100202 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000203 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
204 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
205 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
206 get_random_accessor(1.f, 1.f),
207 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
208 0.001f)
209 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
210
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000211 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000212 i_b << ConvolutionLayer(1U, 1U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100213 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000214 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
215 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
216 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
217 get_random_accessor(1.f, 1.f),
218 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
219 0.001f)
220 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
221 << ConvolutionLayer(7U, 1U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100222 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000223 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 3, 0))
224 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
225 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
226 get_random_accessor(1.f, 1.f),
227 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
228 0.001f)
229 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
230 << ConvolutionLayer(1U, 7U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100231 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000232 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 3))
233 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
234 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
235 get_random_accessor(1.f, 1.f),
236 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
237 0.001f)
238 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
239 << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100240 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000241 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
242 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
243 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
244 get_random_accessor(1.f, 1.f),
245 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"),
246 0.001f)
247 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
248
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100249 return ConcatLayer(std::move(i_a), std::move(i_b));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000250 }
251
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100252 ConcatLayer get_mixed_5a(const std::string &data_path, DataLayout weights_layout)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000253 {
254 std::string total_path = "/cnn_data/inceptionv4_model/Mixed_5a_";
255
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000256 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000257 i_a << ConvolutionLayer(3U, 3U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100258 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000259 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
260 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
261 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
262 get_random_accessor(1.f, 1.f),
263 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
264 0.001f)
265 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
266
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000267 SubStream i_b(graph);
268 i_b << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000269
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100270 return ConcatLayer(std::move(i_a), std::move(i_b));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000271 }
272
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100273 ConcatLayer get_inceptionA_block(const std::string &data_path, DataLayout weights_layout, std::string &&param_path)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000274 {
275 std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_";
276
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000277 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000278 i_a << ConvolutionLayer(1U, 1U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100279 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000280 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
281 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
282 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
283 get_random_accessor(1.f, 1.f),
284 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
285 0.001f)
286 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
287
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000288 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000289 i_b << ConvolutionLayer(1U, 1U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100290 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000291 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
292 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
293 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
294 get_random_accessor(1.f, 1.f),
295 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
296 0.001f)
297 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
298 << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100299 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000300 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
301 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
302 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
303 get_random_accessor(1.f, 1.f),
304 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_beta.npy"),
305 0.001f)
306 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
307
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000308 SubStream i_c(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000309 i_c << ConvolutionLayer(1U, 1U, 64U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100310 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000311 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
312 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
313 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
314 get_random_accessor(1.f, 1.f),
315 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
316 0.001f)
317 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
318 << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100319 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000320 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
321 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
322 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
323 get_random_accessor(1.f, 1.f),
324 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x3_BatchNorm_beta.npy"),
325 0.001f)
326 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
327 << ConvolutionLayer(3U, 3U, 96U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100328 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000329 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
330 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_mean.npy"),
331 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_moving_variance.npy"),
332 get_random_accessor(1.f, 1.f),
333 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_3x3_BatchNorm_beta.npy"),
334 0.001f)
335 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
336
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000337 SubStream i_d(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000338 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true))
339 << ConvolutionLayer(1U, 1U, 96U,
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 Pinitas240cfa62018-02-26 19:58:04 +0000341 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
342 << BatchNormalizationLayer(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"),
344 get_random_accessor(1.f, 1.f),
345 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
346 0.001f)
347 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
348
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100349 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000350 }
351
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100352 ConcatLayer get_reductionA_block(const std::string &data_path, DataLayout weights_layout)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000353 {
354 std::string total_path = "/cnn_data/inceptionv4_model/Mixed_6a_";
355
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000356 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000357 i_a << ConvolutionLayer(3U, 3U, 384U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100358 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000359 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
360 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
361 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
362 get_random_accessor(1.f, 1.f),
363 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
364 0.001f)
365 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
366
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000367 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000368 i_b << ConvolutionLayer(1U, 1U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100369 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000370 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
371 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
372 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
373 get_random_accessor(1.f, 1.f),
374 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
375 0.001f)
376 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
377 << ConvolutionLayer(3U, 3U, 224U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100378 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000379 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 1, 1))
380 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_mean.npy"),
381 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_moving_variance.npy"),
382 get_random_accessor(1.f, 1.f),
383 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_3x3_BatchNorm_beta.npy"),
384 0.001f)
385 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
386 << ConvolutionLayer(3U, 3U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100387 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000388 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
389 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
390 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
391 get_random_accessor(1.f, 1.f),
392 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"),
393 0.001f)
394 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
395
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000396 SubStream i_c(graph);
397 i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true));
398
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100399 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000400 }
401
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100402 ConcatLayer get_inceptionB_block(const std::string &data_path, DataLayout weights_layout, std::string &&param_path)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000403 {
404 std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_";
405
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000406 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000407 i_a << ConvolutionLayer(1U, 1U, 384U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100408 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000409 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
410 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
411 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
412 get_random_accessor(1.f, 1.f),
413 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
414 0.001f)
415 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
416
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000417 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000418 i_b << ConvolutionLayer(1U, 1U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100419 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000420 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
421 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
422 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
423 get_random_accessor(1.f, 1.f),
424 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
425 0.001f)
426 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
427 << ConvolutionLayer(7U, 1U, 224U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100428 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000429 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 3, 0))
430 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
431 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
432 get_random_accessor(1.f, 1.f),
433 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
434 0.001f)
435 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
436 << ConvolutionLayer(1U, 7U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100437 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000438 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 3))
439 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
440 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
441 get_random_accessor(1.f, 1.f),
442 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
443 0.001f)
444 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
445
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000446 SubStream i_c(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000447 i_c << ConvolutionLayer(1U, 1U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100448 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000449 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
450 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
451 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
452 get_random_accessor(1.f, 1.f),
453 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
454 0.001f)
455 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
456 << ConvolutionLayer(1U, 7U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100457 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000458 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 3))
459 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_mean.npy"),
460 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_moving_variance.npy"),
461 get_random_accessor(1.f, 1.f),
462 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_7x1_BatchNorm_beta.npy"),
463 0.001f)
464 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
465 << ConvolutionLayer(7U, 1U, 224U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100466 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000467 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 3, 0))
468 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_mean.npy"),
469 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_moving_variance.npy"),
470 get_random_accessor(1.f, 1.f),
471 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x7_BatchNorm_beta.npy"),
472 0.001f)
473 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
474 << ConvolutionLayer(1U, 7U, 224U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100475 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000476 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 3))
477 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_mean.npy"),
478 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_moving_variance.npy"),
479 get_random_accessor(1.f, 1.f),
480 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_7x1_BatchNorm_beta.npy"),
481 0.001f)
482 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
483 << ConvolutionLayer(7U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100484 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000485 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 3, 0))
486 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_mean.npy"),
487 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_moving_variance.npy"),
488 get_random_accessor(1.f, 1.f),
489 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_1x7_BatchNorm_beta.npy"),
490 0.001f)
491 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
492
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000493 SubStream i_d(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000494 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true))
495 << ConvolutionLayer(1U, 1U, 128U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100496 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000497 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
498 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
499 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
500 get_random_accessor(1.f, 1.f),
501 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
502 0.001f)
503 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
504
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100505 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000506 }
507
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100508 ConcatLayer get_reductionB_block(const std::string &data_path, DataLayout weights_layout)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000509 {
510 std::string total_path = "/cnn_data/inceptionv4_model/Mixed_7a_";
511
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000512 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000513 i_a << ConvolutionLayer(1U, 1U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100514 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000515 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
516 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
517 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
518 get_random_accessor(1.f, 1.f),
519 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
520 0.001f)
521 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
522 << ConvolutionLayer(3U, 3U, 192U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100523 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000524 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
525 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
526 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
527 get_random_accessor(1.f, 1.f),
528 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_1a_3x3_BatchNorm_beta.npy"),
529 0.001f)
530 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
531
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000532 SubStream i_b(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000533 i_b << ConvolutionLayer(1U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100534 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000535 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
536 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
537 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
538 get_random_accessor(1.f, 1.f),
539 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
540 0.001f)
541 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
542 << ConvolutionLayer(7U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100543 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000544 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 3, 0))
545 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_mean.npy"),
546 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_moving_variance.npy"),
547 get_random_accessor(1.f, 1.f),
548 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x7_BatchNorm_beta.npy"),
549 0.001f)
550 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
551 << ConvolutionLayer(1U, 7U, 320U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100552 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000553 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 3))
554 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_mean.npy"),
555 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_moving_variance.npy"),
556 get_random_accessor(1.f, 1.f),
557 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_7x1_BatchNorm_beta.npy"),
558 0.001f)
559 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
560 << ConvolutionLayer(3U, 3U, 320U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100561 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000562 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(2, 2, 0, 0))
563 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_mean.npy"),
564 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_moving_variance.npy"),
565 get_random_accessor(1.f, 1.f),
566 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_1a_3x3_BatchNorm_beta.npy"),
567 0.001f)
568 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
569
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000570 SubStream i_c(graph);
571 i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true));
572
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100573 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000574 }
575
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100576 ConcatLayer get_inceptionC_block(const std::string &data_path, DataLayout weights_layout, std::string &&param_path)
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000577 {
578 std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_";
579
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000580 SubStream i_a(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000581 i_a << ConvolutionLayer(1U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100582 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000583 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
584 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
585 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
586 get_random_accessor(1.f, 1.f),
587 get_weights_accessor(data_path, total_path + "Branch_0_Conv2d_0a_1x1_BatchNorm_beta.npy"),
588 0.001f)
589 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
590
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000591 SubStream i_b(graph);
592 i_b << ConvolutionLayer(
593 1U, 1U, 384U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100594 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000595 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
596 PadStrideInfo(1, 1, 0, 0))
597 << BatchNormalizationLayer(
598 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
599 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
600 get_random_accessor(1.f, 1.f),
601 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0a_1x1_BatchNorm_beta.npy"),
602 0.001f)
603 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
604
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100605 SubStream i_b1(i_b);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000606 i_b1 << ConvolutionLayer(
607 3U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100608 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000609 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
610 PadStrideInfo(1, 1, 1, 0))
611 << BatchNormalizationLayer(
612 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_mean.npy"),
613 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_moving_variance.npy"),
614 get_random_accessor(1.f, 1.f),
615 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0b_1x3_BatchNorm_beta.npy"),
616 0.001f)
617 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
618
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100619 SubStream i_b2(i_b);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000620 i_b2 << ConvolutionLayer(
621 1U, 3U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100622 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_3x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000623 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
624 PadStrideInfo(1, 1, 0, 1))
625 << BatchNormalizationLayer(
626 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_3x1_BatchNorm_moving_mean.npy"),
627 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_3x1_BatchNorm_moving_variance.npy"),
628 get_random_accessor(1.f, 1.f),
629 get_weights_accessor(data_path, total_path + "Branch_1_Conv2d_0c_3x1_BatchNorm_beta.npy"),
630 0.001f)
631 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
632
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000633 // Merge b1 and b2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100634 i_b << ConcatLayer(std::move(i_b1), std::move(i_b2));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000635
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000636 SubStream i_c(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000637 i_c << ConvolutionLayer(
638 1U, 1U, 384U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100639 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000640 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
641 PadStrideInfo(1, 1, 0, 0))
642 << BatchNormalizationLayer(
643 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_mean.npy"),
644 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_moving_variance.npy"),
645 get_random_accessor(1.f, 1.f),
646 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0a_1x1_BatchNorm_beta.npy"),
647 0.001f)
648 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
649 << ConvolutionLayer(
650 1U, 3U, 448U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100651 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000652 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
653 PadStrideInfo(1, 1, 0, 1))
654 << BatchNormalizationLayer(
655 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x1_BatchNorm_moving_mean.npy"),
656 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x1_BatchNorm_moving_variance.npy"),
657 get_random_accessor(1.f, 1.f),
658 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0b_3x1_BatchNorm_beta.npy"),
659 0.001f)
660 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
661 << ConvolutionLayer(
662 3U, 1U, 512U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100663 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000664 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
665 PadStrideInfo(1, 1, 1, 0))
666 << BatchNormalizationLayer(
667 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_mean.npy"),
668 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_moving_variance.npy"),
669 get_random_accessor(1.f, 1.f),
670 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0c_1x3_BatchNorm_beta.npy"),
671 0.001f)
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000672 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000673
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100674 SubStream i_c1(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000675 i_c1 << ConvolutionLayer(
676 3U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100677 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_1x3_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000678 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
679 PadStrideInfo(1, 1, 1, 0))
680 << BatchNormalizationLayer(
681 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_1x3_BatchNorm_moving_mean.npy"),
682 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_1x3_BatchNorm_moving_variance.npy"),
683 get_random_accessor(1.f, 1.f),
684 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0d_1x3_BatchNorm_beta.npy"),
685 0.001f)
686 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
687
Georgios Pinitas772e17f2018-07-13 12:25:33 +0100688 SubStream i_c2(i_c);
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000689 i_c2 << ConvolutionLayer(
690 1U, 3U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100691 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_3x1_weights.npy", weights_layout),
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000692 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr),
693 PadStrideInfo(1, 1, 0, 1))
694 << BatchNormalizationLayer(
695 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_3x1_BatchNorm_moving_mean.npy"),
696 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_3x1_BatchNorm_moving_variance.npy"),
697 get_random_accessor(1.f, 1.f),
698 get_weights_accessor(data_path, total_path + "Branch_2_Conv2d_0e_3x1_BatchNorm_beta.npy"),
699 0.001f)
700 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
701
702 // Merge i_c1 and i_c2
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100703 i_c << ConcatLayer(std::move(i_c1), std::move(i_c2));
Georgios Pinitasd8734b52017-12-22 15:27:52 +0000704
705 SubStream i_d(graph);
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000706 i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true))
707 << ConvolutionLayer(1U, 1U, 256U,
Georgios Pinitase2220552018-07-20 13:23:44 +0100708 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_weights.npy", weights_layout),
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000709 std::unique_ptr<arm_compute::graph::ITensorAccessor>(nullptr), PadStrideInfo(1, 1, 0, 0))
710 << BatchNormalizationLayer(get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_mean.npy"),
711 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_moving_variance.npy"),
712 get_random_accessor(1.f, 1.f),
713 get_weights_accessor(data_path, total_path + "Branch_3_Conv2d_0b_1x1_BatchNorm_beta.npy"),
714 0.001f)
715 << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU));
716
Georgios Pinitas427bbbf2018-08-28 13:32:02 +0100717 return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d));
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000718 }
719};
720
721/** Main program for Inception V4
722 *
Georgios Pinitasbdbbbe82018-11-07 16:06:47 +0000723 * Model is based on:
724 * https://arxiv.org/abs/1602.07261
725 * "Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning"
726 * Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, Alex Alemi
727 *
Georgios Pinitas588ebc52018-12-21 13:39:07 +0000728 * Provenance: download.tensorflow.org/models/inception_v4_2016_09_09.tar.gz
729 *
Georgios Pinitas9f28b392018-07-18 20:01:53 +0100730 * @note To list all the possible arguments execute the binary appended with the --help option
731 *
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000732 * @param[in] argc Number of arguments
Georgios Pinitas12be7ab2018-07-03 12:06:23 +0100733 * @param[in] argv Arguments
Georgios Pinitas240cfa62018-02-26 19:58:04 +0000734 */
735int main(int argc, char **argv)
736{
737 return arm_compute::utils::run_example<InceptionV4Example>(argc, argv);
738}