ie_norm_layer.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file
7  */
8 
9 #pragma once
10 
12 #include <ie_network.hpp>
13 #include <string>
14 
15 namespace InferenceEngine {
16 namespace Builder {
17 
18 /**
19  * @deprecated Use ngraph API instead.
20  * @brief The class represents a builder for Norm layer
21  */
22 IE_SUPPRESS_DEPRECATED_START
23 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(NormLayer): public LayerDecorator {
24 public:
25  /**
26  * @brief The enum defines all Norm types
27  */
28  enum NormType { WITHIN_CHANNEL = 0, ACROSS_CHANNELS = 1 };
29  /**
30  * @brief The constructor creates a builder with the name
31  * @param name Layer name
32  */
33  explicit NormLayer(const std::string& name = "");
34  /**
35  * @brief The constructor creates a builder from generic builder
36  * @param layer pointer to generic builder
37  */
38  explicit NormLayer(const Layer::Ptr& layer);
39  /**
40  * @brief The constructor creates a builder from generic builder
41  * @param layer constant pointer to generic builder
42  */
43  explicit NormLayer(const Layer::CPtr& layer);
44  /**
45  * @brief Sets the name for the layer
46  * @param name Layer name
47  * @return reference to layer builder
48  */
49  NormLayer& setName(const std::string& name);
50 
51  /**
52  * @brief Returns port with shapes for the layer
53  * @return Port with shapes
54  */
55  const Port& getPort() const;
56  /**
57  * @brief Sets port shapes for the layer
58  * @param port Port with shapes
59  * @return reference to layer builder
60  */
61  NormLayer& setPort(const Port& port);
62  /**
63  * @brief Returns side length of the region
64  * @return Size
65  */
66  size_t getSize() const;
67  /**
68  * @brief Sets side length of the region
69  * @param size Size
70  * @return reference to layer builder
71  */
72  NormLayer& setSize(size_t size);
73  /**
74  * @brief Returns scaling parameter for the normalizing sum
75  * @return Scaling parameter
76  */
77  float getAlpha() const;
78  /**
79  * @brief Sets scaling parameter for the normalizing sum
80  * @param alpha Scaling parameter
81  * @return reference to layer builder
82  */
83  NormLayer& setAlpha(float alpha);
84  /**
85  * @brief Returns exponent for the normalizing sum
86  * @return Exponent
87  */
88  float getBeta() const;
89  /**
90  * @brief Sets exponent for the normalizing sum
91  * @param beta Exponent
92  * @return reference to layer builder
93  */
94  NormLayer& setBeta(float beta);
95  /**
96  * @brief Returns region type
97  * @return true if normalizing sum is performed over adjacent channels
98  */
99  bool getAcrossMaps() const;
100  /**
101  * @brief Sets region type
102  * @param acrossMap true if normalizing sum is performed over adjacent channels
103  * @return reference to layer builder
104  */
105  NormLayer& setAcrossMaps(bool acrossMap);
106  /**
107  * @brief Returns region type
108  * @return Norm type
109  */
110  NormType getRegion() const;
111  /**
112  * @brief Sets region type
113  * @param type region type
114  * @return reference to layer builder
115  */
116  NormLayer& setRegion(NormType type);
117 };
118 IE_SUPPRESS_DEPRECATED_END
119 
120 } // namespace Builder
121 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
std::shared_ptr< const Layer > CPtr
A shared pointer to the constant Layer builder.
Definition: ie_layer_builder.hpp:52
std::string name
Layer name.
Definition: ie_layers.h:42
NormType
The enum defines all Norm types.
Definition: ie_norm_layer.hpp:28
This class defines the basic functional for layer builders.
Definition: ie_layer_decorator.hpp:26
std::shared_ptr< Layer > Ptr
A shared pointer to the Layer builder.
Definition: ie_layer_builder.hpp:48
float alpha
A scale factor of src1 matrix.
Definition: ie_layers.h:1456
A header file for the Inference Engine Network interface.
This class is the main object to describe the Inference Engine port.
Definition: ie_network.hpp:230
float beta
A scale factor of src3 matrix.
Definition: ie_layers.h:1460
std::string type
Layer type.
Definition: ie_layers.h:47
The class represents a builder for Norm layer.
Definition: ie_norm_layer.hpp:23