clDNN
region_yolo.hpp
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
18 #pragma once
19 #include "../C/region_yolo.h"
20 #include "primitive.hpp"
21 
22 namespace cldnn
23 {
30 
35  struct region_yolo : public primitive_base<region_yolo, CLDNN_PRIMITIVE_DESC(region_yolo)>
36  {
37  CLDNN_DECLATE_PRIMITIVE(region_yolo)
38 
39 
44  const primitive_id& id,
45  const primitive_id& input,
46  const uint32_t coords,
47  const uint32_t classes,
48  const uint32_t num,
49  const padding& output_padding = padding()
50  )
52  , coords(coords)
53  , classes(classes)
54  , num(num)
55  {}
56 
60  , coords(dto->coords)
61  , classes(dto->classes)
62  , num(dto->num)
63  {}
64 
68  uint32_t coords;
69  uint32_t classes;
70  uint32_t num;
71 
72 
73  private:
74  void update_dto(dto& dto) const override
75  {
76  dto.coords = coords;
77  dto.classes = classes;
78  dto.num = num;
79  }
80  };
84 }
85 #pragma once
Represents data padding information.
Definition: layout.hpp:125
uint32_t coords
paramter coords
Definition: region_yolo.h:41
region_yolo(const dto *dto)
Constructs a copy from C API cldnn_region_yolo_desc.
Definition: region_yolo.hpp:58
uint32_t coords
Defines a scope of a region yolo normalization.
Definition: region_yolo.hpp:68
region_yolo(const primitive_id &id, const primitive_id &input, const uint32_t coords, const uint32_t classes, const uint32_t num, const padding &output_padding=padding())
Constructs region_yolo primitive.
Definition: region_yolo.hpp:43
region softmax specific for yolo2 topology
Definition: region_yolo.h:39
uint32_t classes
paramter classes
Definition: region_yolo.h:43
std::string primitive_id
Unique id of a primitive within a topology.
Definition: primitive.hpp:42
fixed_size_vector_ref input
List of ids of input primitives.
Definition: primitive.hpp:146
Normalizes results so they sum to 1.
Definition: region_yolo.hpp:35
base class for all primitives implementations.
Definition: primitive.hpp:190
padding output_padding
Requested output padding.
Definition: primitive.hpp:149
uint32_t num
paramter num
Definition: region_yolo.h:45