blob: f30069e55de5cd0fb0b5820c58d4755e27b4e702 [file] [log] [blame]
SiCong Li1e5c1572017-07-27 17:58:52 +01001/*
2 * Copyright (c) 2017 ARM Limited.
3 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#ifndef ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET
25#define ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET
26
Moritz Pflanzera09de0c2017-09-01 20:41:12 +010027#include "tests/framework/datasets/Datasets.h"
SiCong Li1e5c1572017-07-27 17:58:52 +010028
Anthony Barbier2a07e182017-08-04 18:20:27 +010029#include "utils/TypePrinter.h"
SiCong Li1e5c1572017-07-27 17:58:52 +010030
31#include "arm_compute/core/TensorShape.h"
32#include "arm_compute/core/Types.h"
33
34namespace arm_compute
35{
36namespace test
37{
38namespace datasets
39{
40class YOLOV2ActivationLayerRELUDataset final : public
41 framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>>
42{
43public:
44 YOLOV2ActivationLayerRELUDataset()
45 : CartesianProductDataset
46 {
47 framework::dataset::make("Shape", { // relu1
48 TensorShape(416U, 416U, 32U),
49 // relu2
50 TensorShape(208U, 208U, 64U),
51 // relu3, relu5
52 TensorShape(104U, 104U, 128U),
53 // relu4
54 TensorShape(104U, 104U, 64U),
55 // relu6, relu8
56 TensorShape(52U, 52U, 256U),
57 // relu7
58 TensorShape(52U, 52U, 128U),
59 // relu9, relu11, relu13
60 TensorShape(26U, 26U, 512U),
61 // relu10, relu12
62 TensorShape(26U, 26U, 256U),
63 // relu14, relu16, relu18, relu19, relu20, relu21
64 TensorShape(13U, 13U, 1024U),
65 // relu15, relu17
66 TensorShape(13U, 13U, 512U) }),
67 framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU))
68 }
69 {
70 }
71 YOLOV2ActivationLayerRELUDataset(YOLOV2ActivationLayerRELUDataset &&) = default;
72 ~YOLOV2ActivationLayerRELUDataset() = default;
73};
74
75class YOLOV2ActivationLayerLINEARDataset final : public
76 framework::dataset::CartesianProductDataset<framework::dataset::InitializerListDataset<TensorShape>, framework::dataset::SingletonDataset<ActivationLayerInfo>>
77{
78public:
79 YOLOV2ActivationLayerLINEARDataset()
80 : CartesianProductDataset
81 {
82 framework::dataset::make("Shape", { // linear22
83 TensorShape(15U, 15U, 425U) }),
84 framework::dataset::make("Info", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR))
85 }
86 {
87 }
88 YOLOV2ActivationLayerLINEARDataset(YOLOV2ActivationLayerLINEARDataset &&) = default;
89 ~YOLOV2ActivationLayerLINEARDataset() = default;
90};
91
92class YOLOV2ActivationLayerDataset final : public framework::dataset::JoinDataset<YOLOV2ActivationLayerRELUDataset, YOLOV2ActivationLayerLINEARDataset>
93{
94public:
95 YOLOV2ActivationLayerDataset()
96 : JoinDataset
97 {
98 YOLOV2ActivationLayerRELUDataset(),
99 YOLOV2ActivationLayerLINEARDataset()
100 }
101 {
102 }
103 YOLOV2ActivationLayerDataset(YOLOV2ActivationLayerDataset &&) = default;
104 ~YOLOV2ActivationLayerDataset() = default;
105};
106} // namespace datasets
107} // namespace test
108} // namespace arm_compute
109#endif /* ARM_COMPUTE_TEST_YOLOV2_ACTIVATION_LAYER_DATASET */