ie_batch_normalization_layer.hpp
1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <builders/ie_layer_fragment.hpp>
8 #include <ie_inetwork.hpp>
9 #include <string>
10 
11 namespace InferenceEngine {
12 namespace Builder {
13 
14 /**
15  * @brief The class represents a builder for BatchNormalization layer
16  */
17 class INFERENCE_ENGINE_API_CLASS(BatchNormalizationLayer): public LayerFragment {
18 public:
19  /**
20  * @brief The constructor creates a builder with the name
21  * @param name Layer name
22  */
23  explicit BatchNormalizationLayer(const std::string& name = "");
24  /**
25  * @brief The constructor creates a builder from generic builder
26  * @param genLayer generic builder
27  */
28  explicit BatchNormalizationLayer(Layer& genLayer);
29  /**
30  * @brief Sets the name for the layer
31  * @param name Layer name
32  * @return reference to layer builder
33  */
34  BatchNormalizationLayer& setName(const std::string& name);
35 
36  /**
37  * @brief Returns port with shapes for the layer
38  * @return Port with shapes
39  */
40  const Port& getPort() const;
41  /**
42  * @brief Sets port shapes for the layer
43  * @param port Port with shapes
44  * @return reference to layer builder
45  */
46  BatchNormalizationLayer& setPort(const Port &port);
47 
48  /**
49  * @brief Sets weights for layer
50  * @param weights Constant blob with weights
51  * @return reference to layer builder
52  */
53  BatchNormalizationLayer& setWeights(const Blob::CPtr& weights);
54  /**
55  * @brief Sets biases for layer
56  * @param biases Constant blob with biases
57  * @return reference to layer builder
58  */
59  BatchNormalizationLayer& setBiases(const Blob::CPtr& biases);
60 
61  /**
62  * @brief Returns epsilon
63  * @return Epsilon
64  */
65  float getEpsilon() const;
66  /**
67  * @brief Sets epsilon
68  * @param eps Epsilon
69  * @return reference to layer builder
70  */
71  BatchNormalizationLayer& setEpsilon(float eps);
72 
73  /**
74  * @brief Validates layer before creation
75  * @param layer generic layer builder
76  */
77  static void validate(const Layer& layer);
78 };
79 
80 } // namespace Builder
81 } // namespace InferenceEngine
Definition: ie_argmax_layer.hpp:11
a header file for the Inference Engine Network interface
std::shared_ptr< const Blob > CPtr
A smart pointer to the const Blob object.
Definition: ie_blob.h:43