From 427bbbf939a37150fd6768c29c9753771806dab3 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Tue, 28 Aug 2018 13:32:02 +0100 Subject: COMPMID-1522: Add ElementWiseOperation node in the graph API Change-Id: Icb428bf3b5d3634fdddc57562cce670776e7f7a3 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/145814 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- examples/graph_inception_v4.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'examples/graph_inception_v4.cpp') diff --git a/examples/graph_inception_v4.cpp b/examples/graph_inception_v4.cpp index b6c28b4c3f..00a6c7d781 100644 --- a/examples/graph_inception_v4.cpp +++ b/examples/graph_inception_v4.cpp @@ -174,7 +174,7 @@ private: Stream graph; private: - BranchLayer get_mixed_3a(const std::string &data_path, DataLayout weights_layout) + ConcatLayer get_mixed_3a(const std::string &data_path, DataLayout weights_layout) { std::string total_path = "/cnn_data/inceptionv4_model/Mixed_3a_"; @@ -192,10 +192,10 @@ private: 0.001f) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b)); + return ConcatLayer(std::move(i_a), std::move(i_b)); } - BranchLayer get_mixed_4a(const std::string &data_path, DataLayout weights_layout) + ConcatLayer get_mixed_4a(const std::string &data_path, DataLayout weights_layout) { std::string total_path = "/cnn_data/inceptionv4_model/Mixed_4a_"; @@ -257,10 +257,10 @@ private: 0.001f) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b)); + return ConcatLayer(std::move(i_a), std::move(i_b)); } - BranchLayer get_mixed_5a(const std::string &data_path, DataLayout weights_layout) + ConcatLayer get_mixed_5a(const std::string &data_path, DataLayout weights_layout) { std::string total_path = "/cnn_data/inceptionv4_model/Mixed_5a_"; @@ -278,10 +278,10 @@ private: SubStream i_b(graph); i_b << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b)); + return ConcatLayer(std::move(i_a), std::move(i_b)); } - BranchLayer get_inceptionA_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) + ConcatLayer get_inceptionA_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) { std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_"; @@ -357,10 +357,10 @@ private: 0.001f) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); } - BranchLayer get_reductionA_block(const std::string &data_path, DataLayout weights_layout) + ConcatLayer get_reductionA_block(const std::string &data_path, DataLayout weights_layout) { std::string total_path = "/cnn_data/inceptionv4_model/Mixed_6a_"; @@ -407,10 +407,10 @@ private: SubStream i_c(graph); i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c)); + return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c)); } - BranchLayer get_inceptionB_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) + ConcatLayer get_inceptionB_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) { std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_"; @@ -513,10 +513,10 @@ private: 0.001f) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); } - BranchLayer get_reductionB_block(const std::string &data_path, DataLayout weights_layout) + ConcatLayer get_reductionB_block(const std::string &data_path, DataLayout weights_layout) { std::string total_path = "/cnn_data/inceptionv4_model/Mixed_7a_"; @@ -581,10 +581,10 @@ private: SubStream i_c(graph); i_c << PoolingLayer(PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL), true)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c)); + return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c)); } - BranchLayer get_inceptionC_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) + ConcatLayer get_inceptionC_block(const std::string &data_path, DataLayout weights_layout, std::string &¶m_path) { std::string total_path = "/cnn_data/inceptionv4_model/" + param_path + "_"; @@ -642,7 +642,7 @@ private: << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); // Merge b1 and b2 - i_b << BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_b1), std::move(i_b2)); + i_b << ConcatLayer(std::move(i_b1), std::move(i_b2)); SubStream i_c(graph); i_c << ConvolutionLayer( @@ -711,7 +711,7 @@ private: << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); // Merge i_c1 and i_c2 - i_c << BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_c1), std::move(i_c2)); + i_c << ConcatLayer(std::move(i_c1), std::move(i_c2)); SubStream i_d(graph); i_d << PoolingLayer(PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL), true)) @@ -725,7 +725,7 @@ private: 0.001f) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); - return BranchLayer(BranchMergeMethod::DEPTH_CONCATENATE, std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); + return ConcatLayer(std::move(i_a), std::move(i_b), std::move(i_c), std::move(i_d)); } }; -- cgit v1.2.1