diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-09-01 20:41:12 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | a09de0c8b2ed0f1481502d3b023375609362d9e3 (patch) | |
tree | e34b56d9ca69b025d7d9b943cc4df59cd458f6cb /tests/datasets | |
parent | 5280071b336d53aff94ca3a6c70ebbe6bf03f4c3 (diff) | |
download | ComputeLibrary-a09de0c8b2ed0f1481502d3b023375609362d9e3.tar.gz |
COMPMID-415: Rename and move tests
The boost validation is now "standalone" in validation_old and builds as
arm_compute_validation_old. The new validation builds now as
arm_compute_validation.
Change-Id: Ib93ba848a25680ac60afb92b461d574a0757150d
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/86187
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/datasets')
56 files changed, 4573 insertions, 0 deletions
diff --git a/tests/datasets/ActivationFunctionsDataset.h b/tests/datasets/ActivationFunctionsDataset.h new file mode 100644 index 0000000000..3e4f408614 --- /dev/null +++ b/tests/datasets/ActivationFunctionsDataset.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_ACTIVATIONFUNCTIONS_DATASET_H__ +#define __ARM_COMPUTE_TEST_ACTIVATIONFUNCTIONS_DATASET_H__ + +#include "arm_compute/core/Types.h" +#include "tests/framework/datasets/ContainerDataset.h" + +#include <vector> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class ActivationFunctions final : public framework::dataset::ContainerDataset<std::vector<ActivationLayerInfo::ActivationFunction>> +{ +public: + ActivationFunctions() + : ContainerDataset("ActivationFunction", + { + ActivationLayerInfo::ActivationFunction::ABS, + ActivationLayerInfo::ActivationFunction::LINEAR, + ActivationLayerInfo::ActivationFunction::LOGISTIC, + ActivationLayerInfo::ActivationFunction::RELU, + ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, + ActivationLayerInfo::ActivationFunction::LEAKY_RELU, + ActivationLayerInfo::ActivationFunction::SOFT_RELU, + ActivationLayerInfo::ActivationFunction::SQRT, + ActivationLayerInfo::ActivationFunction::SQUARE, + ActivationLayerInfo::ActivationFunction::TANH + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_ACTIVATIONFUNCTIONS_DATASET_H__ */ diff --git a/tests/datasets/BatchNormalizationLayerDataset.h b/tests/datasets/BatchNormalizationLayerDataset.h new file mode 100644 index 0000000000..25e65d931c --- /dev/null +++ b/tests/datasets/BatchNormalizationLayerDataset.h @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_BATCHNORMALIZATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_BATCHNORMALIZATION_LAYER_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class BatchNormalizationLayerDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, float>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator tensor_it, + std::vector<TensorShape>::const_iterator param_it, + std::vector<float>::const_iterator epsilon_it) + : _tensor_it{ std::move(tensor_it) }, + _param_it{ std::move(param_it) }, + _epsilon_it{ std::move(epsilon_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_tensor_it << ":"; + description << "Out=" << *_tensor_it << ":"; + description << "Mean=" << *_param_it << ":"; + description << "Variance=" << *_param_it << ":"; + description << "Beta=" << *_param_it << ":"; + description << "Gamma=" << *_param_it << ":"; + description << "Epsilon=" << *_epsilon_it; + return description.str(); + } + + BatchNormalizationLayerDataset::type operator*() const + { + return std::make_tuple(*_tensor_it, *_param_it, *_epsilon_it); + } + + iterator &operator++() + { + ++_tensor_it; + ++_param_it; + ++_epsilon_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _tensor_it; + std::vector<TensorShape>::const_iterator _param_it; + std::vector<float>::const_iterator _epsilon_it; + }; + + iterator begin() const + { + return iterator(_tensor_shapes.begin(), _param_shapes.begin(), _epsilons.begin()); + } + + int size() const + { + return std::min(_tensor_shapes.size(), std::min(_param_shapes.size(), _epsilons.size())); + } + + void add_config(TensorShape tensor, TensorShape param, float epsilon) + { + _tensor_shapes.emplace_back(std::move(tensor)); + _param_shapes.emplace_back(std::move(param)); + _epsilons.emplace_back(std::move(epsilon)); + } + +protected: + BatchNormalizationLayerDataset() = default; + BatchNormalizationLayerDataset(BatchNormalizationLayerDataset &&) = default; + +private: + std::vector<TensorShape> _tensor_shapes{}; + std::vector<TensorShape> _param_shapes{}; + std::vector<float> _epsilons{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_BATCHNORMALIZATION_LAYER_DATASET */ diff --git a/tests/datasets/BorderModeDataset.h b/tests/datasets/BorderModeDataset.h new file mode 100644 index 0000000000..df024a7dbf --- /dev/null +++ b/tests/datasets/BorderModeDataset.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_BORDER_MODE_DATASET_H__ +#define __ARM_COMPUTE_TEST_BORDER_MODE_DATASET_H__ + +#include "arm_compute/core/Types.h" +#include "tests/framework/datasets/ContainerDataset.h" + +#include <vector> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class BorderModes final : public framework::dataset::ContainerDataset<std::vector<BorderMode>> +{ +public: + BorderModes() + : ContainerDataset("BorderMode", + { + BorderMode::UNDEFINED, + BorderMode::CONSTANT, + BorderMode::REPLICATE + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_BORDER_MODE_DATASET_H__ */ diff --git a/tests/datasets/ConvolutionLayerDataset.h b/tests/datasets/ConvolutionLayerDataset.h new file mode 100644 index 0000000000..ba11bd5d6d --- /dev/null +++ b/tests/datasets/ConvolutionLayerDataset.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_CONVOLUTION_LAYER_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class ConvolutionLayerDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, TensorShape, TensorShape, PadStrideInfo>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator src_it, + std::vector<TensorShape>::const_iterator weights_it, + std::vector<TensorShape>::const_iterator biases_it, + std::vector<TensorShape>::const_iterator dst_it, + std::vector<PadStrideInfo>::const_iterator infos_it) + : _src_it{ std::move(src_it) }, + _weights_it{ std::move(weights_it) }, + _biases_it{ std::move(biases_it) }, + _dst_it{ std::move(dst_it) }, + _infos_it{ std::move(infos_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_src_it << ":"; + description << "Weights=" << *_weights_it << ":"; + description << "Biases=" << *_biases_it << ":"; + description << "Out=" << *_dst_it << ":"; + description << "Info=" << *_infos_it; + return description.str(); + } + + ConvolutionLayerDataset::type operator*() const + { + return std::make_tuple(*_src_it, *_weights_it, *_biases_it, *_dst_it, *_infos_it); + } + + iterator &operator++() + { + ++_src_it; + ++_weights_it; + ++_biases_it; + ++_dst_it; + ++_infos_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _src_it; + std::vector<TensorShape>::const_iterator _weights_it; + std::vector<TensorShape>::const_iterator _biases_it; + std::vector<TensorShape>::const_iterator _dst_it; + std::vector<PadStrideInfo>::const_iterator _infos_it; + }; + + iterator begin() const + { + return iterator(_src_shapes.begin(), _weight_shapes.begin(), _bias_shapes.begin(), _dst_shapes.begin(), _infos.begin()); + } + + int size() const + { + return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), std::min(_bias_shapes.size(), std::min(_dst_shapes.size(), _infos.size())))); + } + + void add_config(TensorShape src, TensorShape weights, TensorShape biases, TensorShape dst, PadStrideInfo info) + { + _src_shapes.emplace_back(std::move(src)); + _weight_shapes.emplace_back(std::move(weights)); + _bias_shapes.emplace_back(std::move(biases)); + _dst_shapes.emplace_back(std::move(dst)); + _infos.emplace_back(std::move(info)); + } + +protected: + ConvolutionLayerDataset() = default; + ConvolutionLayerDataset(ConvolutionLayerDataset &&) = default; + +private: + std::vector<TensorShape> _src_shapes{}; + std::vector<TensorShape> _weight_shapes{}; + std::vector<TensorShape> _bias_shapes{}; + std::vector<TensorShape> _dst_shapes{}; + std::vector<PadStrideInfo> _infos{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/DepthwiseConvolutionDataset.h b/tests/datasets/DepthwiseConvolutionDataset.h new file mode 100644 index 0000000000..93da37532f --- /dev/null +++ b/tests/datasets/DepthwiseConvolutionDataset.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET +#define ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class DepthwiseConvolutionDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, TensorShape, PadStrideInfo>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator src_it, + std::vector<TensorShape>::const_iterator weights_it, + std::vector<TensorShape>::const_iterator dst_it, + std::vector<PadStrideInfo>::const_iterator infos_it) + : _src_it{ std::move(src_it) }, + _weights_it{ std::move(weights_it) }, + _dst_it{ std::move(dst_it) }, + _infos_it{ std::move(infos_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_src_it << ":"; + description << "Weights=" << *_weights_it << ":"; + description << "Out=" << *_dst_it << ":"; + description << "Info=" << *_infos_it; + return description.str(); + } + + DepthwiseConvolutionDataset::type operator*() const + { + return std::make_tuple(*_src_it, *_weights_it, *_dst_it, *_infos_it); + } + + iterator &operator++() + { + ++_src_it; + ++_weights_it; + ++_dst_it; + ++_infos_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _src_it; + std::vector<TensorShape>::const_iterator _weights_it; + std::vector<TensorShape>::const_iterator _dst_it; + std::vector<PadStrideInfo>::const_iterator _infos_it; + }; + + iterator begin() const + { + return iterator(_src_shapes.begin(), _weight_shapes.begin(), _dst_shapes.begin(), _infos.begin()); + } + + int size() const + { + return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), std::min(_dst_shapes.size(), _infos.size()))); + } + + void add_config(TensorShape src, TensorShape weights, TensorShape dst, PadStrideInfo info) + { + _src_shapes.emplace_back(std::move(src)); + _weight_shapes.emplace_back(std::move(weights)); + _dst_shapes.emplace_back(std::move(dst)); + _infos.emplace_back(std::move(info)); + } + +protected: + DepthwiseConvolutionDataset() = default; + DepthwiseConvolutionDataset(DepthwiseConvolutionDataset &&) = default; + +private: + std::vector<TensorShape> _src_shapes{}; + std::vector<TensorShape> _weight_shapes{}; + std::vector<TensorShape> _dst_shapes{}; + std::vector<PadStrideInfo> _infos{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_DEPTHWISE_CONVOLUTION_DATASET */ diff --git a/tests/datasets/DepthwiseSeparableConvolutionLayerDataset.h b/tests/datasets/DepthwiseSeparableConvolutionLayerDataset.h new file mode 100644 index 0000000000..4391379833 --- /dev/null +++ b/tests/datasets/DepthwiseSeparableConvolutionLayerDataset.h @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class DepthwiseSeparableConvolutionLayerDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, TensorShape, TensorShape, TensorShape, TensorShape, PadStrideInfo, PadStrideInfo>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator src_it, + std::vector<TensorShape>::const_iterator filter_it, + std::vector<TensorShape>::const_iterator depthwise_out_it, + std::vector<TensorShape>::const_iterator weights_it, + std::vector<TensorShape>::const_iterator biases_it, + std::vector<TensorShape>::const_iterator dst_it, + std::vector<PadStrideInfo>::const_iterator depthwise_infos_it, + std::vector<PadStrideInfo>::const_iterator pointwise_infos_it) + : _src_it{ std::move(src_it) }, + _filter_it{ std::move(filter_it) }, + _depthwise_out_it{ std::move(depthwise_out_it) }, + _weights_it{ std::move(weights_it) }, + _biases_it{ std::move(biases_it) }, + _dst_it{ std::move(dst_it) }, + _depthwise_infos_it{ std::move(depthwise_infos_it) }, + _pointwise_infos_it{ std::move(pointwise_infos_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_src_it << ":"; + description << "Filter=" << *_filter_it << ":"; + description << "DepthwiseOut=" << *_depthwise_out_it << ":"; + description << "Weights=" << *_weights_it << ":"; + description << "Biases=" << *_biases_it << ":"; + description << "Out=" << *_dst_it << ":"; + description << "DepthwiseInfo=" << *_depthwise_infos_it << ":"; + description << "PointwiseInfo=" << *_pointwise_infos_it; + return description.str(); + } + + DepthwiseSeparableConvolutionLayerDataset::type operator*() const + { + return std::make_tuple(*_src_it, *_filter_it, *_depthwise_out_it, *_weights_it, *_biases_it, *_dst_it, *_depthwise_infos_it, *_pointwise_infos_it); + } + + iterator &operator++() + { + ++_src_it; + ++_filter_it; + ++_depthwise_out_it; + ++_weights_it; + ++_biases_it; + ++_dst_it; + ++_depthwise_infos_it; + ++_pointwise_infos_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _src_it; + std::vector<TensorShape>::const_iterator _filter_it; + std::vector<TensorShape>::const_iterator _depthwise_out_it; + std::vector<TensorShape>::const_iterator _weights_it; + std::vector<TensorShape>::const_iterator _biases_it; + std::vector<TensorShape>::const_iterator _dst_it; + std::vector<PadStrideInfo>::const_iterator _depthwise_infos_it; + std::vector<PadStrideInfo>::const_iterator _pointwise_infos_it; + }; + + iterator begin() const + { + return iterator(_src_shapes.begin(), _filter_shapes.begin(), _depthwise_out_shapes.begin(), _weight_shapes.begin(), _bias_shapes.begin(), _dst_shapes.begin(), _depthwise_infos.begin(), + _pointwise_infos.begin()); + } + + int size() const + { + return std::min(_src_shapes.size(), std::min(_filter_shapes.size(), std::min(_depthwise_out_shapes.size(), std::min(_weight_shapes.size(), std::min(_bias_shapes.size(), std::min(_dst_shapes.size(), + std::min(_depthwise_infos.size(), _pointwise_infos.size()))))))); + } + + void add_config(TensorShape src, TensorShape filter, TensorShape depthwise_out, TensorShape weights, TensorShape biases, TensorShape dst, PadStrideInfo depthwise_info, PadStrideInfo pointwise_info) + { + _src_shapes.emplace_back(std::move(src)); + _filter_shapes.emplace_back(std::move(filter)); + _depthwise_out_shapes.emplace_back(std::move(depthwise_out)); + _weight_shapes.emplace_back(std::move(weights)); + _bias_shapes.emplace_back(std::move(biases)); + _dst_shapes.emplace_back(std::move(dst)); + _depthwise_infos.emplace_back(std::move(depthwise_info)); + _pointwise_infos.emplace_back(std::move(pointwise_info)); + } + +protected: + DepthwiseSeparableConvolutionLayerDataset() = default; + DepthwiseSeparableConvolutionLayerDataset(DepthwiseSeparableConvolutionLayerDataset &&) = default; + +private: + std::vector<TensorShape> _src_shapes{}; + std::vector<TensorShape> _filter_shapes{}; + std::vector<TensorShape> _depthwise_out_shapes{}; + std::vector<TensorShape> _weight_shapes{}; + std::vector<TensorShape> _bias_shapes{}; + std::vector<TensorShape> _dst_shapes{}; + std::vector<PadStrideInfo> _depthwise_infos{}; + std::vector<PadStrideInfo> _pointwise_infos{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/DirectConvolutionLayerDataset.h b/tests/datasets/DirectConvolutionLayerDataset.h new file mode 100644 index 0000000000..dca38b5858 --- /dev/null +++ b/tests/datasets/DirectConvolutionLayerDataset.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_DIRECT_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_DIRECT_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +/** Stripped down version of AlexNet as not all kernel sizes and strides are supported. */ +class DirectConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + DirectConvolutionLayerDataset() + { + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 3U), TensorShape(3U), TensorShape(13U, 13U, 3U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 4U), TensorShape(4U), TensorShape(13U, 13U, 4U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 5U), TensorShape(5U), TensorShape(13U, 13U, 5U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 3U), TensorShape(3U), TensorShape(13U, 13U, 3U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 4U), TensorShape(4U), TensorShape(13U, 13U, 4U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 5U), TensorShape(5U), TensorShape(13U, 13U, 5U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 3U), TensorShape(3U), TensorShape(13U, 13U, 3U), PadStrideInfo(3, 3, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 4U), TensorShape(4U), TensorShape(13U, 13U, 4U), PadStrideInfo(3, 3, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 5U), TensorShape(5U), TensorShape(13U, 13U, 5U), PadStrideInfo(3, 3, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_DIRECT_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/FullyConnectedLayerDataset.h b/tests/datasets/FullyConnectedLayerDataset.h new file mode 100644 index 0000000000..8401e39ece --- /dev/null +++ b/tests/datasets/FullyConnectedLayerDataset.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_FULLYCONNECTED_LAYER_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class FullyConnectedLayerDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, TensorShape, TensorShape>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator src_it, + std::vector<TensorShape>::const_iterator weights_it, + std::vector<TensorShape>::const_iterator biases_it, + std::vector<TensorShape>::const_iterator dst_it) + : _src_it{ std::move(src_it) }, + _weights_it{ std::move(weights_it) }, + _biases_it{ std::move(biases_it) }, + _dst_it{ std::move(dst_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_src_it << ":"; + description << "Weights=" << *_weights_it << ":"; + description << "Biases=" << *_biases_it << ":"; + description << "Out=" << *_dst_it; + return description.str(); + } + + FullyConnectedLayerDataset::type operator*() const + { + return std::make_tuple(*_src_it, *_weights_it, *_biases_it, *_dst_it); + } + + iterator &operator++() + { + ++_src_it; + ++_weights_it; + ++_biases_it; + ++_dst_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _src_it; + std::vector<TensorShape>::const_iterator _weights_it; + std::vector<TensorShape>::const_iterator _biases_it; + std::vector<TensorShape>::const_iterator _dst_it; + }; + + iterator begin() const + { + return iterator(_src_shapes.begin(), _weight_shapes.begin(), _bias_shapes.begin(), _dst_shapes.begin()); + } + + int size() const + { + return std::min(_src_shapes.size(), std::min(_weight_shapes.size(), std::min(_bias_shapes.size(), _dst_shapes.size()))); + } + + void add_config(TensorShape src, TensorShape weights, TensorShape biases, TensorShape dst) + { + _src_shapes.emplace_back(std::move(src)); + _weight_shapes.emplace_back(std::move(weights)); + _bias_shapes.emplace_back(std::move(biases)); + _dst_shapes.emplace_back(std::move(dst)); + } + +protected: + FullyConnectedLayerDataset() = default; + FullyConnectedLayerDataset(FullyConnectedLayerDataset &&) = default; + +private: + std::vector<TensorShape> _src_shapes{}; + std::vector<TensorShape> _weight_shapes{}; + std::vector<TensorShape> _bias_shapes{}; + std::vector<TensorShape> _dst_shapes{}; +}; + +class SmallFullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + SmallFullyConnectedLayerDataset() + { + // Conv -> FC + add_config(TensorShape(9U, 5U, 7U), TensorShape(315U, 271U), TensorShape(271U), TensorShape(271U)); + // Conv -> FC (batched) + add_config(TensorShape(9U, 5U, 7U, 3U), TensorShape(315U, 271U), TensorShape(271U), TensorShape(271U, 3U)); + // FC -> FC + add_config(TensorShape(201U), TensorShape(201U, 529U), TensorShape(529U), TensorShape(529U)); + // FC -> FC (batched) + add_config(TensorShape(201U, 3U), TensorShape(201U, 529U), TensorShape(529U), TensorShape(529U, 3U)); + + add_config(TensorShape(9U, 5U, 7U, 3U, 2U), TensorShape(315U, 271U), TensorShape(271U), TensorShape(271U, 3U, 2U)); + } +}; + +class LargeFullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + LargeFullyConnectedLayerDataset() + { + add_config(TensorShape(9U, 5U, 257U), TensorShape(11565U, 2123U), TensorShape(2123U), TensorShape(2123U)); + add_config(TensorShape(9U, 5U, 257U, 2U), TensorShape(11565U, 2123U), TensorShape(2123U), TensorShape(2123U, 2U)); + add_config(TensorShape(3127U), TensorShape(3127U, 989U), TensorShape(989U), TensorShape(989U)); + add_config(TensorShape(3127U, 2U), TensorShape(3127U, 989U), TensorShape(989U), TensorShape(989U, 2U)); + + add_config(TensorShape(9U, 5U, 257U, 2U, 3U), TensorShape(11565U, 2123U), TensorShape(2123U), TensorShape(2123U, 2U, 3U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/GEMMDataset.h b/tests/datasets/GEMMDataset.h new file mode 100644 index 0000000000..bb8a328b0c --- /dev/null +++ b/tests/datasets/GEMMDataset.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GEMM_DATASET +#define ARM_COMPUTE_TEST_GEMM_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GEMMDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, TensorShape, TensorShape, float, float>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator a_it, + std::vector<TensorShape>::const_iterator b_it, + std::vector<TensorShape>::const_iterator c_it, + std::vector<TensorShape>::const_iterator dst_it, + std::vector<float>::const_iterator alpha_it, + std::vector<float>::const_iterator beta_it) + : _a_it{ std::move(a_it) }, + _b_it{ std::move(b_it) }, + _c_it{ std::move(c_it) }, + _dst_it{ std::move(dst_it) }, + _alpha_it{ std::move(alpha_it) }, + _beta_it{ std::move(beta_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "A=" << *_a_it << ":"; + description << "B=" << *_b_it << ":"; + description << "C=" << *_c_it << ":"; + description << "Out=" << *_dst_it << ":"; + description << "Alpha=" << *_alpha_it << ":"; + description << "Beta=" << *_beta_it; + return description.str(); + } + + GEMMDataset::type operator*() const + { + return std::make_tuple(*_a_it, *_b_it, *_c_it, *_dst_it, *_alpha_it, *_beta_it); + } + + iterator &operator++() + { + ++_a_it; + ++_b_it; + ++_c_it; + ++_dst_it; + ++_alpha_it; + ++_beta_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _a_it; + std::vector<TensorShape>::const_iterator _b_it; + std::vector<TensorShape>::const_iterator _c_it; + std::vector<TensorShape>::const_iterator _dst_it; + std::vector<float>::const_iterator _alpha_it; + std::vector<float>::const_iterator _beta_it; + }; + + iterator begin() const + { + return iterator(_a_shapes.begin(), _b_shapes.begin(), _c_shapes.begin(), _dst_shapes.begin(), _alpha.begin(), _beta.begin()); + } + + int size() const + { + return std::min(_a_shapes.size(), std::min(_b_shapes.size(), std::min(_c_shapes.size(), std::min(_dst_shapes.size(), std::min(_alpha.size(), _beta.size()))))); + } + + void add_config(TensorShape a, TensorShape b, TensorShape c, TensorShape dst, float alpha, float beta) + { + _a_shapes.emplace_back(std::move(a)); + _b_shapes.emplace_back(std::move(b)); + _c_shapes.emplace_back(std::move(c)); + _dst_shapes.emplace_back(std::move(dst)); + _alpha.emplace_back(std::move(alpha)); + _beta.emplace_back(std::move(beta)); + } + +protected: + GEMMDataset() = default; + GEMMDataset(GEMMDataset &&) = default; + +private: + std::vector<TensorShape> _a_shapes{}; + std::vector<TensorShape> _b_shapes{}; + std::vector<TensorShape> _c_shapes{}; + std::vector<TensorShape> _dst_shapes{}; + std::vector<float> _alpha{}; + std::vector<float> _beta{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GEMM_DATASET */ diff --git a/tests/datasets/InterpolationPolicyDataset.h b/tests/datasets/InterpolationPolicyDataset.h new file mode 100644 index 0000000000..154f887962 --- /dev/null +++ b/tests/datasets/InterpolationPolicyDataset.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_INTEPOLATIONPOLICY_DATASET_H__ +#define __ARM_COMPUTE_TEST_INTEPOLATIONPOLICY_DATASET_H__ + +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class InterpolationPolicies final : public framework::dataset::ContainerDataset<std::vector<InterpolationPolicy>> +{ +public: + InterpolationPolicies() + : ContainerDataset("InterpolationPolicy", + { + InterpolationPolicy::NEAREST_NEIGHBOR, + InterpolationPolicy::BILINEAR, + InterpolationPolicy::AREA + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_INTEPOLATIONPOLICY_DATASET_H__ */ diff --git a/tests/datasets/LargeConvolutionLayerDataset.h b/tests/datasets/LargeConvolutionLayerDataset.h new file mode 100644 index 0000000000..721530ae19 --- /dev/null +++ b/tests/datasets/LargeConvolutionLayerDataset.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LargeConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + LargeConvolutionLayerDataset() + { + // Batch size 1 + add_config(TensorShape(227U, 227U, 3U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U), PadStrideInfo(4, 4, 0, 0)); + add_config(TensorShape(27U, 27U, 96U), TensorShape(5U, 5U, 96U, 256U), TensorShape(256U), TensorShape(27U, 27U, 256U), PadStrideInfo(1, 1, 2, 2)); + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(224U, 224U, 3U), TensorShape(7U, 7U, 3U, 64U), TensorShape(64U), TensorShape(112U, 112U, 64U), PadStrideInfo(2, 2, 3, 3)); + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + // Batch size 4 + add_config(TensorShape(227U, 227U, 3U, 4U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U, 4U), PadStrideInfo(4, 4, 0, 0)); + add_config(TensorShape(27U, 27U, 96U, 4U), TensorShape(5U, 5U, 96U, 256U), TensorShape(256U), TensorShape(27U, 27U, 256U, 4U), PadStrideInfo(1, 1, 2, 2)); + add_config(TensorShape(13U, 13U, 256U, 4U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U, 4U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U, 4U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U, 4U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U, 4U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U, 4U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(224U, 224U, 3U, 4U), TensorShape(7U, 7U, 3U, 64U), TensorShape(64U), TensorShape(112U, 112U, 64U, 4U), PadStrideInfo(2, 2, 3, 3)); + add_config(TensorShape(28U, 28U, 256U, 4U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U, 4U), PadStrideInfo(1, 1, 0, 0)); + // Batch size 8 + add_config(TensorShape(227U, 227U, 3U, 8U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U, 8U), PadStrideInfo(4, 4, 0, 0)); + add_config(TensorShape(27U, 27U, 96U, 8U), TensorShape(5U, 5U, 96U, 256U), TensorShape(256U), TensorShape(27U, 27U, 256U, 8U), PadStrideInfo(1, 1, 2, 2)); + add_config(TensorShape(13U, 13U, 256U, 8U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U, 8U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U, 8U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U, 8U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U, 8U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U, 8U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(224U, 224U, 3U, 8U), TensorShape(7U, 7U, 3U, 64U), TensorShape(64U), TensorShape(112U, 112U, 64U, 8U), PadStrideInfo(2, 2, 3, 3)); + add_config(TensorShape(28U, 28U, 256U, 8U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U, 8U), PadStrideInfo(1, 1, 0, 0)); + // Arbitrary batch size + add_config(TensorShape(227U, 227U, 3U, 5U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U, 5U), PadStrideInfo(4, 4, 0, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LARGE_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/LargeDepthwiseConvolutionDataset.h b/tests/datasets/LargeDepthwiseConvolutionDataset.h new file mode 100644 index 0000000000..22b1516d20 --- /dev/null +++ b/tests/datasets/LargeDepthwiseConvolutionDataset.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LARGE_DEPTHWISE_CONVOLUTION_DATASET +#define ARM_COMPUTE_TEST_LARGE_DEPTHWISE_CONVOLUTION_DATASET + +#include "tests/datasets/DepthwiseConvolutionDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LargeDepthwiseConvolutionDataset final : public DepthwiseConvolutionDataset +{ +public: + LargeDepthwiseConvolutionDataset() + { + add_config(TensorShape(233U, 277U, 55U), TensorShape(3U, 3U, 55U), TensorShape(116U, 275U, 55U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(333U, 277U, 77U), TensorShape(3U, 3U, 77U), TensorShape(111U, 138U, 77U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(177U, 311U, 22U), TensorShape(3U, 3U, 22U), TensorShape(177U, 156U, 22U), PadStrideInfo(1, 2, 1, 1)); + add_config(TensorShape(233U, 277U, 55U), TensorShape(3U, 3U, 55U), TensorShape(231U, 138U, 55U), PadStrideInfo(1, 2, 0, 0)); + add_config(TensorShape(333U, 277U, 77U), TensorShape(3U, 3U, 77U), TensorShape(166U, 93U, 77U), PadStrideInfo(2, 3, 0, 1)); + add_config(TensorShape(177U, 311U, 22U), TensorShape(3U, 3U, 22U), TensorShape(89U, 311U, 22U), PadStrideInfo(2, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LARGE_DEPTHWISE_CONVOLUTION_DATASET */ diff --git a/tests/datasets/LargeGEMMDataset.h b/tests/datasets/LargeGEMMDataset.h new file mode 100644 index 0000000000..37cdfaa99f --- /dev/null +++ b/tests/datasets/LargeGEMMDataset.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LARGE_GEMM_DATASET +#define ARM_COMPUTE_TEST_LARGE_GEMM_DATASET + +#include "tests/datasets/GEMMDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LargeGEMMDataset final : public GEMMDataset +{ +public: + LargeGEMMDataset() + { + add_config(TensorShape(923U, 429U), TensorShape(871U, 923U), TensorShape(871U, 429U), TensorShape(871U, 429U), 1.0f, 0.0f); + add_config(TensorShape(1021U, 1U), TensorShape(783U, 1021U), TensorShape(783U, 1U), TensorShape(783U, 1U), 1.0f, 0.0f); + add_config(TensorShape(681U, 1023U), TensorShape(213U, 681U), TensorShape(213U, 1023U), TensorShape(213U, 1023U), 0.2f, 1.2f); + add_config(TensorShape(941U, 1U), TensorShape(623U, 941U), TensorShape(623U, 1U), TensorShape(623U, 1U), 0.4f, 0.7f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LARGE_GEMM_DATASET */ diff --git a/tests/datasets/MatrixMultiplyGEMMDataset.h b/tests/datasets/MatrixMultiplyGEMMDataset.h new file mode 100644 index 0000000000..771403ba96 --- /dev/null +++ b/tests/datasets/MatrixMultiplyGEMMDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET +#define ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET + +#include "tests/datasets/GEMMDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class MatrixMultiplyGEMMDataset final : public GEMMDataset +{ +public: + MatrixMultiplyGEMMDataset() + { + add_config(TensorShape(1024U, 1U), TensorShape(1000U, 1024U), TensorShape(1000U, 1U), TensorShape(1000U, 1U), 1.0f, 0.0f); + add_config(TensorShape(256U, 784U), TensorShape(64U, 256U), TensorShape(64U, 784U), TensorShape(64U, 784U), 1.0f, 0.0f); + add_config(TensorShape(1152U, 2704U), TensorShape(256U, 1152U), TensorShape(256U, 2704U), TensorShape(256U, 2704U), 1.0f, 0.0f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_MATRIXMULTIPLY_GEMM_DATASET */ diff --git a/tests/datasets/MobileNetDepthwiseConvolutionDataset.h b/tests/datasets/MobileNetDepthwiseConvolutionDataset.h new file mode 100644 index 0000000000..c417f18a51 --- /dev/null +++ b/tests/datasets/MobileNetDepthwiseConvolutionDataset.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_CONVOLUTION_DATASET +#define ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_CONVOLUTION_DATASET + +#include "tests/datasets/DepthwiseConvolutionDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class MobileNetDepthwiseConvolutionDataset final : public DepthwiseConvolutionDataset +{ +public: + MobileNetDepthwiseConvolutionDataset() + { + add_config(TensorShape(7U, 7U, 1024U), TensorShape(3U, 3U, 1024U), TensorShape(3U, 3U, 1024U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(7U, 7U, 512U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(28U, 28U, 256U), TensorShape(3U, 3U, 256U), TensorShape(14U, 14U, 256U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(28U, 28U, 256U), TensorShape(3U, 3U, 256U), TensorShape(28U, 28U, 256U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(56U, 56U, 128U), TensorShape(3U, 3U, 128U), TensorShape(28U, 28U, 128U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(56U, 56U, 128U), TensorShape(3U, 3U, 128U), TensorShape(56U, 56U, 128U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(112U, 112U, 64U), TensorShape(3U, 3U, 64U), TensorShape(56U, 56U, 64U), PadStrideInfo(2, 2, 1, 1)); + add_config(TensorShape(112U, 112U, 32U), TensorShape(3U, 3U, 32U), TensorShape(112U, 112U, 32U), PadStrideInfo(1, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_CONVOLUTION_DATASET */ diff --git a/tests/datasets/MobileNetDepthwiseSeparableConvolutionLayerDataset.h b/tests/datasets/MobileNetDepthwiseSeparableConvolutionLayerDataset.h new file mode 100644 index 0000000000..c7784c399c --- /dev/null +++ b/tests/datasets/MobileNetDepthwiseSeparableConvolutionLayerDataset.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/DepthwiseSeparableConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class MobileNetDepthwiseSeparableConvolutionLayerDataset final : public DepthwiseSeparableConvolutionLayerDataset +{ +public: + MobileNetDepthwiseSeparableConvolutionLayerDataset() + { + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, + 1, + DimensionRoundingType::FLOOR), + PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::FLOOR)); + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, + 1, + DimensionRoundingType::FLOOR), + PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::FLOOR)); + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, + 1, + DimensionRoundingType::FLOOR), + PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::FLOOR)); + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, + 1, + DimensionRoundingType::FLOOR), + PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::FLOOR)); + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U), TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, + 1, + DimensionRoundingType::FLOOR), + PadStrideInfo(1, 1, 0, 0, DimensionRoundingType::FLOOR)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_MOBILENET_DEPTHWISE_SEPARABLE_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/NormalizationTypesDataset.h b/tests/datasets/NormalizationTypesDataset.h new file mode 100644 index 0000000000..9b218a7905 --- /dev/null +++ b/tests/datasets/NormalizationTypesDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_NORMALIZATION_TYPES_DATASET_H__ +#define __ARM_COMPUTE_TEST_NORMALIZATION_TYPES_DATASET_H__ + +#include "arm_compute/core/Types.h" +#include "tests/framework/datasets/ContainerDataset.h" + +#include <vector> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class NormalizationTypes final : public framework::dataset::ContainerDataset<std::vector<NormType>> +{ +public: + NormalizationTypes() + : ContainerDataset("NormType", + { + NormType::IN_MAP_1D, NormType::IN_MAP_2D, NormType::CROSS_MAP + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_NORMALIZATION_TYPES_DATASET_H__ */ diff --git a/tests/datasets/PoolingLayerDataset.h b/tests/datasets/PoolingLayerDataset.h new file mode 100644 index 0000000000..e5e9cd70f0 --- /dev/null +++ b/tests/datasets/PoolingLayerDataset.h @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_POOLING_LAYER_DATASET + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" +#include "tests/TypePrinter.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class PoolingLayerDataset +{ +public: + using type = std::tuple<TensorShape, TensorShape, PoolingLayerInfo>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator src_it, + std::vector<TensorShape>::const_iterator dst_it, + std::vector<PoolingLayerInfo>::const_iterator infos_it) + : _src_it{ std::move(src_it) }, + _dst_it{ std::move(dst_it) }, + _infos_it{ std::move(infos_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_src_it << ":"; + description << "Out=" << *_dst_it << ":"; + description << "Info=" << *_infos_it; + return description.str(); + } + + PoolingLayerDataset::type operator*() const + { + return std::make_tuple(*_src_it, *_dst_it, *_infos_it); + } + + iterator &operator++() + { + ++_src_it; + ++_dst_it; + ++_infos_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _src_it; + std::vector<TensorShape>::const_iterator _dst_it; + std::vector<PoolingLayerInfo>::const_iterator _infos_it; + }; + + iterator begin() const + { + return iterator(_src_shapes.begin(), _dst_shapes.begin(), _infos.begin()); + } + + int size() const + { + return std::min(_src_shapes.size(), std::min(_dst_shapes.size(), _infos.size())); + } + + void add_config(TensorShape src, TensorShape dst, PoolingLayerInfo info) + { + _src_shapes.emplace_back(std::move(src)); + _dst_shapes.emplace_back(std::move(dst)); + _infos.emplace_back(std::move(info)); + } + +protected: + PoolingLayerDataset() = default; + PoolingLayerDataset(PoolingLayerDataset &&) = default; + +private: + std::vector<TensorShape> _src_shapes{}; + std::vector<TensorShape> _dst_shapes{}; + std::vector<PoolingLayerInfo> _infos{}; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/PoolingTypesDataset.h b/tests/datasets/PoolingTypesDataset.h new file mode 100644 index 0000000000..5ba8aaf6d0 --- /dev/null +++ b/tests/datasets/PoolingTypesDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_POOLING_TYPES_DATASET_H__ +#define __ARM_COMPUTE_TEST_POOLING_TYPES_DATASET_H__ + +#include "arm_compute/core/Types.h" +#include "tests/framework/datasets/ContainerDataset.h" + +#include <vector> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class PoolingTypes final : public framework::dataset::ContainerDataset<std::vector<PoolingType>> +{ +public: + PoolingTypes() + : ContainerDataset("PoolType", + { + PoolingType::MAX, PoolingType::AVG + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_NORMALIZATION_TYPES_DATASET_H__ */ diff --git a/tests/datasets/ROIPoolingLayerDataset.h b/tests/datasets/ROIPoolingLayerDataset.h new file mode 100644 index 0000000000..65d589eb97 --- /dev/null +++ b/tests/datasets/ROIPoolingLayerDataset.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ROI_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_ROI_POOLING_LAYER_DATASET + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class ROIPoolingLayerDataset +{ +public: + using type = std::tuple<TensorShape, ROIPoolingLayerInfo, int>; + + struct iterator + { + iterator(std::vector<TensorShape>::const_iterator tensor_shape_it, + std::vector<ROIPoolingLayerInfo>::const_iterator infos_it, + std::vector<unsigned int>::const_iterator num_rois_it) + : _tensor_shape_it{ std::move(tensor_shape_it) }, + _infos_it{ std::move(infos_it) }, + _num_rois_it{ std::move(num_rois_it) } + { + } + + std::string description() const + { + std::stringstream description; + description << "In=" << *_tensor_shape_it << ":"; + description << "Info=" << *_infos_it << ":"; + description << "NumROIS=" << *_num_rois_it; + return description.str(); + } + + ROIPoolingLayerDataset::type operator*() const + { + return std::make_tuple(*_tensor_shape_it, *_infos_it, *_num_rois_it); + } + + iterator &operator++() + { + ++_tensor_shape_it; + ++_infos_it; + ++_num_rois_it; + + return *this; + } + + private: + std::vector<TensorShape>::const_iterator _tensor_shape_it; + std::vector<ROIPoolingLayerInfo>::const_iterator _infos_it; + std::vector<unsigned int>::const_iterator _num_rois_it; + }; + + iterator begin() const + { + return iterator(_tensor_shapes.begin(), _infos.begin(), _num_rois.begin()); + } + + int size() const + { + return std::min(std::min(_tensor_shapes.size(), _infos.size()), _num_rois.size()); + } + + void add_config(TensorShape tensor_shape, ROIPoolingLayerInfo info, unsigned int num_rois) + { + _tensor_shapes.emplace_back(std::move(tensor_shape)); + _infos.emplace_back(std::move(info)); + _num_rois.emplace_back(std::move(num_rois)); + } + +protected: + ROIPoolingLayerDataset() = default; + ROIPoolingLayerDataset(ROIPoolingLayerDataset &&) = default; + +private: + std::vector<TensorShape> _tensor_shapes{}; + std::vector<ROIPoolingLayerInfo> _infos{}; + std::vector<unsigned int> _num_rois{}; +}; + +class SmallROIPoolingLayerDataset final : public ROIPoolingLayerDataset +{ +public: + SmallROIPoolingLayerDataset() + { + add_config(TensorShape(50U, 47U, 3U), ROIPoolingLayerInfo(7U, 7U, 1.f / 8.f), 40U); + add_config(TensorShape(50U, 47U, 10U), ROIPoolingLayerInfo(7U, 7U, 1.f / 8.f), 80U); + add_config(TensorShape(50U, 47U, 80U), ROIPoolingLayerInfo(7U, 7U, 1.f / 8.f), 80U); + add_config(TensorShape(50U, 47U, 3U), ROIPoolingLayerInfo(9U, 9U, 1.f / 8.f), 40U); + add_config(TensorShape(50U, 47U, 10U), ROIPoolingLayerInfo(9U, 9U, 1.f / 8.f), 80U); + add_config(TensorShape(50U, 47U, 80U), ROIPoolingLayerInfo(9U, 9U, 1.f / 8.f), 80U); + } +}; + +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ROI_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/ReductionOperationDataset.h b/tests/datasets/ReductionOperationDataset.h new file mode 100644 index 0000000000..ce1bcb8501 --- /dev/null +++ b/tests/datasets/ReductionOperationDataset.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_REDUCTION_OPERATION_DATASET_H__ +#define __ARM_COMPUTE_TEST_REDUCTION_OPERATION_DATASET_H__ + +#include "arm_compute/core/Types.h" +#include "tests/TypePrinter.h" +#include "tests/framework/datasets/ContainerDataset.h" + +#include <vector> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class ReductionOperations final : public framework::dataset::ContainerDataset<std::vector<ReductionOperation>> +{ +public: + ReductionOperations() + : ContainerDataset("ReductionOperation", + { + ReductionOperation::SUM_SQUARE + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_REDUCTION_OPERATION_DATASET_H__ */ diff --git a/tests/datasets/ShapeDatasets.h b/tests/datasets/ShapeDatasets.h new file mode 100644 index 0000000000..4c449a702f --- /dev/null +++ b/tests/datasets/ShapeDatasets.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ +#define __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ + +#include "arm_compute/core/TensorShape.h" +#include "tests/framework/datasets/Datasets.h" + +#include <type_traits> + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +/** Data set containing 1D tensor shapes. */ +class Small1DShape final : public framework::dataset::SingletonDataset<TensorShape> +{ +public: + Small1DShape() + : SingletonDataset("Shape", TensorShape{ 256U }) + { + } +}; + +/** Parent type for all for shape datasets. */ +using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>; + +/** Data set containing small 2D tensor shapes. */ +class Small2DShapes final : public ShapeDataset +{ +public: + Small2DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 7U, 7U }, + TensorShape{ 27U, 13U }, + TensorShape{ 128U, 64U } + }) + { + } +}; + +/** Data set containing small tensor shapes. */ +class SmallShapes final : public ShapeDataset +{ +public: + SmallShapes() + : ShapeDataset("Shape", + { + // Batch size 1 + TensorShape{ 7U, 7U }, + TensorShape{ 27U, 13U, 2U }, + TensorShape{ 128U, 64U, 1U, 3U }, + // Batch size 4 + TensorShape{ 7U, 7U, 3U, 4U }, + TensorShape{ 27U, 13U, 2U, 4U }, + // Arbitrary batch size + TensorShape{ 7U, 7U, 3U, 5U } + }) + { + } +}; + +/** Data set containing large tensor shapes. */ +class LargeShapes final : public ShapeDataset +{ +public: + LargeShapes() + : ShapeDataset("Shape", + { + // Batch size 1 + TensorShape{ 1920U, 1080U }, + TensorShape{ 640U, 480U, 2U, 3U }, + TensorShape{ 4160U, 3120U }, + // Batch size 4 + TensorShape{ 800U, 600U, 1U, 4U }, + }) + { + } +}; + +/** Data set containing large 2D tensor shapes. */ +class Large2DShapes final : public ShapeDataset +{ +public: + Large2DShapes() + : ShapeDataset("Shape", + { + TensorShape{ 1920U, 1080U }, + TensorShape{ 1245U, 652U }, + TensorShape{ 4160U, 3120U } + }) + { + } +}; + +/** Data set containing small tensor shapes for direct convolution. */ +class SmallDirectConvolutionShapes final : public ShapeDataset +{ +public: + SmallDirectConvolutionShapes() + : ShapeDataset("InputShape", + { + // Batch size 1 + TensorShape{ 5U, 5U, 3U }, + TensorShape{ 32U, 37U, 3U }, + TensorShape{ 13U, 15U, 8U }, + // Batch size 4 + TensorShape{ 5U, 5U, 3U, 4U }, + TensorShape{ 32U, 37U, 3U, 4U }, + TensorShape{ 13U, 15U, 8U, 4U }, + // Batch size 8 + TensorShape{ 5U, 5U, 3U, 8U }, + TensorShape{ 32U, 37U, 3U, 8U }, + TensorShape{ 13U, 15U, 8U, 8U }, + // Arbitrary batch size + TensorShape{ 32U, 37U, 3U, 8U } + }) + { + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* __ARM_COMPUTE_TEST_SHAPE_DATASETS_H__ */ diff --git a/tests/datasets/SmallConvolutionLayerDataset.h b/tests/datasets/SmallConvolutionLayerDataset.h new file mode 100644 index 0000000000..1a26fa5917 --- /dev/null +++ b/tests/datasets/SmallConvolutionLayerDataset.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SmallConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + SmallConvolutionLayerDataset() + { + // Batch size 1 + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 3U, 5U, 21U), TensorShape(21U), TensorShape(11U, 25U, 21U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(5U, 5U, 7U, 16U), TensorShape(16U), TensorShape(11U, 12U, 16U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U), TensorShape(5U, 5U, 2U, 19U), TensorShape(19U), TensorShape(15U, 15U, 19U), PadStrideInfo(1, 2, 1, 1)); + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 1U, 5U, 21U), TensorShape(21U), TensorShape(11U, 27U, 21U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(5U, 7U, 7U, 16U), TensorShape(16U), TensorShape(11U, 11U, 16U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U), TensorShape(5U, 3U, 2U, 19U), TensorShape(19U), TensorShape(15U, 16U, 19U), PadStrideInfo(1, 2, 1, 1)); + // Batch size 4 + add_config(TensorShape(23U, 27U, 5U, 4U), TensorShape(3U, 3U, 5U, 21U), TensorShape(21U), TensorShape(11U, 25U, 21U, 4U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U, 4U), TensorShape(5U, 5U, 7U, 16U), TensorShape(16U), TensorShape(11U, 12U, 16U, 4U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U, 4U), TensorShape(5U, 5U, 2U, 19U), TensorShape(19U), TensorShape(15U, 15U, 19U, 4U), PadStrideInfo(1, 2, 1, 1)); + add_config(TensorShape(23U, 27U, 5U, 4U), TensorShape(3U, 1U, 5U, 21U), TensorShape(21U), TensorShape(11U, 27U, 21U, 4U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U, 4U), TensorShape(5U, 7U, 7U, 16U), TensorShape(16U), TensorShape(11U, 11U, 16U, 4U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U, 4U), TensorShape(5U, 3U, 2U, 19U), TensorShape(19U), TensorShape(15U, 16U, 19U, 4U), PadStrideInfo(1, 2, 1, 1)); + // Arbitrary batch size + add_config(TensorShape(33U, 27U, 7U, 5U), TensorShape(5U, 7U, 7U, 16U), TensorShape(16U), TensorShape(11U, 11U, 16U, 5U), PadStrideInfo(3, 2, 1, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SMALL_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/SmallDepthwiseConvolutionDataset.h b/tests/datasets/SmallDepthwiseConvolutionDataset.h new file mode 100644 index 0000000000..17d01fb5d6 --- /dev/null +++ b/tests/datasets/SmallDepthwiseConvolutionDataset.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SMALL_DEPTHWISE_CONVOLUTION_DATASET +#define ARM_COMPUTE_TEST_SMALL_DEPTHWISE_CONVOLUTION_DATASET + +#include "tests/datasets/DepthwiseConvolutionDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SmallDepthwiseConvolutionDataset final : public DepthwiseConvolutionDataset +{ +public: + SmallDepthwiseConvolutionDataset() + { + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 3U, 5U), TensorShape(11U, 25U, 5U), PadStrideInfo(2, 1, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(3U, 3U, 7U), TensorShape(11U, 13U, 7U), PadStrideInfo(3, 2, 1, 0)); + add_config(TensorShape(17U, 31U, 2U), TensorShape(3U, 3U, 2U), TensorShape(17U, 16U, 2U), PadStrideInfo(1, 2, 1, 1)); + add_config(TensorShape(23U, 27U, 5U), TensorShape(3U, 3U, 5U), TensorShape(21U, 13U, 5U), PadStrideInfo(1, 2, 0, 0)); + add_config(TensorShape(33U, 27U, 7U), TensorShape(3U, 3U, 7U), TensorShape(16U, 9U, 7U), PadStrideInfo(2, 3, 0, 1)); + add_config(TensorShape(17U, 31U, 2U), TensorShape(3U, 3U, 2U), TensorShape(9U, 31U, 2U), PadStrideInfo(2, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SMALL_DEPTHWISE_CONVOLUTION_DATASET */ diff --git a/tests/datasets/SmallGEMMDataset.h b/tests/datasets/SmallGEMMDataset.h new file mode 100644 index 0000000000..0cc3c3aa8c --- /dev/null +++ b/tests/datasets/SmallGEMMDataset.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SMALL_GEMM_DATASET +#define ARM_COMPUTE_TEST_SMALL_GEMM_DATASET + +#include "tests/datasets/GEMMDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SmallGEMMDataset final : public GEMMDataset +{ +public: + SmallGEMMDataset() + { + add_config(TensorShape(21U, 13U), TensorShape(33U, 21U), TensorShape(33U, 13U), TensorShape(33U, 13U), 1.0f, 0.0f); + add_config(TensorShape(31U, 1U), TensorShape(23U, 31U), TensorShape(23U, 1U), TensorShape(23U, 1U), 1.0f, 0.0f); + add_config(TensorShape(38U, 12U), TensorShape(21U, 38U), TensorShape(21U, 12U), TensorShape(21U, 12U), 0.2f, 1.2f); + add_config(TensorShape(32U, 1U), TensorShape(17U, 32U), TensorShape(17U, 1U), TensorShape(17U, 1U), 0.4f, 0.7f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SMALL_GEMM_DATASET */ diff --git a/tests/datasets/system_tests/alexnet/AlexNetActivationLayerDataset.h b/tests/datasets/system_tests/alexnet/AlexNetActivationLayerDataset.h new file mode 100644 index 0000000000..4030e97436 --- /dev/null +++ b/tests/datasets/system_tests/alexnet/AlexNetActivationLayerDataset.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ALEXNET_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_ALEXNET_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class AlexNetActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + AlexNetActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { TensorShape(55U, 55U, 96U), TensorShape(27U, 27U, 256U), TensorShape(13U, 13U, 384U), TensorShape(13U, 13U, 256U), TensorShape(4096U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + AlexNetActivationLayerDataset(AlexNetActivationLayerDataset &&) = default; + ~AlexNetActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ALEXNET_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/alexnet/AlexNetConvolutionLayerDataset.h b/tests/datasets/system_tests/alexnet/AlexNetConvolutionLayerDataset.h new file mode 100644 index 0000000000..d0b901a9a1 --- /dev/null +++ b/tests/datasets/system_tests/alexnet/AlexNetConvolutionLayerDataset.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ALEXNET_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_ALEXNET_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class AlexNetConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + AlexNetConvolutionLayerDataset() + { + add_config(TensorShape(227U, 227U, 3U), TensorShape(11U, 11U, 3U, 96U), TensorShape(96U), TensorShape(55U, 55U, 96U), PadStrideInfo(4, 4, 0, 0)); + add_config(TensorShape(27U, 27U, 96U), TensorShape(5U, 5U, 96U, 256U), TensorShape(256U), TensorShape(27U, 27U, 256U), PadStrideInfo(1, 1, 2, 2)); + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 1, 1)); + } +}; + +class AlexNetDirectConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + AlexNetDirectConvolutionLayerDataset() + { + add_config(TensorShape(13U, 13U, 256U), TensorShape(3U, 3U, 256U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(13U, 13U, 384U), PadStrideInfo(1, 1, 1, 1)); + add_config(TensorShape(13U, 13U, 384U), TensorShape(3U, 3U, 384U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ALEXNET_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/alexnet/AlexNetFullyConnectedLayerDataset.h b/tests/datasets/system_tests/alexnet/AlexNetFullyConnectedLayerDataset.h new file mode 100644 index 0000000000..50b0f7d75d --- /dev/null +++ b/tests/datasets/system_tests/alexnet/AlexNetFullyConnectedLayerDataset.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ALEXNET_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_ALEXNET_FULLYCONNECTED_LAYER_DATASET + +#include "tests/datasets/FullyConnectedLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class AlexNetFullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + AlexNetFullyConnectedLayerDataset() + { + add_config(TensorShape(6U, 6U, 256U), TensorShape(9216U, 4096U), TensorShape(4096U), TensorShape(4096U)); + add_config(TensorShape(4096U), TensorShape(4096U, 4096U), TensorShape(4096U), TensorShape(4096U)); + add_config(TensorShape(4096U), TensorShape(4096U, 1000U), TensorShape(1000U), TensorShape(1000U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ALEXNET_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/alexnet/AlexNetNormalizationLayerDataset.h b/tests/datasets/system_tests/alexnet/AlexNetNormalizationLayerDataset.h new file mode 100644 index 0000000000..33b7423442 --- /dev/null +++ b/tests/datasets/system_tests/alexnet/AlexNetNormalizationLayerDataset.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ALEXNET_NORMALIZATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_ALEXNET_NORMALIZATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class AlexNetNormalizationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<NormalizationLayerInfo>> +{ +public: + AlexNetNormalizationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { TensorShape(55U, 55U, 96U), TensorShape(27U, 27U, 256U) }), + framework::dataset::make("Info", NormalizationLayerInfo(NormType::CROSS_MAP, 5, 0.0001f, 0.75f)) + } + { + } + AlexNetNormalizationLayerDataset(AlexNetNormalizationLayerDataset &&) = default; + ~AlexNetNormalizationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ALEXNET_NORMALIZATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/alexnet/AlexNetPoolingLayerDataset.h b/tests/datasets/system_tests/alexnet/AlexNetPoolingLayerDataset.h new file mode 100644 index 0000000000..ab2749b36e --- /dev/null +++ b/tests/datasets/system_tests/alexnet/AlexNetPoolingLayerDataset.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_ALEXNET_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_ALEXNET_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class AlexNetPoolingLayerDataset final : public PoolingLayerDataset +{ +public: + AlexNetPoolingLayerDataset() + { + add_config(TensorShape(55U, 55U, 96U), TensorShape(27U, 27U, 96U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0))); + add_config(TensorShape(27U, 27U, 256U), TensorShape(13U, 13U, 256U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0))); + add_config(TensorShape(13U, 13U, 256U), TensorShape(6U, 6U, 256U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_ALEXNET_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ActivationLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ActivationLayerDataset.h new file mode 100644 index 0000000000..dc4ffe4e4e --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ActivationLayerDataset.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1ActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + GoogLeNetInceptionV1ActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // conv1/relu_7x7 + TensorShape(112U, 112U, 64U), + // conv2/relu_3x3_reduce + TensorShape(56U, 56U, 64U), + // conv2/relu_3x3 + TensorShape(56U, 56U, 192U), + // inception_3a/relu_1x1, inception_3b/relu_pool_proj + TensorShape(28U, 28U, 64U), + // inception_3a/relu_3x3_reduce, inception_3b/relu_5x5 + TensorShape(28U, 28U, 96U), + // inception_3a/relu_3x3, inception_3b/relu_1x1, inception_3b/relu_3x3_reduce + TensorShape(28U, 28U, 128U), + // inception_3a/relu_5x5_reduce + TensorShape(28U, 28U, 16U), + // inception_3a/relu_5x5, inception_3a/relu_pool_proj, inception_3b/relu_5x5_reduce + TensorShape(28U, 28U, 32U), + // inception_3b/relu_3x3 + TensorShape(28U, 28U, 192U), + // inception_4a/relu_1x1 + TensorShape(14U, 14U, 192U), + // inception_4a/relu_3x3_reduce + TensorShape(14U, 14U, 96U), + // inception_4a/relu_3x3 + TensorShape(14U, 14U, 208U), + // inception_4a/relu_5x5_reduce + TensorShape(14U, 14U, 16U), + // inception_4a/relu_5x5 + TensorShape(14U, 14U, 48U), + // inception_4a/relu_pool_proj, inception_4b/relu_5x5, inception_4b/relu_pool_proj, inception_4c/relu_5x5, inception_4c/relu_pool_proj, inception_4d/relu_5x5, inception_4d/relu_pool_proj + TensorShape(14U, 14U, 64U), + // inception_4b/relu_1x1, inception_4e/relu_3x3_reduce + TensorShape(14U, 14U, 160U), + // inception_4b/relu_3x3_reduce, inception_4d/relu_1x1 + TensorShape(14U, 14U, 112U), + // inception_4b/relu_3x3 + TensorShape(14U, 14U, 224U), + // inception_4b/relu_5x5_reduce, inception_4c/relu_5x5_reduce + TensorShape(14U, 14U, 24U), + // inception_4c/relu_1x1, inception_4c/relu_3x3_reduce, inception_4e/relu_5x5, inception_4e/relu_pool_proj + TensorShape(14U, 14U, 128U), + // inception_4c/relu_3x3, inception_4e/relu_1x1 + TensorShape(14U, 14U, 256U), + // inception_4d/relu_3x3_reduce + TensorShape(14U, 14U, 144U), + // inception_4d/relu_3x3 + TensorShape(14U, 14U, 288U), + // inception_4d/relu_5x5_reduce, inception_4e/relu_5x5_reduce + TensorShape(14U, 14U, 32U), + // inception_4e/relu_3x3 + TensorShape(14U, 14U, 320U), + // inception_5a/relu_1x1 + TensorShape(7U, 7U, 256U), + // inception_5a/relu_3x3_reduce + TensorShape(7U, 7U, 160U), + // inception_5a/relu_3x3 + TensorShape(7U, 7U, 320U), + // inception_5a/relu_5x5_reduce + TensorShape(7U, 7U, 32U), + // inception_5a/relu_5x5, inception_5a/relu_pool_proj, inception_5b/relu_5x5, inception_5b/relu_pool_proj + TensorShape(7U, 7U, 128U), + // inception_5b/relu_1x1, inception_5b/relu_3x3 + TensorShape(7U, 7U, 384U), + // inception_5b/relu_3x3_reduce + TensorShape(7U, 7U, 192U), + // inception_5b/relu_5x5_reduce + TensorShape(7U, 7U, 48U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + GoogLeNetInceptionV1ActivationLayerDataset(GoogLeNetInceptionV1ActivationLayerDataset &&) = default; + ~GoogLeNetInceptionV1ActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ConvolutionLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ConvolutionLayerDataset.h new file mode 100644 index 0000000000..a4002d124d --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1ConvolutionLayerDataset.h @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1ConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + // GoogLeNetInceptionV1 inception v1 dataset + GoogLeNetInceptionV1ConvolutionLayerDataset() + { + // conv1/7x7_s2 + add_config(TensorShape(224U, 224U, 3U), TensorShape(7U, 7U, 3U, 64U), TensorShape(64U), TensorShape(112U, 112U, 64U), PadStrideInfo(2, 2, 3, 3)); + // conv2/3x3_reduce + add_config(TensorShape(56U, 56U, 64U), TensorShape(1U, 1U, 64U, 64U), TensorShape(64U), TensorShape(56U, 56U, 64U), PadStrideInfo(1, 1, 0, 0)); + // conv2/3x3 + add_config(TensorShape(56U, 56U, 64U), TensorShape(3U, 3U, 64U, 192U), TensorShape(192U), TensorShape(56U, 56U, 192U), PadStrideInfo(1, 1, 1, 1)); + // inception_3a/1x1 + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/3x3_reduce + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 96U), TensorShape(96U), TensorShape(28U, 28U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/3x3 + add_config(TensorShape(28U, 28U, 96U), TensorShape(3U, 3U, 96U, 128U), TensorShape(128U), TensorShape(28U, 28U, 128U), PadStrideInfo(1, 1, 1, 1)); + // inception_3a/5x5_reduce + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 16U), TensorShape(16U), TensorShape(28U, 28U, 16U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/5x5 + add_config(TensorShape(28U, 28U, 16U), TensorShape(5U, 5U, 16U, 32U), TensorShape(32U), TensorShape(28U, 28U, 32U), PadStrideInfo(1, 1, 2, 2)); + // inception_3a/pool_proj + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 32U), TensorShape(32U), TensorShape(28U, 28U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/1x1, inception_3b/3x3_reduce + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 128U), TensorShape(128U), TensorShape(28U, 28U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/3x3 + add_config(TensorShape(28U, 28U, 128U), TensorShape(3U, 3U, 128U, 192U), TensorShape(192U), TensorShape(28U, 28U, 192U), PadStrideInfo(1, 1, 1, 1)); + // inception_3b/5x5_reduce + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 32U), TensorShape(32U), TensorShape(28U, 28U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/5x5 + add_config(TensorShape(28U, 28U, 32U), TensorShape(5U, 5U, 32U, 96U), TensorShape(96U), TensorShape(28U, 28U, 96U), PadStrideInfo(1, 1, 2, 2)); + // inception_3b/pool_proj + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/1x1 + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 192U), TensorShape(192U), TensorShape(14U, 14U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/3x3_reduce + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 96U), TensorShape(96U), TensorShape(14U, 14U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/3x3 + add_config(TensorShape(14U, 14U, 96U), TensorShape(3U, 3U, 96U, 208U), TensorShape(208U), TensorShape(14U, 14U, 208U), PadStrideInfo(1, 1, 1, 1)); + // inception_4a/5x5_reduce + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 16U), TensorShape(16U), TensorShape(14U, 14U, 16U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/5x5 + add_config(TensorShape(14U, 14U, 16U), TensorShape(5U, 5U, 16U, 48U), TensorShape(48U), TensorShape(14U, 14U, 48U), PadStrideInfo(1, 1, 2, 2)); + // inception_4a/pool_proj + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/1x1 + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 160U), TensorShape(160U), TensorShape(14U, 14U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/3x3_reduce, inception_4d/1x1 + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 112U), TensorShape(112U), TensorShape(14U, 14U, 112U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/3x3 + add_config(TensorShape(14U, 14U, 112U), TensorShape(3U, 3U, 112U, 224U), TensorShape(224U), TensorShape(14U, 14U, 224U), PadStrideInfo(1, 1, 1, 1)); + // inception_4b/5x5_reduce, inception_4c/5x5_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 24U), TensorShape(24U), TensorShape(14U, 14U, 24U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/5x5, inception_4c/5x5 + add_config(TensorShape(14U, 14U, 24U), TensorShape(5U, 5U, 24U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 2, 2)); + // inception_4b/pool_proj, inception_4c/pool_proj, inception_4d/pool_proj + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4c/1x1, inception_4c/3x3_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 128U), TensorShape(128U), TensorShape(14U, 14U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_4c/3x3 + add_config(TensorShape(14U, 14U, 128U), TensorShape(3U, 3U, 128U, 256U), TensorShape(256U), TensorShape(14U, 14U, 256U), PadStrideInfo(1, 1, 1, 1)); + // inception_4d/3x3_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 144U), TensorShape(144U), TensorShape(14U, 14U, 144U), PadStrideInfo(1, 1, 0, 0)); + // inception_4d/3x3 + add_config(TensorShape(14U, 14U, 144U), TensorShape(3U, 3U, 144U, 288U), TensorShape(288U), TensorShape(14U, 14U, 288U), PadStrideInfo(1, 1, 1, 1)); + // inception_4d/5x5_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 32U), TensorShape(32U), TensorShape(14U, 14U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_4d/5x5 + add_config(TensorShape(14U, 14U, 32U), TensorShape(5U, 5U, 32U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 2, 2)); + // inception_4e/1x1 + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 256U), TensorShape(256U), TensorShape(14U, 14U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/3x3_reduce + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 160U), TensorShape(160U), TensorShape(14U, 14U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/3x3 + add_config(TensorShape(14U, 14U, 160U), TensorShape(3U, 3U, 160U, 320U), TensorShape(320U), TensorShape(14U, 14U, 320U), PadStrideInfo(1, 1, 1, 1)); + // inception_4e/5x5_reduce + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 32U), TensorShape(32U), TensorShape(14U, 14U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/5x5 + add_config(TensorShape(14U, 14U, 32U), TensorShape(5U, 5U, 32U, 128U), TensorShape(128U), TensorShape(14U, 14U, 128U), PadStrideInfo(1, 1, 2, 2)); + // inception_4e/pool_proj + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 128U), TensorShape(128U), TensorShape(14U, 14U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/1x1 + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 256U), TensorShape(256U), TensorShape(7U, 7U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/3x3_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 160U), TensorShape(160U), TensorShape(7U, 7U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/3x3 + add_config(TensorShape(7U, 7U, 160U), TensorShape(3U, 3U, 160U, 320U), TensorShape(320U), TensorShape(7U, 7U, 320U), PadStrideInfo(1, 1, 1, 1)); + // inception_5a/5x5_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 32U), TensorShape(32U), TensorShape(7U, 7U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/5x5 + add_config(TensorShape(7U, 7U, 32U), TensorShape(5U, 5U, 32U, 128U), TensorShape(128U), TensorShape(7U, 7U, 128U), PadStrideInfo(1, 1, 2, 2)); + // inception_5a/pool_proj, inception_5b/pool_proj + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 128U), TensorShape(128U), TensorShape(7U, 7U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/1x1 + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 384U), TensorShape(384U), TensorShape(7U, 7U, 384U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/3x3_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 192U), TensorShape(192U), TensorShape(7U, 7U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/3x3 + add_config(TensorShape(7U, 7U, 192U), TensorShape(3U, 3U, 192U, 384U), TensorShape(384U), TensorShape(7U, 7U, 384U), PadStrideInfo(1, 1, 1, 1)); + // inception_5b/5x5_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 48U), TensorShape(48U), TensorShape(7U, 7U, 48U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/5x5 + add_config(TensorShape(7U, 7U, 48U), TensorShape(5U, 5U, 48U, 128U), TensorShape(128U), TensorShape(7U, 7U, 128U), PadStrideInfo(1, 1, 2, 2)); + } +}; + +class GoogLeNetInceptionV1DirectConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + // subset of GoogLeNetInceptionV1 inception v1 dataset + GoogLeNetInceptionV1DirectConvolutionLayerDataset() + { + // conv2/3x3_reduce + add_config(TensorShape(56U, 56U, 64U), TensorShape(1U, 1U, 64U, 64U), TensorShape(64U), TensorShape(56U, 56U, 64U), PadStrideInfo(1, 1, 0, 0)); + // conv2/3x3 + add_config(TensorShape(56U, 56U, 64U), TensorShape(3U, 3U, 64U, 192U), TensorShape(192U), TensorShape(56U, 56U, 192U), PadStrideInfo(1, 1, 1, 1)); + // inception_3a/1x1 + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/3x3_reduce + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 96U), TensorShape(96U), TensorShape(28U, 28U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/3x3 + add_config(TensorShape(28U, 28U, 96U), TensorShape(3U, 3U, 96U, 128U), TensorShape(128U), TensorShape(28U, 28U, 128U), PadStrideInfo(1, 1, 1, 1)); + // inception_3a/5x5_reduce + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 16U), TensorShape(16U), TensorShape(28U, 28U, 16U), PadStrideInfo(1, 1, 0, 0)); + // inception_3a/pool_proj + add_config(TensorShape(28U, 28U, 192U), TensorShape(1U, 1U, 192U, 32U), TensorShape(32U), TensorShape(28U, 28U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/1x1, inception_3b/3x3_reduce + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 128U), TensorShape(128U), TensorShape(28U, 28U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/3x3 + add_config(TensorShape(28U, 28U, 128U), TensorShape(3U, 3U, 128U, 192U), TensorShape(192U), TensorShape(28U, 28U, 192U), PadStrideInfo(1, 1, 1, 1)); + // inception_3b/5x5_reduce + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 32U), TensorShape(32U), TensorShape(28U, 28U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_3b/pool_proj + add_config(TensorShape(28U, 28U, 256U), TensorShape(1U, 1U, 256U, 64U), TensorShape(64U), TensorShape(28U, 28U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/1x1 + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 192U), TensorShape(192U), TensorShape(14U, 14U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/3x3_reduce + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 96U), TensorShape(96U), TensorShape(14U, 14U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_4a/3x3 + add_config(TensorShape(14U, 14U, 96U), TensorShape(3U, 3U, 96U, 208U), TensorShape(208U), TensorShape(14U, 14U, 208U), PadStrideInfo(1, 1, 1, 1)); + // inception_4a/pool_proj + add_config(TensorShape(14U, 14U, 480U), TensorShape(1U, 1U, 480U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/1x1 + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 160U), TensorShape(160U), TensorShape(14U, 14U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/3x3_reduce, inception_4d/1x1 + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 112U), TensorShape(112U), TensorShape(14U, 14U, 112U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/3x3 + add_config(TensorShape(14U, 14U, 112U), TensorShape(3U, 3U, 112U, 224U), TensorShape(224U), TensorShape(14U, 14U, 224U), PadStrideInfo(1, 1, 1, 1)); + // inception_4b/5x5_reduce, inception_4c/5x5_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 24U), TensorShape(24U), TensorShape(14U, 14U, 24U), PadStrideInfo(1, 1, 0, 0)); + // inception_4b/pool_proj, inception_4c/pool_proj, inception_4d/pool_proj + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 64U), TensorShape(64U), TensorShape(14U, 14U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_4c/1x1, inception_4c/3x3_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 128U), TensorShape(128U), TensorShape(14U, 14U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_4c/3x3 + add_config(TensorShape(14U, 14U, 128U), TensorShape(3U, 3U, 128U, 256U), TensorShape(256U), TensorShape(14U, 14U, 256U), PadStrideInfo(1, 1, 1, 1)); + // inception_4d/3x3_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 144U), TensorShape(144U), TensorShape(14U, 14U, 144U), PadStrideInfo(1, 1, 0, 0)); + // inception_4d/3x3 + add_config(TensorShape(14U, 14U, 144U), TensorShape(3U, 3U, 144U, 288U), TensorShape(288U), TensorShape(14U, 14U, 288U), PadStrideInfo(1, 1, 1, 1)); + // inception_4d/5x5_reduce + add_config(TensorShape(14U, 14U, 512U), TensorShape(1U, 1U, 512U, 32U), TensorShape(32U), TensorShape(14U, 14U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/1x1 + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 256U), TensorShape(256U), TensorShape(14U, 14U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/3x3_reduce + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 160U), TensorShape(160U), TensorShape(14U, 14U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/3x3 + add_config(TensorShape(14U, 14U, 160U), TensorShape(3U, 3U, 160U, 320U), TensorShape(320U), TensorShape(14U, 14U, 320U), PadStrideInfo(1, 1, 1, 1)); + // inception_4e/5x5_reduce + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 32U), TensorShape(32U), TensorShape(14U, 14U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_4e/pool_proj + add_config(TensorShape(14U, 14U, 528U), TensorShape(1U, 1U, 528U, 128U), TensorShape(128U), TensorShape(14U, 14U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/1x1 + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 256U), TensorShape(256U), TensorShape(7U, 7U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/3x3_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 160U), TensorShape(160U), TensorShape(7U, 7U, 160U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/3x3 + add_config(TensorShape(7U, 7U, 160U), TensorShape(3U, 3U, 160U, 320U), TensorShape(320U), TensorShape(7U, 7U, 320U), PadStrideInfo(1, 1, 1, 1)); + // inception_5a/5x5_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 32U), TensorShape(32U), TensorShape(7U, 7U, 32U), PadStrideInfo(1, 1, 0, 0)); + // inception_5a/pool_proj, inception_5b/pool_proj + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 128U), TensorShape(128U), TensorShape(7U, 7U, 128U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/1x1 + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 384U), TensorShape(384U), TensorShape(7U, 7U, 384U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/3x3_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 192U), TensorShape(192U), TensorShape(7U, 7U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_5b/3x3 + add_config(TensorShape(7U, 7U, 192U), TensorShape(3U, 3U, 192U, 384U), TensorShape(384U), TensorShape(7U, 7U, 384U), PadStrideInfo(1, 1, 1, 1)); + // inception_5b/5x5_reduce + add_config(TensorShape(7U, 7U, 832U), TensorShape(1U, 1U, 832U, 48U), TensorShape(48U), TensorShape(7U, 7U, 48U), PadStrideInfo(1, 1, 0, 0)); + } +}; + +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1FullyConnectedLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1FullyConnectedLayerDataset.h new file mode 100644 index 0000000000..80a3473bc7 --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1FullyConnectedLayerDataset.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_FULLYCONNECTED_LAYER_DATASET + +#include "tests/datasets/FullyConnectedLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1FullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + GoogLeNetInceptionV1FullyConnectedLayerDataset() + { + add_config(TensorShape(1024U), TensorShape(1024U, 1000U), TensorShape(1000U), TensorShape(1000U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1GEMMDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1GEMMDataset.h new file mode 100644 index 0000000000..806ca9378a --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1GEMMDataset.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_GEMM_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_GEMM_DATASET + +#include "tests/datasets/GEMMDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1GEMMDataset final : public GEMMDataset +{ +public: + GoogLeNetInceptionV1GEMMDataset() + { + add_config(TensorShape(147U, 12544U), TensorShape(64U, 147U), TensorShape(64U, 12544U), TensorShape(64U, 12544U), 1.0f, 0.0f); + add_config(TensorShape(64U, 3136U), TensorShape(64U, 64U), TensorShape(64U, 3136U), TensorShape(64U, 3136U), 1.0f, 0.0f); + add_config(TensorShape(576U, 3136U), TensorShape(192U, 576U), TensorShape(192U, 3136U), TensorShape(192U, 3136U), 1.0f, 0.0f); + add_config(TensorShape(192U, 784U), TensorShape(64U, 192U), TensorShape(64U, 784U), TensorShape(64U, 784U), 1.0f, 0.0f); + add_config(TensorShape(192U, 784U), TensorShape(96U, 192U), TensorShape(96U, 784U), TensorShape(96U, 784U), 1.0f, 0.0f); + add_config(TensorShape(864U, 784U), TensorShape(128U, 864U), TensorShape(128U, 784U), TensorShape(128U, 784U), 1.0f, 0.0f); + add_config(TensorShape(192U, 784U), TensorShape(16U, 192U), TensorShape(16U, 784U), TensorShape(16U, 784U), 1.0f, 0.0f); + add_config(TensorShape(400U, 784U), TensorShape(32U, 400U), TensorShape(32U, 784U), TensorShape(32U, 784U), 1.0f, 0.0f); + add_config(TensorShape(192U, 784U), TensorShape(32U, 192U), TensorShape(32U, 784U), TensorShape(32U, 784U), 1.0f, 0.0f); + add_config(TensorShape(256U, 784U), TensorShape(128U, 256U), TensorShape(128U, 784U), TensorShape(128U, 784U), 1.0f, 0.0f); + add_config(TensorShape(256U, 784U), TensorShape(128U, 256U), TensorShape(128U, 784U), TensorShape(128U, 784U), 1.0f, 0.0f); + add_config(TensorShape(1152U, 784U), TensorShape(192U, 1152U), TensorShape(192U, 784U), TensorShape(192U, 784U), 1.0f, 0.0f); + add_config(TensorShape(256U, 784U), TensorShape(32U, 256U), TensorShape(32U, 784U), TensorShape(32U, 784U), 1.0f, 0.0f); + add_config(TensorShape(800U, 784U), TensorShape(96U, 800U), TensorShape(96U, 784U), TensorShape(96U, 784U), 1.0f, 0.0f); + add_config(TensorShape(256U, 784U), TensorShape(64U, 256U), TensorShape(64U, 784U), TensorShape(64U, 784U), 1.0f, 0.0f); + add_config(TensorShape(480U, 196U), TensorShape(192U, 480U), TensorShape(192U, 196U), TensorShape(192U, 196U), 1.0f, 0.0f); + add_config(TensorShape(480U, 196U), TensorShape(96U, 480U), TensorShape(96U, 196U), TensorShape(96U, 196U), 1.0f, 0.0f); + add_config(TensorShape(864U, 196U), TensorShape(204U, 864U), TensorShape(204U, 196U), TensorShape(204U, 196U), 1.0f, 0.0f); + add_config(TensorShape(480U, 196U), TensorShape(16U, 480U), TensorShape(16U, 196U), TensorShape(16U, 196U), 1.0f, 0.0f); + add_config(TensorShape(400U, 196U), TensorShape(48U, 400U), TensorShape(48U, 196U), TensorShape(48U, 196U), 1.0f, 0.0f); + add_config(TensorShape(480U, 196U), TensorShape(64U, 480U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(508U, 196U), TensorShape(160U, 508U), TensorShape(160U, 196U), TensorShape(160U, 196U), 1.0f, 0.0f); + add_config(TensorShape(508U, 196U), TensorShape(112U, 508U), TensorShape(112U, 196U), TensorShape(112U, 196U), 1.0f, 0.0f); + add_config(TensorShape(1008U, 196U), TensorShape(224U, 1008U), TensorShape(224U, 196U), TensorShape(224U, 196U), 1.0f, 0.0f); + add_config(TensorShape(508U, 196U), TensorShape(24U, 508U), TensorShape(24U, 196U), TensorShape(24U, 196U), 1.0f, 0.0f); + add_config(TensorShape(600U, 196U), TensorShape(64U, 600U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(508U, 196U), TensorShape(64U, 508U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(128U, 512U), TensorShape(128U, 196U), TensorShape(128U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(128U, 512U), TensorShape(128U, 196U), TensorShape(128U, 196U), 1.0f, 0.0f); + add_config(TensorShape(1152U, 196U), TensorShape(256U, 1152U), TensorShape(256U, 196U), TensorShape(256U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(24U, 512U), TensorShape(24U, 196U), TensorShape(24U, 196U), 1.0f, 0.0f); + add_config(TensorShape(600U, 196U), TensorShape(64U, 600U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(64U, 512U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(112U, 512U), TensorShape(112U, 196U), TensorShape(112U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(144U, 512U), TensorShape(144U, 196U), TensorShape(144U, 196U), 1.0f, 0.0f); + add_config(TensorShape(1296U, 196U), TensorShape(288U, 1296U), TensorShape(288U, 196U), TensorShape(288U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(32U, 512U), TensorShape(32U, 196U), TensorShape(32U, 196U), 1.0f, 0.0f); + add_config(TensorShape(800U, 196U), TensorShape(64U, 800U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(512U, 196U), TensorShape(64U, 512U), TensorShape(64U, 196U), TensorShape(64U, 196U), 1.0f, 0.0f); + add_config(TensorShape(528U, 196U), TensorShape(256U, 528U), TensorShape(256U, 196U), TensorShape(256U, 196U), 1.0f, 0.0f); + add_config(TensorShape(528U, 196U), TensorShape(160U, 528U), TensorShape(160U, 196U), TensorShape(160U, 196U), 1.0f, 0.0f); + add_config(TensorShape(1440U, 196U), TensorShape(320U, 1440U), TensorShape(320U, 196U), TensorShape(320U, 196U), 1.0f, 0.0f); + add_config(TensorShape(528U, 196U), TensorShape(32U, 528U), TensorShape(32U, 196U), TensorShape(32U, 196U), 1.0f, 0.0f); + add_config(TensorShape(800U, 196U), TensorShape(128U, 800U), TensorShape(128U, 196U), TensorShape(128U, 196U), 1.0f, 0.0f); + add_config(TensorShape(528U, 196U), TensorShape(128U, 528U), TensorShape(128U, 196U), TensorShape(128U, 196U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(256U, 832U), TensorShape(256U, 49U), TensorShape(256U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(160U, 832U), TensorShape(160U, 49U), TensorShape(160U, 49U), 1.0f, 0.0f); + add_config(TensorShape(1440U, 49U), TensorShape(320U, 1440U), TensorShape(320U, 49U), TensorShape(320U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(48U, 832U), TensorShape(48U, 49U), TensorShape(48U, 49U), 1.0f, 0.0f); + add_config(TensorShape(1200U, 49U), TensorShape(128U, 1200U), TensorShape(128U, 49U), TensorShape(128U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(128U, 832U), TensorShape(128U, 49U), TensorShape(128U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(384U, 832U), TensorShape(384U, 49U), TensorShape(384U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(192U, 832U), TensorShape(192U, 49U), TensorShape(192U, 49U), 1.0f, 0.0f); + add_config(TensorShape(1728U, 49U), TensorShape(384U, 1728U), TensorShape(384U, 49U), TensorShape(384U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(48U, 832U), TensorShape(48U, 49U), TensorShape(48U, 49U), 1.0f, 0.0f); + add_config(TensorShape(1200U, 49U), TensorShape(128U, 1200U), TensorShape(128U, 49U), TensorShape(128U, 49U), 1.0f, 0.0f); + add_config(TensorShape(832U, 49U), TensorShape(128U, 832U), TensorShape(128U, 49U), TensorShape(128U, 49U), 1.0f, 0.0f); + add_config(TensorShape(508U, 16U), TensorShape(128U, 508U), TensorShape(128U, 16U), TensorShape(128U, 16U), 1.0f, 0.0f); + add_config(TensorShape(2048U, 1U), TensorShape(1024U, 2048U), TensorShape(1024U, 1U), TensorShape(1024U, 1U), 1.0f, 0.0f); + add_config(TensorShape(1024U, 1U), TensorShape(1008U, 1024U), TensorShape(1008U, 1U), TensorShape(1008U, 1U), 1.0f, 0.0f); + add_config(TensorShape(528U, 16U), TensorShape(128U, 528U), TensorShape(128U, 16U), TensorShape(128U, 16U), 1.0f, 0.0f); + add_config(TensorShape(2048U, 1U), TensorShape(1024U, 2048U), TensorShape(1024U, 1U), TensorShape(1024U, 1U), 1.0f, 0.0f); + add_config(TensorShape(1024U, 1U), TensorShape(1008U, 1024U), TensorShape(1008U, 1U), TensorShape(1008U, 1U), 1.0f, 0.0f); + add_config(TensorShape(1024U, 1U), TensorShape(1008U, 1024U), TensorShape(1008U, 1U), TensorShape(1008U, 1U), 1.0f, 0.0f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_GEMM_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1NormalizationLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1NormalizationLayerDataset.h new file mode 100644 index 0000000000..d8fd061b66 --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1NormalizationLayerDataset.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_NORMALIZATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_NORMALIZATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1NormalizationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<NormalizationLayerInfo>> +{ +public: + GoogLeNetInceptionV1NormalizationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // conv2/norm2 + TensorShape(56U, 56U, 192U), + // pool1/norm1 + TensorShape(56U, 56U, 64U) }), + framework::dataset::make("Info", NormalizationLayerInfo(NormType::CROSS_MAP, 5, 0.0001f, 0.75f)) + } + { + } + GoogLeNetInceptionV1NormalizationLayerDataset(GoogLeNetInceptionV1NormalizationLayerDataset &&) = default; + ~GoogLeNetInceptionV1NormalizationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_NORMALIZATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1PoolingLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1PoolingLayerDataset.h new file mode 100644 index 0000000000..6164bbacea --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv1/GoogLeNetInceptionV1PoolingLayerDataset.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV1PoolingLayerDataset final : public PoolingLayerDataset +{ +public: + GoogLeNetInceptionV1PoolingLayerDataset() + { + // FIXME: Add support for 7x7 pooling layer pool5/7x7_s1 + // pool1/3x3_s2 + add_config(TensorShape(112U, 112U, 64U), TensorShape(56U, 56U, 64U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool2/3x3_s2 + add_config(TensorShape(56U, 56U, 192U), TensorShape(28U, 28U, 192U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_3a/pool + add_config(TensorShape(28U, 28U, 192U), TensorShape(28U, 28U, 192U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // inception_3b/pool + add_config(TensorShape(28U, 28U, 256U), TensorShape(28U, 28U, 256U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // pool3/3x3_s2 + add_config(TensorShape(28U, 28U, 480U), TensorShape(14U, 14U, 480U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_4a/pool + add_config(TensorShape(14U, 14U, 480U), TensorShape(14U, 14U, 480U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // inception_4b/pool, inception_4c/pool, inception_4d/pool + add_config(TensorShape(14U, 14U, 512U), TensorShape(14U, 14U, 512U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // inception_4e/pool + add_config(TensorShape(14U, 14U, 528U), TensorShape(14U, 14U, 528U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // pool4/3x3_s2 + add_config(TensorShape(14U, 14U, 832U), TensorShape(7U, 7U, 832U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_5a/pool, inception_5b/pool + add_config(TensorShape(7U, 7U, 832U), TensorShape(7U, 7U, 832U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV1_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ActivationLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ActivationLayerDataset.h new file mode 100644 index 0000000000..2d586390ec --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ActivationLayerDataset.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV4ActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + GoogLeNetInceptionV4ActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // conv1_3x3_s2_relu + TensorShape(149U, 149U, 32U), + // conv2_3x3_s1_relu + TensorShape(147U, 147U, 32U), + // conv3_3x3_s1_relu + TensorShape(147U, 147U, 64U), + // inception_stem1_3x3_s2_relu + TensorShape(73U, 73U, 96U), + // inception_stem2_3x3_reduce_relu, inception_stem2_1x7_reduce_relu, inception_stem2_1x7_relu, inception_stem2_7x1_relu + TensorShape(73U, 73U, 64U), + // inception_stem2_3x3_relu, inception_stem2_3x3_2_relu + TensorShape(71U, 71U, 96U), + // inception_stem3_3x3_s2_relu, reduction_a_3x3_2_reduce_relu + TensorShape(35U, 35U, 192U), + // inception_a1_1x1_2_relu, inception_a1_3x3_relu, inception_a1_3x3_2_relu, inception_a1_3x3_3_relu, inception_a1_1x1_relu, inception_a2_1x1_2_relu, inception_a2_3x3_relu, inception_a2_3x3_2_relu, inception_a2_3x3_3_relu, inception_a2_1x1_relu, inception_a3_1x1_2_relu, inception_a3_3x3_relu, inception_a3_3x3_2_relu, inception_a3_3x3_3_relu, inception_a3_1x1_relu, inception_a4_1x1_2_relu, inception_a4_3x3_relu, inception_a4_3x3_2_relu, inception_a4_3x3_3_relu, inception_a4_1x1_relu + TensorShape(35U, 35U, 96U), + // inception_a1_3x3_reduce_relu, inception_a1_3x3_2_reduce_relu, inception_a2_3x3_reduce_relu, inception_a2_3x3_2_reduce_relu, inception_a3_3x3_reduce_relu, inception_a3_3x3_2_reduce_relu, inception_a4_3x3_reduce_relu, inception_a4_3x3_2_reduce_relu + TensorShape(35U, 35U, 64U), + // reduction_a_3x3_relu, inception_b1_1x1_2_relu, inception_b2_1x1_2_relu, inception_b3_1x1_2_relu, inception_b4_1x1_2_relu, inception_b5_1x1_2_relu, inception_b6_1x1_2_relu, inception_b7_1x1_2_relu + TensorShape(17U, 17U, 384U), + // reduction_a_3x3_2_relu + TensorShape(35U, 35U, 224U), + // reduction_a_3x3_3_relu, inception_b1_7x1_relu, inception_b1_1x7_3_relu, inception_b2_7x1_relu, inception_b2_1x7_3_relu, inception_b3_7x1_relu, inception_b3_1x7_3_relu, inception_b4_7x1_relu, inception_b4_1x7_3_relu, inception_b5_7x1_relu, inception_b5_1x7_3_relu, inception_b6_7x1_relu, inception_b6_1x7_3_relu, inception_b7_7x1_relu, inception_b7_1x7_3_relu, reduction_b_1x7_reduce_relu, reduction_b_1x7_relu + TensorShape(17U, 17U, 256U), + // inception_b1_1x7_reduce_relu, inception_b1_7x1_2_reduce_relu, inception_b1_7x1_2_relu, inception_b2_1x7_reduce_relu, inception_b2_7x1_2_reduce_relu, inception_b2_7x1_2_relu, inception_b3_1x7_reduce_relu, inception_b3_7x1_2_reduce_relu, inception_b3_7x1_2_relu, inception_b4_1x7_reduce_relu, inception_b4_7x1_2_reduce_relu, inception_b4_7x1_2_relu, inception_b5_1x7_reduce_relu, inception_b5_7x1_2_reduce_relu, inception_b5_7x1_2_relu, inception_b6_1x7_reduce_relu, inception_b6_7x1_2_reduce_relu, inception_b6_7x1_2_relu, inception_b7_1x7_reduce_relu, inception_b7_7x1_2_reduce_relu, inception_b7_7x1_2_relu, reduction_b_3x3_reduce_relu + TensorShape(17U, 17U, 192U), + // inception_b1_1x7_relu, inception_b1_1x7_2_relu, inception_b1_7x1_3_relu, inception_b2_1x7_relu, inception_b2_1x7_2_relu, inception_b2_7x1_3_relu, inception_b3_1x7_relu, inception_b3_1x7_2_relu, inception_b3_7x1_3_relu, inception_b4_1x7_relu, inception_b4_1x7_2_relu, inception_b4_7x1_3_relu, inception_b5_1x7_relu, inception_b5_1x7_2_relu, inception_b5_7x1_3_relu, inception_b6_1x7_relu, inception_b6_1x7_2_relu, inception_b6_7x1_3_relu, inception_b7_1x7_relu, inception_b7_1x7_2_relu, inception_b7_7x1_3_relu + TensorShape(17U, 17U, 224U), + // inception_b1_1x1_relu, inception_b2_1x1_relu, inception_b3_1x1_relu, inception_b4_1x1_relu, inception_b5_1x1_relu, inception_b6_1x1_relu, inception_b7_1x1_relu + TensorShape(17U, 17U, 128U), + // reduction_b_3x3_relu + TensorShape(8U, 8U, 192U), + // reduction_b_7x1_relu + TensorShape(17U, 17U, 320U), + // reduction_b_3x3_2_relu + TensorShape(8U, 8U, 320U), + // inception_c1_1x1_2_relu, inception_c1_1x3_relu, inception_c1_3x1_relu, inception_c1_1x3_3_relu, inception_c1_3x1_3_relu, inception_c1_1x1_relu, inception_c2_1x1_2_relu, inception_c2_1x3_relu, inception_c2_3x1_relu, inception_c2_1x3_3_relu, inception_c2_3x1_3_relu, inception_c2_1x1_relu, inception_c3_1x1_2_relu, inception_c3_1x3_relu, inception_c3_3x1_relu, inception_c3_1x3_3_relu, inception_c3_3x1_3_relu, inception_c3_1x1_relu + TensorShape(8U, 8U, 256U), + // inception_c1_1x1_3_relu, inception_c1_1x1_4_relu, inception_c2_1x1_3_relu, inception_c2_1x1_4_relu, inception_c3_1x1_3_relu, inception_c3_1x1_4_relu + TensorShape(8U, 8U, 384U), + // inception_c1_3x1_2_relu, inception_c2_3x1_2_relu, inception_c3_3x1_2_relu + TensorShape(8U, 8U, 448U), + // inception_c1_1x3_2_relu, inception_c2_1x3_2_relu, inception_c3_1x3_2_relu + TensorShape(8U, 8U, 512U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + GoogLeNetInceptionV4ActivationLayerDataset(GoogLeNetInceptionV4ActivationLayerDataset &&) = default; + ~GoogLeNetInceptionV4ActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4BatchNormalizationLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4BatchNormalizationLayerDataset.h new file mode 100644 index 0000000000..d96410f9eb --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4BatchNormalizationLayerDataset.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_BATCHNORMALIZATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_BATCHNORMALIZATION_LAYER_DATASET + +#include "tests/datasets/BatchNormalizationLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV4BatchNormalizationLayerDataset final : public BatchNormalizationLayerDataset +{ +public: + GoogLeNetInceptionV4BatchNormalizationLayerDataset() + { + // conv1_3x3_s2_bn + add_config(TensorShape(149U, 149U, 32U), TensorShape(32U), 0.000010f); + // conv2_3x3_s1_bn + add_config(TensorShape(147U, 147U, 32U), TensorShape(32U), 0.000010f); + // conv3_3x3_s1_bn + add_config(TensorShape(147U, 147U, 64U), TensorShape(64U), 0.000010f); + // inception_stem1_3x3_s2_bn + add_config(TensorShape(73U, 73U, 96U), TensorShape(96U), 0.000010f); + // inception_stem2_3x3_reduce_bn, inception_stem2_1x7_reduce_bn, inception_stem2_1x7_bn, inception_stem2_7x1_bn + add_config(TensorShape(73U, 73U, 64U), TensorShape(64U), 0.000010f); + // inception_stem2_3x3_bn, inception_stem2_3x3_2_bn + add_config(TensorShape(71U, 71U, 96U), TensorShape(96U), 0.000010f); + // inception_stem3_3x3_s2_bn, reduction_a_3x3_2_reduce_bn + add_config(TensorShape(35U, 35U, 192U), TensorShape(192U), 0.000010f); + // inception_a1_1x1_2_bn, inception_a1_3x3_bn, inception_a1_3x3_2_bn, inception_a1_3x3_3_bn, inception_a1_1x1_bn, inception_a2_1x1_2_bn, inception_a2_3x3_bn, inception_a2_3x3_2_bn, inception_a2_3x3_3_bn, inception_a2_1x1_bn, inception_a3_1x1_2_bn, inception_a3_3x3_bn, inception_a3_3x3_2_bn, inception_a3_3x3_3_bn, inception_a3_1x1_bn, inception_a4_1x1_2_bn, inception_a4_3x3_bn, inception_a4_3x3_2_bn, inception_a4_3x3_3_bn, inception_a4_1x1_bn + add_config(TensorShape(35U, 35U, 96U), TensorShape(96U), 0.000010f); + // inception_a1_3x3_reduce_bn, inception_a1_3x3_2_reduce_bn, inception_a2_3x3_reduce_bn, inception_a2_3x3_2_reduce_bn, inception_a3_3x3_reduce_bn, inception_a3_3x3_2_reduce_bn, inception_a4_3x3_reduce_bn, inception_a4_3x3_2_reduce_bn + add_config(TensorShape(35U, 35U, 64U), TensorShape(64U), 0.000010f); + // reduction_a_3x3_bn, inception_b1_1x1_2_bn, inception_b2_1x1_2_bn, inception_b3_1x1_2_bn, inception_b4_1x1_2_bn, inception_b5_1x1_2_bn, inception_b6_1x1_2_bn, inception_b7_1x1_2_bn + add_config(TensorShape(17U, 17U, 384U), TensorShape(384U), 0.000010f); + // reduction_a_3x3_2_bn + add_config(TensorShape(35U, 35U, 224U), TensorShape(224U), 0.000010f); + // reduction_a_3x3_3_bn, inception_b1_7x1_bn, inception_b1_1x7_3_bn, inception_b2_7x1_bn, inception_b2_1x7_3_bn, inception_b3_7x1_bn, inception_b3_1x7_3_bn, inception_b4_7x1_bn, inception_b4_1x7_3_bn, inception_b5_7x1_bn, inception_b5_1x7_3_bn, inception_b6_7x1_bn, inception_b6_1x7_3_bn, inception_b7_7x1_bn, inception_b7_1x7_3_bn, reduction_b_1x7_reduce_bn, reduction_b_1x7_bn + add_config(TensorShape(17U, 17U, 256U), TensorShape(256U), 0.000010f); + // inception_b1_1x7_reduce_bn, inception_b1_7x1_2_reduce_bn, inception_b1_7x1_2_bn, inception_b2_1x7_reduce_bn, inception_b2_7x1_2_reduce_bn, inception_b2_7x1_2_bn, inception_b3_1x7_reduce_bn, inception_b3_7x1_2_reduce_bn, inception_b3_7x1_2_bn, inception_b4_1x7_reduce_bn, inception_b4_7x1_2_reduce_bn, inception_b4_7x1_2_bn, inception_b5_1x7_reduce_bn, inception_b5_7x1_2_reduce_bn, inception_b5_7x1_2_bn, inception_b6_1x7_reduce_bn, inception_b6_7x1_2_reduce_bn, inception_b6_7x1_2_bn, inception_b7_1x7_reduce_bn, inception_b7_7x1_2_reduce_bn, inception_b7_7x1_2_bn, reduction_b_3x3_reduce_bn + add_config(TensorShape(17U, 17U, 192U), TensorShape(192U), 0.000010f); + // inception_b1_1x7_bn, inception_b1_1x7_2_bn, inception_b1_7x1_3_bn, inception_b2_1x7_bn, inception_b2_1x7_2_bn, inception_b2_7x1_3_bn, inception_b3_1x7_bn, inception_b3_1x7_2_bn, inception_b3_7x1_3_bn, inception_b4_1x7_bn, inception_b4_1x7_2_bn, inception_b4_7x1_3_bn, inception_b5_1x7_bn, inception_b5_1x7_2_bn, inception_b5_7x1_3_bn, inception_b6_1x7_bn, inception_b6_1x7_2_bn, inception_b6_7x1_3_bn, inception_b7_1x7_bn, inception_b7_1x7_2_bn, inception_b7_7x1_3_bn + add_config(TensorShape(17U, 17U, 224U), TensorShape(224U), 0.000010f); + // inception_b1_1x1_bn, inception_b2_1x1_bn, inception_b3_1x1_bn, inception_b4_1x1_bn, inception_b5_1x1_bn, inception_b6_1x1_bn, inception_b7_1x1_bn + add_config(TensorShape(17U, 17U, 128U), TensorShape(128U), 0.000010f); + // reduction_b_3x3_bn + add_config(TensorShape(8U, 8U, 192U), TensorShape(192U), 0.000010f); + // reduction_b_7x1_bn + add_config(TensorShape(17U, 17U, 320U), TensorShape(320U), 0.000010f); + // reduction_b_3x3_2_bn + add_config(TensorShape(8U, 8U, 320U), TensorShape(320U), 0.000010f); + // inception_c1_1x1_2_bn, inception_c1_1x3_bn, inception_c1_3x1_bn, inception_c1_1x3_3_bn, inception_c1_3x1_3_bn, inception_c1_1x1_bn, inception_c2_1x1_2_bn, inception_c2_1x3_bn, inception_c2_3x1_bn, inception_c2_1x3_3_bn, inception_c2_3x1_3_bn, inception_c2_1x1_bn, inception_c3_1x1_2_bn, inception_c3_1x3_bn, inception_c3_3x1_bn, inception_c3_1x3_3_bn, inception_c3_3x1_3_bn, inception_c3_1x1_bn + add_config(TensorShape(8U, 8U, 256U), TensorShape(256U), 0.000010f); + // inception_c1_1x1_3_bn, inception_c1_1x1_4_bn, inception_c2_1x1_3_bn, inception_c2_1x1_4_bn, inception_c3_1x1_3_bn, inception_c3_1x1_4_bn + add_config(TensorShape(8U, 8U, 384U), TensorShape(384U), 0.000010f); + // inception_c1_3x1_2_bn, inception_c2_3x1_2_bn, inception_c3_3x1_2_bn + add_config(TensorShape(8U, 8U, 448U), TensorShape(448U), 0.000010f); + // inception_c1_1x3_2_bn, inception_c2_1x3_2_bn, inception_c3_1x3_2_bn + add_config(TensorShape(8U, 8U, 512U), TensorShape(512U), 0.000010f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_BATCHNORMALIZATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ConvolutionLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ConvolutionLayerDataset.h new file mode 100644 index 0000000000..a050d3da74 --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4ConvolutionLayerDataset.h @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV4ConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + // GoogLeNetInceptionV4 inception v1 dataset + GoogLeNetInceptionV4ConvolutionLayerDataset() + { + // conv1_3x3_s2 + add_config(TensorShape(299U, 299U, 3U), TensorShape(3U, 3U, 3U, 32U), TensorShape(32U), TensorShape(149U, 149U, 32U), PadStrideInfo(2, 2, 0, 0)); + // conv2_3x3_s1 + add_config(TensorShape(149U, 149U, 32U), TensorShape(3U, 3U, 32U, 32U), TensorShape(32U), TensorShape(147U, 147U, 32U), PadStrideInfo(1, 1, 0, 0)); + // conv3_3x3_s1 + add_config(TensorShape(147U, 147U, 32U), TensorShape(3U, 3U, 32U, 64U), TensorShape(64U), TensorShape(147U, 147U, 64U), PadStrideInfo(1, 1, 1, 1)); + // inception_stem1_3x3_s2 + add_config(TensorShape(147U, 147U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(73U, 73U, 96U), PadStrideInfo(2, 2, 0, 0)); + // inception_stem2_3x3_reduce, inception_stem2_1x7_reduce + add_config(TensorShape(73U, 73U, 160U), TensorShape(1U, 1U, 160U, 64U), TensorShape(64U), TensorShape(73U, 73U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_stem2_3x3, inception_stem2_3x3_2 + add_config(TensorShape(73U, 73U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(71U, 71U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_stem2_1x7 + add_config(TensorShape(73U, 73U, 64U), TensorShape(7U, 1U, 64U, 64U), TensorShape(64U), TensorShape(73U, 73U, 64U), PadStrideInfo(1, 1, 3, 0)); + // inception_stem2_7x1 + add_config(TensorShape(73U, 73U, 64U), TensorShape(1U, 7U, 64U, 64U), TensorShape(64U), TensorShape(73U, 73U, 64U), PadStrideInfo(1, 1, 0, 3)); + // inception_stem3_3x3_s2 + add_config(TensorShape(71U, 71U, 192U), TensorShape(3U, 3U, 192U, 192U), TensorShape(192U), TensorShape(35U, 35U, 192U), PadStrideInfo(2, 2, 0, 0)); + // inception_a1_1x1_2, inception_a1_1x1, inception_a2_1x1_2, inception_a2_1x1, inception_a3_1x1_2, inception_a3_1x1, inception_a4_1x1_2, inception_a4_1x1 + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_a1_3x3_reduce, inception_a1_3x3_2_reduce, inception_a2_3x3_reduce, inception_a2_3x3_2_reduce, inception_a3_3x3_reduce, inception_a3_3x3_2_reduce, inception_a4_3x3_reduce, inception_a4_3x3_2_reduce + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 64U), TensorShape(64U), TensorShape(35U, 35U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_a1_3x3, inception_a1_3x3_2, inception_a2_3x3, inception_a2_3x3_2, inception_a3_3x3, inception_a3_3x3_2, inception_a4_3x3, inception_a4_3x3_2 + add_config(TensorShape(35U, 35U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 1, 1)); + // inception_a1_3x3_3, inception_a2_3x3_3, inception_a3_3x3_3, inception_a4_3x3_3 + add_config(TensorShape(35U, 35U, 96U), TensorShape(3U, 3U, 96U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 1, 1)); + // reduction_a_3x3 + add_config(TensorShape(35U, 35U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(17U, 17U, 384U), PadStrideInfo(2, 2, 0, 0)); + // reduction_a_3x3_2_reduce + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 192U), TensorShape(192U), TensorShape(35U, 35U, 192U), PadStrideInfo(1, 1, 0, 0)); + // reduction_a_3x3_2 + add_config(TensorShape(35U, 35U, 192U), TensorShape(3U, 3U, 192U, 224U), TensorShape(224U), TensorShape(35U, 35U, 224U), PadStrideInfo(1, 1, 1, 1)); + // reduction_a_3x3_3 + add_config(TensorShape(35U, 35U, 224U), TensorShape(3U, 3U, 224U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(2, 2, 0, 0)); + // inception_b1_1x1_2, inception_b2_1x1_2, inception_b3_1x1_2, inception_b4_1x1_2, inception_b5_1x1_2, inception_b6_1x1_2, inception_b7_1x1_2 + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 384U), TensorShape(384U), TensorShape(17U, 17U, 384U), PadStrideInfo(1, 1, 0, 0)); + // inception_b1_1x7_reduce, inception_b1_7x1_2_reduce, inception_b2_1x7_reduce, inception_b2_7x1_2_reduce, inception_b3_1x7_reduce, inception_b3_7x1_2_reduce, inception_b4_1x7_reduce, inception_b4_7x1_2_reduce, inception_b5_1x7_reduce, inception_b5_7x1_2_reduce, inception_b6_1x7_reduce, inception_b6_7x1_2_reduce, inception_b7_1x7_reduce, inception_b7_7x1_2_reduce, reduction_b_3x3_reduce + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 192U), TensorShape(192U), TensorShape(17U, 17U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_b1_1x7, inception_b1_1x7_2, inception_b2_1x7, inception_b2_1x7_2, inception_b3_1x7, inception_b3_1x7_2, inception_b4_1x7, inception_b4_1x7_2, inception_b5_1x7, inception_b5_1x7_2, inception_b6_1x7, inception_b6_1x7_2, inception_b7_1x7, inception_b7_1x7_2 + add_config(TensorShape(17U, 17U, 192U), TensorShape(7U, 1U, 192U, 224U), TensorShape(224U), TensorShape(17U, 17U, 224U), PadStrideInfo(1, 1, 3, 0)); + // inception_b1_7x1, inception_b2_7x1, inception_b3_7x1, inception_b4_7x1, inception_b5_7x1, inception_b6_7x1, inception_b7_7x1 + add_config(TensorShape(17U, 17U, 224U), TensorShape(1U, 7U, 224U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(1, 1, 0, 3)); + // inception_b1_7x1_2, inception_b2_7x1_2, inception_b3_7x1_2, inception_b4_7x1_2, inception_b5_7x1_2, inception_b6_7x1_2, inception_b7_7x1_2 + add_config(TensorShape(17U, 17U, 192U), TensorShape(1U, 7U, 192U, 192U), TensorShape(192U), TensorShape(17U, 17U, 192U), PadStrideInfo(1, 1, 0, 3)); + // inception_b1_7x1_3, inception_b2_7x1_3, inception_b3_7x1_3, inception_b4_7x1_3, inception_b5_7x1_3, inception_b6_7x1_3, inception_b7_7x1_3 + add_config(TensorShape(17U, 17U, 224U), TensorShape(1U, 7U, 224U, 224U), TensorShape(224U), TensorShape(17U, 17U, 224U), PadStrideInfo(1, 1, 0, 3)); + // inception_b1_1x7_3, inception_b2_1x7_3, inception_b3_1x7_3, inception_b4_1x7_3, inception_b5_1x7_3, inception_b6_1x7_3, inception_b7_1x7_3 + add_config(TensorShape(17U, 17U, 224U), TensorShape(7U, 1U, 224U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(1, 1, 3, 0)); + // inception_b1_1x1, inception_b2_1x1, inception_b3_1x1, inception_b4_1x1, inception_b5_1x1, inception_b6_1x1, inception_b7_1x1 + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 128U), TensorShape(128U), TensorShape(17U, 17U, 128U), PadStrideInfo(1, 1, 0, 0)); + // reduction_b_3x3 + add_config(TensorShape(17U, 17U, 192U), TensorShape(3U, 3U, 192U, 192U), TensorShape(192U), TensorShape(8U, 8U, 192U), PadStrideInfo(2, 2, 0, 0)); + // reduction_b_1x7_reduce + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(1, 1, 0, 0)); + // reduction_b_1x7 + add_config(TensorShape(17U, 17U, 256U), TensorShape(7U, 1U, 256U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(1, 1, 3, 0)); + // reduction_b_7x1 + add_config(TensorShape(17U, 17U, 256U), TensorShape(1U, 7U, 256U, 320U), TensorShape(320U), TensorShape(17U, 17U, 320U), PadStrideInfo(1, 1, 0, 3)); + // reduction_b_3x3_2 + add_config(TensorShape(17U, 17U, 320U), TensorShape(3U, 3U, 320U, 320U), TensorShape(320U), TensorShape(8U, 8U, 320U), PadStrideInfo(2, 2, 0, 0)); + // inception_c1_1x1_2, inception_c1_1x1, inception_c2_1x1_2, inception_c2_1x1, inception_c3_1x1_2, inception_c3_1x1 + add_config(TensorShape(8U, 8U, 1536U), TensorShape(1U, 1U, 1536U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_c1_1x1_3, inception_c1_1x1_4, inception_c2_1x1_3, inception_c2_1x1_4, inception_c3_1x1_3, inception_c3_1x1_4 + add_config(TensorShape(8U, 8U, 1536U), TensorShape(1U, 1U, 1536U, 384U), TensorShape(384U), TensorShape(8U, 8U, 384U), PadStrideInfo(1, 1, 0, 0)); + // inception_c1_1x3, inception_c2_1x3, inception_c3_1x3 + add_config(TensorShape(8U, 8U, 384U), TensorShape(3U, 1U, 384U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 1, 0)); + // inception_c1_3x1, inception_c2_3x1, inception_c3_3x1 + add_config(TensorShape(8U, 8U, 384U), TensorShape(1U, 3U, 384U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 0, 1)); + // inception_c1_3x1_2, inception_c2_3x1_2, inception_c3_3x1_2 + add_config(TensorShape(8U, 8U, 384U), TensorShape(1U, 3U, 384U, 448U), TensorShape(448U), TensorShape(8U, 8U, 448U), PadStrideInfo(1, 1, 0, 1)); + // inception_c1_1x3_2, inception_c2_1x3_2, inception_c3_1x3_2 + add_config(TensorShape(8U, 8U, 448U), TensorShape(3U, 1U, 448U, 512U), TensorShape(512U), TensorShape(8U, 8U, 512U), PadStrideInfo(1, 1, 1, 0)); + // inception_c1_1x3_3, inception_c2_1x3_3, inception_c3_1x3_3 + add_config(TensorShape(8U, 8U, 512U), TensorShape(3U, 1U, 512U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 1, 0)); + // inception_c1_3x1_3, inception_c2_3x1_3, inception_c3_3x1_3 + add_config(TensorShape(8U, 8U, 512U), TensorShape(1U, 3U, 512U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 0, 1)); + } +}; + +/** A subset of GoogLeNetInceptionV4 convolution layers with filter dimensions supported by DirectConvolution kernel */ +class GoogLeNetInceptionV4DirectConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + // subset of GoogLeNetInceptionV4 inception v1 dataset + GoogLeNetInceptionV4DirectConvolutionLayerDataset() + { + // conv1_3x3_s2 + add_config(TensorShape(299U, 299U, 3U), TensorShape(3U, 3U, 3U, 32U), TensorShape(32U), TensorShape(149U, 149U, 32U), PadStrideInfo(2, 2, 0, 0)); + // conv2_3x3_s1 + add_config(TensorShape(149U, 149U, 32U), TensorShape(3U, 3U, 32U, 32U), TensorShape(32U), TensorShape(147U, 147U, 32U), PadStrideInfo(1, 1, 0, 0)); + // conv3_3x3_s1 + add_config(TensorShape(147U, 147U, 32U), TensorShape(3U, 3U, 32U, 64U), TensorShape(64U), TensorShape(147U, 147U, 64U), PadStrideInfo(1, 1, 1, 1)); + // inception_stem1_3x3_s2 + add_config(TensorShape(147U, 147U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(73U, 73U, 96U), PadStrideInfo(2, 2, 0, 0)); + // inception_stem2_3x3_reduce, inception_stem2_1x7_reduce + add_config(TensorShape(73U, 73U, 160U), TensorShape(1U, 1U, 160U, 64U), TensorShape(64U), TensorShape(73U, 73U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_stem2_3x3, inception_stem2_3x3_2 + add_config(TensorShape(73U, 73U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(71U, 71U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_stem3_3x3_s2 + add_config(TensorShape(71U, 71U, 192U), TensorShape(3U, 3U, 192U, 192U), TensorShape(192U), TensorShape(35U, 35U, 192U), PadStrideInfo(2, 2, 0, 0)); + // inception_a1_1x1_2, inception_a1_1x1, inception_a2_1x1_2, inception_a2_1x1, inception_a3_1x1_2, inception_a3_1x1, inception_a4_1x1_2, inception_a4_1x1 + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 0, 0)); + // inception_a1_3x3_reduce, inception_a1_3x3_2_reduce, inception_a2_3x3_reduce, inception_a2_3x3_2_reduce, inception_a3_3x3_reduce, inception_a3_3x3_2_reduce, inception_a4_3x3_reduce, inception_a4_3x3_2_reduce + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 64U), TensorShape(64U), TensorShape(35U, 35U, 64U), PadStrideInfo(1, 1, 0, 0)); + // inception_a1_3x3, inception_a1_3x3_2, inception_a2_3x3, inception_a2_3x3_2, inception_a3_3x3, inception_a3_3x3_2, inception_a4_3x3, inception_a4_3x3_2 + add_config(TensorShape(35U, 35U, 64U), TensorShape(3U, 3U, 64U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 1, 1)); + // inception_a1_3x3_3, inception_a2_3x3_3, inception_a3_3x3_3, inception_a4_3x3_3 + add_config(TensorShape(35U, 35U, 96U), TensorShape(3U, 3U, 96U, 96U), TensorShape(96U), TensorShape(35U, 35U, 96U), PadStrideInfo(1, 1, 1, 1)); + // reduction_a_3x3 + add_config(TensorShape(35U, 35U, 384U), TensorShape(3U, 3U, 384U, 384U), TensorShape(384U), TensorShape(17U, 17U, 384U), PadStrideInfo(2, 2, 0, 0)); + // reduction_a_3x3_2_reduce + add_config(TensorShape(35U, 35U, 384U), TensorShape(1U, 1U, 384U, 192U), TensorShape(192U), TensorShape(35U, 35U, 192U), PadStrideInfo(1, 1, 0, 0)); + // reduction_a_3x3_2 + add_config(TensorShape(35U, 35U, 192U), TensorShape(3U, 3U, 192U, 224U), TensorShape(224U), TensorShape(35U, 35U, 224U), PadStrideInfo(1, 1, 1, 1)); + // reduction_a_3x3_3 + add_config(TensorShape(35U, 35U, 224U), TensorShape(3U, 3U, 224U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(2, 2, 0, 0)); + // inception_b1_1x1_2, inception_b2_1x1_2, inception_b3_1x1_2, inception_b4_1x1_2, inception_b5_1x1_2, inception_b6_1x1_2, inception_b7_1x1_2 + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 384U), TensorShape(384U), TensorShape(17U, 17U, 384U), PadStrideInfo(1, 1, 0, 0)); + // inception_b1_1x7_reduce, inception_b1_7x1_2_reduce, inception_b2_1x7_reduce, inception_b2_7x1_2_reduce, inception_b3_1x7_reduce, inception_b3_7x1_2_reduce, inception_b4_1x7_reduce, inception_b4_7x1_2_reduce, inception_b5_1x7_reduce, inception_b5_7x1_2_reduce, inception_b6_1x7_reduce, inception_b6_7x1_2_reduce, inception_b7_1x7_reduce, inception_b7_7x1_2_reduce, reduction_b_3x3_reduce + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 192U), TensorShape(192U), TensorShape(17U, 17U, 192U), PadStrideInfo(1, 1, 0, 0)); + // inception_b1_1x1, inception_b2_1x1, inception_b3_1x1, inception_b4_1x1, inception_b5_1x1, inception_b6_1x1, inception_b7_1x1 + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 128U), TensorShape(128U), TensorShape(17U, 17U, 128U), PadStrideInfo(1, 1, 0, 0)); + // reduction_b_3x3 + add_config(TensorShape(17U, 17U, 192U), TensorShape(3U, 3U, 192U, 192U), TensorShape(192U), TensorShape(8U, 8U, 192U), PadStrideInfo(2, 2, 0, 0)); + // reduction_b_1x7_reduce + add_config(TensorShape(17U, 17U, 1024U), TensorShape(1U, 1U, 1024U, 256U), TensorShape(256U), TensorShape(17U, 17U, 256U), PadStrideInfo(1, 1, 0, 0)); + // reduction_b_3x3_2 + add_config(TensorShape(17U, 17U, 320U), TensorShape(3U, 3U, 320U, 320U), TensorShape(320U), TensorShape(8U, 8U, 320U), PadStrideInfo(2, 2, 0, 0)); + // inception_c1_1x1_2, inception_c1_1x1, inception_c2_1x1_2, inception_c2_1x1, inception_c3_1x1_2, inception_c3_1x1 + add_config(TensorShape(8U, 8U, 1536U), TensorShape(1U, 1U, 1536U, 256U), TensorShape(256U), TensorShape(8U, 8U, 256U), PadStrideInfo(1, 1, 0, 0)); + // inception_c1_1x1_3, inception_c1_1x1_4, inception_c2_1x1_3, inception_c2_1x1_4, inception_c3_1x1_3, inception_c3_1x1_4 + add_config(TensorShape(8U, 8U, 1536U), TensorShape(1U, 1U, 1536U, 384U), TensorShape(384U), TensorShape(8U, 8U, 384U), PadStrideInfo(1, 1, 0, 0)); + } +}; + +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4FullyConnectedLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4FullyConnectedLayerDataset.h new file mode 100644 index 0000000000..8cf59e8207 --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4FullyConnectedLayerDataset.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_FULLYCONNECTED_LAYER_DATASET + +#include "tests/datasets/FullyConnectedLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV4FullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + GoogLeNetInceptionV4FullyConnectedLayerDataset() + { + add_config(TensorShape(1536U), TensorShape(1536U, 1000U), TensorShape(1000U), TensorShape(1000U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4PoolingLayerDataset.h b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4PoolingLayerDataset.h new file mode 100644 index 0000000000..3b1ee8dcb4 --- /dev/null +++ b/tests/datasets/system_tests/googlenet/inceptionv4/GoogLeNetInceptionV4PoolingLayerDataset.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class GoogLeNetInceptionV4PoolingLayerDataset final : public PoolingLayerDataset +{ +public: + GoogLeNetInceptionV4PoolingLayerDataset() + { + // FIXME: Add support for global pooling layer pool_8x8_s1 + // inception_stem1_pool + add_config(TensorShape(147U, 147U, 64U), TensorShape(73U, 73U, 64U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_stem3_pool + add_config(TensorShape(71U, 71U, 192U), TensorShape(35U, 35U, 192U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_a1_pool_ave, inception_a2_pool_ave, inception_a3_pool_ave, inception_a4_pool_ave + add_config(TensorShape(35U, 35U, 384U), TensorShape(35U, 35U, 384U), PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // reduction_a_pool + add_config(TensorShape(35U, 35U, 384U), TensorShape(17U, 17U, 384U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_b1_pool_ave, inception_b2_pool_ave, inception_b3_pool_ave, inception_b4_pool_ave, inception_b5_pool_ave, inception_b6_pool_ave, inception_b7_pool_ave + add_config(TensorShape(17U, 17U, 1024U), TensorShape(17U, 17U, 1024U), PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + // reduction_b_pool + add_config(TensorShape(17U, 17U, 1024U), TensorShape(8U, 8U, 1024U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // inception_c1_pool_ave, inception_c2_pool_ave, inception_c3_pool_ave + add_config(TensorShape(8U, 8U, 1536U), TensorShape(8U, 8U, 1536U), PoolingLayerInfo(PoolingType::AVG, 3, PadStrideInfo(1, 1, 1, 1, DimensionRoundingType::CEIL))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_GOOGLENETINCEPTIONV4_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/lenet5/LeNet5ActivationLayerDataset.h b/tests/datasets/system_tests/lenet5/LeNet5ActivationLayerDataset.h new file mode 100644 index 0000000000..4c88cde58d --- /dev/null +++ b/tests/datasets/system_tests/lenet5/LeNet5ActivationLayerDataset.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LENET5_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_LENET5_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LeNet5ActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::SingletonDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + LeNet5ActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", TensorShape(500U)), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + LeNet5ActivationLayerDataset(LeNet5ActivationLayerDataset &&) = default; + ~LeNet5ActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LENET5_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/lenet5/LeNet5ConvolutionLayerDataset.h b/tests/datasets/system_tests/lenet5/LeNet5ConvolutionLayerDataset.h new file mode 100644 index 0000000000..e1d3ead65b --- /dev/null +++ b/tests/datasets/system_tests/lenet5/LeNet5ConvolutionLayerDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LENET5_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_LENET5_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LeNet5ConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + LeNet5ConvolutionLayerDataset() + { + add_config(TensorShape(28U, 28U, 1U), TensorShape(5U, 5U, 1U, 20U), TensorShape(20U), TensorShape(24U, 24U, 20U), PadStrideInfo(1, 1, 0, 0)); + add_config(TensorShape(12U, 12U, 20U), TensorShape(5U, 5U, 20U, 50U), TensorShape(50U), TensorShape(8U, 8U, 50U), PadStrideInfo(1, 1, 0, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LENET5_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/lenet5/LeNet5FullyConnectedLayerDataset.h b/tests/datasets/system_tests/lenet5/LeNet5FullyConnectedLayerDataset.h new file mode 100644 index 0000000000..343ecc0190 --- /dev/null +++ b/tests/datasets/system_tests/lenet5/LeNet5FullyConnectedLayerDataset.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LENET5_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_LENET5_FULLYCONNECTED_LAYER_DATASET + +#include "tests/datasets/FullyConnectedLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +using namespace arm_compute; + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LeNet5FullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + LeNet5FullyConnectedLayerDataset() + { + add_config(TensorShape(4U, 4U, 50U), TensorShape(800U, 500U), TensorShape(500U), TensorShape(500U)); + add_config(TensorShape(500U), TensorShape(500U, 10U), TensorShape(10U), TensorShape(10U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LENET5_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/lenet5/LeNet5PoolingLayerDataset.h b/tests/datasets/system_tests/lenet5/LeNet5PoolingLayerDataset.h new file mode 100644 index 0000000000..bc2de7b235 --- /dev/null +++ b/tests/datasets/system_tests/lenet5/LeNet5PoolingLayerDataset.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_LENET5_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_LENET5_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class LeNet5PoolingLayerDataset final : public PoolingLayerDataset +{ +public: + LeNet5PoolingLayerDataset() + { + add_config(TensorShape(24U, 24U, 20U), TensorShape(12U, 12U, 20U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0))); + add_config(TensorShape(8U, 8U, 50U), TensorShape(4U, 4U, 50U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_LENET5_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/squeezenet/SqueezeNetActivationLayerDataset.h b/tests/datasets/system_tests/squeezenet/SqueezeNetActivationLayerDataset.h new file mode 100644 index 0000000000..7644387384 --- /dev/null +++ b/tests/datasets/system_tests/squeezenet/SqueezeNetActivationLayerDataset.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SQUEEZENET_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_SQUEEZENET_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SqueezeNetActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + SqueezeNetActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // relu_conv1 + TensorShape(111U, 111U, 64U), + // fire2/relu_squeeze1x1, fire3/relu_squeeze1x1 + TensorShape(55U, 55U, 16U), + // fire2/relu_expand1x1, fire2/relu_expand3x3, fire3/relu_expand1x1, fire3/relu_expand3x3 + TensorShape(55U, 55U, 64U), + // fire4/relu_squeeze1x1, fire5/relu_squeeze1x1 + TensorShape(27U, 27U, 32U), + // fire4/relu_expand1x1, fire4/relu_expand3x3, fire5/relu_expand1x1, fire5/relu_expand3x3 + TensorShape(27U, 27U, 128U), + // fire6/relu_squeeze1x1, fire7/relu_squeeze1x1 + TensorShape(13U, 13U, 48U), + // fire6/relu_expand1x1, fire6/relu_expand3x3, fire7/relu_expand1x1, fire7/relu_expand3x3 + TensorShape(13U, 13U, 192U), + // fire8/relu_squeeze1x1, fire9/relu_squeeze1x1 + TensorShape(13U, 13U, 64U), + // fire8/relu_expand1x1, fire8/relu_expand3x3, fire9/relu_expand1x1, fire9/relu_expand3x3 + TensorShape(13U, 13U, 256U), + // relu_conv10 + TensorShape(13U, 13U, 1000U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + SqueezeNetActivationLayerDataset(SqueezeNetActivationLayerDataset &&) = default; + ~SqueezeNetActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SQUEEZENET_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/squeezenet/SqueezeNetConvolutionLayerDataset.h b/tests/datasets/system_tests/squeezenet/SqueezeNetConvolutionLayerDataset.h new file mode 100644 index 0000000000..2d447b0156 --- /dev/null +++ b/tests/datasets/system_tests/squeezenet/SqueezeNetConvolutionLayerDataset.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SQUEEZENET_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_SQUEEZENET_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SqueezeNetConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + SqueezeNetConvolutionLayerDataset() + { + // conv1 + add_config(TensorShape(224U, 224U, 3U), TensorShape(3U, 3U, 3U, 64U), TensorShape(64U), TensorShape(111U, 111U, 64U), PadStrideInfo(2, 2, 0, 0)); + // fire2/squeeze1x1 + add_config(TensorShape(55U, 55U, 64U), TensorShape(1U, 1U, 64U, 16U), TensorShape(16U), TensorShape(55U, 55U, 16U), PadStrideInfo(1, 1, 0, 0)); + // fire2/expand1x1, fire3/expand1x1 + add_config(TensorShape(55U, 55U, 16U), TensorShape(1U, 1U, 16U, 64U), TensorShape(64U), TensorShape(55U, 55U, 64U), PadStrideInfo(1, 1, 0, 0)); + // fire2/expand3x3, fire3/expand3x3 + add_config(TensorShape(55U, 55U, 16U), TensorShape(3U, 3U, 16U, 64U), TensorShape(64U), TensorShape(55U, 55U, 64U), PadStrideInfo(1, 1, 1, 1)); + // fire3/squeeze1x1 + add_config(TensorShape(55U, 55U, 128U), TensorShape(1U, 1U, 128U, 16U), TensorShape(16U), TensorShape(55U, 55U, 16U), PadStrideInfo(1, 1, 0, 0)); + // fire4/squeeze1x1 + add_config(TensorShape(27U, 27U, 128U), TensorShape(1U, 1U, 128U, 32U), TensorShape(32U), TensorShape(27U, 27U, 32U), PadStrideInfo(1, 1, 0, 0)); + // fire4/expand1x1, fire5/expand1x1 + add_config(TensorShape(27U, 27U, 32U), TensorShape(1U, 1U, 32U, 128U), TensorShape(128U), TensorShape(27U, 27U, 128U), PadStrideInfo(1, 1, 0, 0)); + // fire4/expand3x3, fire5/expand3x3 + add_config(TensorShape(27U, 27U, 32U), TensorShape(3U, 3U, 32U, 128U), TensorShape(128U), TensorShape(27U, 27U, 128U), PadStrideInfo(1, 1, 1, 1)); + // fire5/squeeze1x1 + add_config(TensorShape(27U, 27U, 256U), TensorShape(1U, 1U, 256U, 32U), TensorShape(32U), TensorShape(27U, 27U, 32U), PadStrideInfo(1, 1, 0, 0)); + // fire6/squeeze1x1 + add_config(TensorShape(13U, 13U, 256U), TensorShape(1U, 1U, 256U, 48U), TensorShape(48U), TensorShape(13U, 13U, 48U), PadStrideInfo(1, 1, 0, 0)); + // fire6/expand1x1, fire7/expand1x1 + add_config(TensorShape(13U, 13U, 48U), TensorShape(1U, 1U, 48U, 192U), TensorShape(192U), TensorShape(13U, 13U, 192U), PadStrideInfo(1, 1, 0, 0)); + // fire6/expand3x3, fire7/expand3x3 + add_config(TensorShape(13U, 13U, 48U), TensorShape(3U, 3U, 48U, 192U), TensorShape(192U), TensorShape(13U, 13U, 192U), PadStrideInfo(1, 1, 1, 1)); + // fire7/squeeze1x1 + add_config(TensorShape(13U, 13U, 384U), TensorShape(1U, 1U, 384U, 48U), TensorShape(48U), TensorShape(13U, 13U, 48U), PadStrideInfo(1, 1, 0, 0)); + // fire8/squeeze1x1 + add_config(TensorShape(13U, 13U, 384U), TensorShape(1U, 1U, 384U, 64U), TensorShape(64U), TensorShape(13U, 13U, 64U), PadStrideInfo(1, 1, 0, 0)); + // fire8/expand1x1, fire9/expand1x1 + add_config(TensorShape(13U, 13U, 64U), TensorShape(1U, 1U, 64U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 0, 0)); + // fire8/expand3x3, fire9/expand3x3 + add_config(TensorShape(13U, 13U, 64U), TensorShape(3U, 3U, 64U, 256U), TensorShape(256U), TensorShape(13U, 13U, 256U), PadStrideInfo(1, 1, 1, 1)); + // fire9/squeeze1x1 + add_config(TensorShape(13U, 13U, 512U), TensorShape(1U, 1U, 512U, 64U), TensorShape(64U), TensorShape(13U, 13U, 64U), PadStrideInfo(1, 1, 0, 0)); + // conv10 + add_config(TensorShape(13U, 13U, 512U), TensorShape(1U, 1U, 512U, 1000U), TensorShape(1000U), TensorShape(13U, 13U, 1000U), PadStrideInfo(1, 1, 0, 0)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SQUEEZENET_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/squeezenet/SqueezeNetPoolingLayerDataset.h b/tests/datasets/system_tests/squeezenet/SqueezeNetPoolingLayerDataset.h new file mode 100644 index 0000000000..69d04db7e1 --- /dev/null +++ b/tests/datasets/system_tests/squeezenet/SqueezeNetPoolingLayerDataset.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_SQUEEZENET_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_SQUEEZENET_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class SqueezeNetPoolingLayerDataset final : public PoolingLayerDataset +{ +public: + SqueezeNetPoolingLayerDataset() + { + // pool1 + add_config(TensorShape(111U, 111U, 64U), TensorShape(55U, 55U, 64U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool3 + add_config(TensorShape(55U, 55U, 128U), TensorShape(27U, 27U, 128U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool5 + add_config(TensorShape(27U, 27U, 256U), TensorShape(13U, 13U, 256U), PoolingLayerInfo(PoolingType::MAX, 3, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + //FIXME: Add support for global pooling. + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_SQUEEZENET_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/vgg/vgg16/VGG16ActivationLayerDataset.h b/tests/datasets/system_tests/vgg/vgg16/VGG16ActivationLayerDataset.h new file mode 100644 index 0000000000..66301ddf08 --- /dev/null +++ b/tests/datasets/system_tests/vgg/vgg16/VGG16ActivationLayerDataset.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_VGG16_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_VGG16_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class VGG16ActivationLayerDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + VGG16ActivationLayerDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // relu1_1, relu1_2 + TensorShape(224U, 224U, 64U), + // relu2_1, relu2_2 + TensorShape(112U, 112U, 128U), + // relu3_1, relu3_2, relu3_3 + TensorShape(56U, 56U, 256U), + // relu4_1, relu4_2, relu4_3 + TensorShape(28U, 28U, 512U), + // relu5_1, relu5_2, relu5_3 + TensorShape(14U, 14U, 512U), + // relu6, relu7 + TensorShape(4096U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + VGG16ActivationLayerDataset(VGG16ActivationLayerDataset &&) = default; + ~VGG16ActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_VGG16_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/vgg/vgg16/VGG16ConvolutionLayerDataset.h b/tests/datasets/system_tests/vgg/vgg16/VGG16ConvolutionLayerDataset.h new file mode 100644 index 0000000000..36cb5d93aa --- /dev/null +++ b/tests/datasets/system_tests/vgg/vgg16/VGG16ConvolutionLayerDataset.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_VGG16_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_VGG16_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class VGG16ConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + VGG16ConvolutionLayerDataset() + { + // conv1_1 + add_config(TensorShape(224U, 224U, 3U), TensorShape(3U, 3U, 3U, 64U), TensorShape(64U), TensorShape(224U, 224U, 64U), PadStrideInfo(1, 1, 1, 1)); + // conv1_2 + add_config(TensorShape(224U, 224U, 64U), TensorShape(3U, 3U, 64U, 64U), TensorShape(64U), TensorShape(224U, 224U, 64U), PadStrideInfo(1, 1, 1, 1)); + // conv2_1 + add_config(TensorShape(112U, 112U, 64U), TensorShape(3U, 3U, 64U, 128U), TensorShape(128U), TensorShape(112U, 112U, 128U), PadStrideInfo(1, 1, 1, 1)); + // conv2_2 + add_config(TensorShape(112U, 112U, 128U), TensorShape(3U, 3U, 128U, 128U), TensorShape(128U), TensorShape(112U, 112U, 128U), PadStrideInfo(1, 1, 1, 1)); + // conv3_1 + add_config(TensorShape(56U, 56U, 128U), TensorShape(3U, 3U, 128U, 256U), TensorShape(256U), TensorShape(56U, 56U, 256U), PadStrideInfo(1, 1, 1, 1)); + // conv3_2, conv3_3 + add_config(TensorShape(56U, 56U, 256U), TensorShape(3U, 3U, 256U, 256U), TensorShape(256U), TensorShape(56U, 56U, 256U), PadStrideInfo(1, 1, 1, 1)); + // conv4_1 + add_config(TensorShape(28U, 28U, 256U), TensorShape(3U, 3U, 256U, 512U), TensorShape(512U), TensorShape(28U, 28U, 512U), PadStrideInfo(1, 1, 1, 1)); + // conv4_2, conv4_3 + add_config(TensorShape(28U, 28U, 512U), TensorShape(3U, 3U, 512U, 512U), TensorShape(512U), TensorShape(28U, 28U, 512U), PadStrideInfo(1, 1, 1, 1)); + // conv5_1, conv5_2, conv5_3 + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, 1)); + } +}; + +class VGG16DirectConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + VGG16DirectConvolutionLayerDataset() + { + // conv1_1 + add_config(TensorShape(224U, 224U, 3U), TensorShape(3U, 3U, 3U, 64U), TensorShape(64U), TensorShape(224U, 224U, 64U), PadStrideInfo(1, 1, 1, 1)); + // conv1_2 + add_config(TensorShape(224U, 224U, 64U), TensorShape(3U, 3U, 64U, 64U), TensorShape(64U), TensorShape(224U, 224U, 64U), PadStrideInfo(1, 1, 1, 1)); + // conv2_1 + add_config(TensorShape(112U, 112U, 64U), TensorShape(3U, 3U, 64U, 128U), TensorShape(128U), TensorShape(112U, 112U, 128U), PadStrideInfo(1, 1, 1, 1)); + // conv2_2 + add_config(TensorShape(112U, 112U, 128U), TensorShape(3U, 3U, 128U, 128U), TensorShape(128U), TensorShape(112U, 112U, 128U), PadStrideInfo(1, 1, 1, 1)); + // conv3_1 + add_config(TensorShape(56U, 56U, 128U), TensorShape(3U, 3U, 128U, 256U), TensorShape(256U), TensorShape(56U, 56U, 256U), PadStrideInfo(1, 1, 1, 1)); + // conv3_2, conv3_3 + add_config(TensorShape(56U, 56U, 256U), TensorShape(3U, 3U, 256U, 256U), TensorShape(256U), TensorShape(56U, 56U, 256U), PadStrideInfo(1, 1, 1, 1)); + // conv4_1 + add_config(TensorShape(28U, 28U, 256U), TensorShape(3U, 3U, 256U, 512U), TensorShape(512U), TensorShape(28U, 28U, 512U), PadStrideInfo(1, 1, 1, 1)); + // conv4_2, conv4_3 + add_config(TensorShape(28U, 28U, 512U), TensorShape(3U, 3U, 512U, 512U), TensorShape(512U), TensorShape(28U, 28U, 512U), PadStrideInfo(1, 1, 1, 1)); + // conv5_1, conv5_2, conv5_3 + add_config(TensorShape(14U, 14U, 512U), TensorShape(3U, 3U, 512U, 512U), TensorShape(512U), TensorShape(14U, 14U, 512U), PadStrideInfo(1, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_VGG16_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/vgg/vgg16/VGG16FullyConnectedLayerDataset.h b/tests/datasets/system_tests/vgg/vgg16/VGG16FullyConnectedLayerDataset.h new file mode 100644 index 0000000000..d34dc3f87e --- /dev/null +++ b/tests/datasets/system_tests/vgg/vgg16/VGG16FullyConnectedLayerDataset.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_VGG16_FULLYCONNECTED_LAYER_DATASET +#define ARM_COMPUTE_TEST_VGG16_FULLYCONNECTED_LAYER_DATASET + +#include "tests/datasets/FullyConnectedLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class VGG16FullyConnectedLayerDataset final : public FullyConnectedLayerDataset +{ +public: + VGG16FullyConnectedLayerDataset() + { + // fc6 + add_config(TensorShape(7U, 7U, 512U), TensorShape(25088U, 4096U), TensorShape(4096U), TensorShape(4096U)); + // fc7 + add_config(TensorShape(4096U), TensorShape(4096U, 4096U), TensorShape(4096U), TensorShape(4096U)); + // fc8 + add_config(TensorShape(4096U), TensorShape(4096U, 1000U), TensorShape(1000U), TensorShape(1000U)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_VGG16_FULLYCONNECTED_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/vgg/vgg16/VGG16PoolingLayerDataset.h b/tests/datasets/system_tests/vgg/vgg16/VGG16PoolingLayerDataset.h new file mode 100644 index 0000000000..4db20870f2 --- /dev/null +++ b/tests/datasets/system_tests/vgg/vgg16/VGG16PoolingLayerDataset.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_VGG16_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_VGG16_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class VGG16PoolingLayerDataset final : public PoolingLayerDataset +{ +public: + VGG16PoolingLayerDataset() + { + // pool1 + add_config(TensorShape(224U, 224U, 64U), TensorShape(112U, 112U, 64U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool2 + add_config(TensorShape(112U, 112U, 128U), TensorShape(56U, 56U, 128U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool3 + add_config(TensorShape(56U, 56U, 256U), TensorShape(28U, 28U, 256U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool4 + add_config(TensorShape(28U, 28U, 512U), TensorShape(14U, 14U, 512U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool5 + add_config(TensorShape(14U, 14U, 512U), TensorShape(7U, 7U, 512U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_VGG16_POOLING_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/yolo/v2/YOLOV2ActivationLayerDataset.h b/tests/datasets/system_tests/yolo/v2/YOLOV2ActivationLayerDataset.h new file mode 100644 index 0000000000..8a2cd1665e --- /dev/null +++ b/tests/datasets/system_tests/yolo/v2/YOLOV2ActivationLayerDataset.h @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET + +#include "tests/framework/datasets/Datasets.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class YOLOV2ActivationLayerRELUDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + YOLOV2ActivationLayerRELUDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // relu1 + TensorShape(416U, 416U, 32U), + // relu2 + TensorShape(208U, 208U, 64U), + // relu3, relu5 + TensorShape(104U, 104U, 128U), + // relu4 + TensorShape(104U, 104U, 64U), + // relu6, relu8 + TensorShape(52U, 52U, 256U), + // relu7 + TensorShape(52U, 52U, 128U), + // relu9, relu11, relu13 + TensorShape(26U, 26U, 512U), + // relu10, relu12 + TensorShape(26U, 26U, 256U), + // relu14, relu16, relu18, relu19, relu20, relu21 + TensorShape(13U, 13U, 1024U), + // relu15, relu17 + TensorShape(13U, 13U, 512U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + } + { + } + YOLOV2ActivationLayerRELUDataset(YOLOV2ActivationLayerRELUDataset &&) = default; + ~YOLOV2ActivationLayerRELUDataset() = default; +}; + +class YOLOV2ActivationLayerLINEARDataset final : public + framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>> +{ +public: + YOLOV2ActivationLayerLINEARDataset() + : CartesianProductDataset + { + framework::dataset::make("Shape", { // linear22 + TensorShape(15U, 15U, 425U) }), + framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR)) + } + { + } + YOLOV2ActivationLayerLINEARDataset(YOLOV2ActivationLayerLINEARDataset &&) = default; + ~YOLOV2ActivationLayerLINEARDataset() = default; +}; + +class YOLOV2ActivationLayerDataset final : public framework::dataset::JoinDataset<YOLOV2ActivationLayerRELUDataset, YOLOV2ActivationLayerLINEARDataset> +{ +public: + YOLOV2ActivationLayerDataset() + : JoinDataset + { + YOLOV2ActivationLayerRELUDataset(), + YOLOV2ActivationLayerLINEARDataset() + } + { + } + YOLOV2ActivationLayerDataset(YOLOV2ActivationLayerDataset &&) = default; + ~YOLOV2ActivationLayerDataset() = default; +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/yolo/v2/YOLOV2BatchNormalizationLayerDataset.h b/tests/datasets/system_tests/yolo/v2/YOLOV2BatchNormalizationLayerDataset.h new file mode 100644 index 0000000000..cc6a6dcccc --- /dev/null +++ b/tests/datasets/system_tests/yolo/v2/YOLOV2BatchNormalizationLayerDataset.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_YOLOV2_BATCHNORMALIZATION_LAYER_DATASET +#define ARM_COMPUTE_TEST_YOLOV2_BATCHNORMALIZATION_LAYER_DATASET + +#include "tests/datasets/BatchNormalizationLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class YOLOV2BatchNormalizationLayerDataset final : public BatchNormalizationLayerDataset +{ +public: + YOLOV2BatchNormalizationLayerDataset() + { + // conv1_bn + add_config(TensorShape(416U, 416U, 32U), TensorShape(32U), 0.00001f); + // conv2_bn + add_config(TensorShape(208U, 208U, 64U), TensorShape(64U), 0.00001f); + // conv3_bn, conv5_bn + add_config(TensorShape(104U, 104U, 128U), TensorShape(128U), 0.00001f); + // conv4_bn + add_config(TensorShape(104U, 104U, 64U), TensorShape(64U), 0.00001f); + // conv6_bn, conv8_bn + add_config(TensorShape(52U, 52U, 256U), TensorShape(256U), 0.00001f); + // conv7_bn + add_config(TensorShape(52U, 52U, 128U), TensorShape(128U), 0.00001f); + // conv9_bn, conv11_bn, conv13_bn + add_config(TensorShape(26U, 26U, 512U), TensorShape(512U), 0.00001f); + // conv10_bn, conv12_bn + add_config(TensorShape(26U, 26U, 256U), TensorShape(256U), 0.00001f); + // conv14_bn, conv16_bn, conv18_bn, conv19_bn, conv20_bn, conv21_bn + add_config(TensorShape(13U, 13U, 1024U), TensorShape(1024U), 0.00001f); + // conv15_bn, conv17_bn + add_config(TensorShape(13U, 13U, 512U), TensorShape(512U), 0.00001f); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_YOLOV2_BATCHNORMALIZATION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/yolo/v2/YOLOV2ConvolutionLayerDataset.h b/tests/datasets/system_tests/yolo/v2/YOLOV2ConvolutionLayerDataset.h new file mode 100644 index 0000000000..41f48b0958 --- /dev/null +++ b/tests/datasets/system_tests/yolo/v2/YOLOV2ConvolutionLayerDataset.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_YOLOV2_CONVOLUTION_LAYER_DATASET +#define ARM_COMPUTE_TEST_YOLOV2_CONVOLUTION_LAYER_DATASET + +#include "tests/datasets/ConvolutionLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class YOLOV2ConvolutionLayerDataset final : public ConvolutionLayerDataset +{ +public: + YOLOV2ConvolutionLayerDataset() + { + // conv1 + add_config(TensorShape(416U, 416U, 3U), TensorShape(3U, 3U, 3U, 32U), TensorShape(32U), TensorShape(416U, 416U, 32U), PadStrideInfo(1, 1, 1, 1)); + // conv2 + add_config(TensorShape(208U, 208U, 32U), TensorShape(3U, 3U, 32U, 64U), TensorShape(64U), TensorShape(208U, 208U, 64U), PadStrideInfo(1, 1, 1, 1)); + // conv3, conv5 + add_config(TensorShape(104U, 104U, 64U), TensorShape(3U, 3U, 64U, 128U), TensorShape(128U), TensorShape(104U, 104U, 128U), PadStrideInfo(1, 1, 1, 1)); + // conv4 + add_config(TensorShape(104U, 104U, 128U), TensorShape(1U, 1U, 128U, 64U), TensorShape(64U), TensorShape(104U, 104U, 64U), PadStrideInfo(1, 1, 0, 0)); + // conv6, conv8 + add_config(TensorShape(52U, 52U, 128U), TensorShape(3U, 3U, 128U, 256U), TensorShape(256U), TensorShape(52U, 52U, 256U), PadStrideInfo(1, 1, 1, 1)); + // conv7 + add_config(TensorShape(52U, 52U, 256U), TensorShape(1U, 1U, 256U, 128U), TensorShape(128U), TensorShape(52U, 52U, 128U), PadStrideInfo(1, 1, 0, 0)); + // conv9, conv11, conv13 + add_config(TensorShape(26U, 26U, 256U), TensorShape(3U, 3U, 256U, 512U), TensorShape(512U), TensorShape(26U, 26U, 512U), PadStrideInfo(1, 1, 1, 1)); + // conv10, conv12 + add_config(TensorShape(26U, 26U, 512U), TensorShape(1U, 1U, 512U, 256U), TensorShape(256U), TensorShape(26U, 26U, 256U), PadStrideInfo(1, 1, 0, 0)); + // conv14, conv16, conv18 + add_config(TensorShape(13U, 13U, 512U), TensorShape(3U, 3U, 512U, 1024U), TensorShape(1024U), TensorShape(13U, 13U, 1024U), PadStrideInfo(1, 1, 1, 1)); + // conv15, conv17 + add_config(TensorShape(13U, 13U, 1024U), TensorShape(1U, 1U, 1024U, 512U), TensorShape(512U), TensorShape(13U, 13U, 512U), PadStrideInfo(1, 1, 0, 0)); + // conv19, conv20 + add_config(TensorShape(13U, 13U, 1024U), TensorShape(3U, 3U, 1024U, 1024U), TensorShape(1024U), TensorShape(13U, 13U, 1024U), PadStrideInfo(1, 1, 1, 1)); + // conv21 + add_config(TensorShape(13U, 13U, 3072U), TensorShape(3U, 3U, 3072U, 1024U), TensorShape(1024U), TensorShape(13U, 13U, 1024U), PadStrideInfo(1, 1, 1, 1)); + // conv22 + add_config(TensorShape(13U, 13U, 1024U), TensorShape(1U, 1U, 1024U, 425U), TensorShape(425U), TensorShape(15U, 15U, 425U), PadStrideInfo(1, 1, 1, 1)); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_YOLOV2_CONVOLUTION_LAYER_DATASET */ diff --git a/tests/datasets/system_tests/yolo/v2/YOLOV2PoolingLayerDataset.h b/tests/datasets/system_tests/yolo/v2/YOLOV2PoolingLayerDataset.h new file mode 100644 index 0000000000..3763d63588 --- /dev/null +++ b/tests/datasets/system_tests/yolo/v2/YOLOV2PoolingLayerDataset.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017 ARM Limited. + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#ifndef ARM_COMPUTE_TEST_YOLOV2_POOLING_LAYER_DATASET +#define ARM_COMPUTE_TEST_YOLOV2_POOLING_LAYER_DATASET + +#include "tests/datasets/PoolingLayerDataset.h" + +#include "tests/TypePrinter.h" + +#include "arm_compute/core/TensorShape.h" +#include "arm_compute/core/Types.h" + +namespace arm_compute +{ +namespace test +{ +namespace datasets +{ +class YOLOV2PoolingLayerDataset final : public PoolingLayerDataset +{ +public: + YOLOV2PoolingLayerDataset() + { + // pool1 + add_config(TensorShape(416U, 416U, 32U), TensorShape(208U, 208U, 32U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool2 + add_config(TensorShape(208U, 208U, 64U), TensorShape(104U, 104U, 64U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool5 + add_config(TensorShape(104U, 104U, 128U), TensorShape(52U, 52U, 128U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool8 + add_config(TensorShape(52U, 52U, 256U), TensorShape(26U, 26U, 256U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + // pool13 + add_config(TensorShape(26U, 26U, 512U), TensorShape(13U, 13U, 512U), PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2, 2, 0, 0, DimensionRoundingType::CEIL))); + } +}; +} // namespace datasets +} // namespace test +} // namespace arm_compute +#endif /* ARM_COMPUTE_TEST_YOLOV2_POOLING_LAYER_DATASET */ |