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