Compute Library
 23.08
FusedDepthwiseConvolutionBatchNormalizationNode.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 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_GRAPH_FUSED_DEPTHWISE_CONVOLUTION_BATCH_NORMALIZATION_NODE_H
25 #define ARM_COMPUTE_GRAPH_FUSED_DEPTHWISE_CONVOLUTION_BATCH_NORMALIZATION_NODE_H
26 
28 
29 namespace arm_compute
30 {
31 namespace graph
32 {
33 /** Fused Depthwise Convolution Batch Normalization node */
35 {
36 public:
37  /** Constructor
38  *
39  * @param[in] epsilon Epsilon parameter.
40  * @param[in] info Convolution layer attributes.
41  * @param[in] depth_multiplier (Optional) Multiplier to apply to the input's depth in order to retrieve the output's depth. Defaults to 1.
42  * @param[in] method (Optional) Convolution method to use
43  * @param[in] fused_activation (Optional) Fused activation layer. Disabled if not specified
44  */
47  unsigned int depth_multiplier,
50 
51  /** Sets the depthwise convolution layer method to use
52  *
53  * @param[in] method Method to use for depthwise convolution
54  */
56 
57  /** Depthwise convolution layer method accessor
58  *
59  * @note This is an indication on which depthwise convolution layer implementation to use,
60  * if it fails to be created the library's heuristic approach will be used
61  *
62  * @return Depthwise convolution layer method to be used by the node
63  */
65 
66  /** Epsilon parameter accessor
67  *
68  * @return Epsilon parameter
69  */
70  float epsilon() const;
71 
72  /** Returns fused activation
73  *
74  * @return Fused activation
75  */
77 
78  /** Sets fused activation
79  *
80  * @param[in] fused_activation Fused activation to set
81  */
83 
84  /** Computes convolution output descriptor
85  *
86  * @param[in] input_descriptor Input descriptor
87  * @param[in] weights_descriptor Weights descriptor
88  * @param[in] info Convolution operation attributes
89  * @param[in] depth_multiplier Depth multiplier
90  *
91  * @return Output descriptor
92  */
93  static TensorDescriptor compute_output_descriptor(const TensorDescriptor &input_descriptor,
94  const TensorDescriptor &weights_descriptor,
95  const PadStrideInfo &info,
96  int depth_multiplier);
97 
98  /** Sets the convolution layer method to use
99  *
100  * @param[in] method Method to use for convolution
101  */
103 
104  /** Depth multiplier accessor
105  *
106  * @return Depth multiplier
107  */
108  unsigned int depth_multiplier() const;
109 
110  /** Convolution metadata accessor
111  *
112  * @return Convolution information
113  */
115 
116  // Inherited overridden methods:
117  NodeType type() const override;
118  bool forward_descriptors() override;
119  TensorDescriptor configure_output(size_t idx) const override;
120  void accept(INodeVisitor &v) override;
121 
122 public:
124 
125 private:
126  float _epsilon;
127 
128  PadStrideInfo _info;
129  unsigned int _depth_multiplier;
131  ActivationLayerInfo _fused_activation;
132 };
133 
134 } // namespace graph
135 } // namespace arm_compute
136 #endif /* ARM_COMPUTE_GRAPH_FUSED_DEPTHWISE_CONVOLUTION_BATCH_NORMALIZATION_NODE_H */
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::set_fused_activation
void set_fused_activation(ActivationLayerInfo fused_activation)
Sets fused activation.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:76
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::fused_activation
ActivationLayerInfo fused_activation() const
Returns fused activation.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:71
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::forward_descriptors
bool forward_descriptors() override
Forwards descriptor information to outputs if possible.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:105
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::convolution_info
PadStrideInfo convolution_info() const
Convolution metadata accessor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:61
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::accept
void accept(INodeVisitor &v) override
Accepts a node visitor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:135
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::depth_multiplier
unsigned int depth_multiplier() const
Depth multiplier accessor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:66
INode.h
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::configure_output
TensorDescriptor configure_output(size_t idx) const override
Calculates output configuration.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:117
arm_compute::graph::NodeType::FusedDepthwiseConvolutionBatchNormalizationLayer
@ FusedDepthwiseConvolutionBatchNormalizationLayer
arm_compute::ActivationLayerInfo
Activation Layer Information class.
Definition: ActivationLayerInfo.h:55
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::epsilon
float epsilon() const
Epsilon parameter accessor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:56
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::node_type
static constexpr NodeType node_type
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.h:123
arm_compute::graph::INode
Node interface.
Definition: INode.h:46
arm_compute::graph::NodeType
NodeType
Supported nodes.
Definition: Types.h:203
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::set_depthwise_convolution_method
void set_depthwise_convolution_method(DepthwiseConvolutionMethod method)
Sets the depthwise convolution layer method to use.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:46
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::FusedDepthwiseConvolutionBatchNormalizationNode
FusedDepthwiseConvolutionBatchNormalizationNode(float epsilon, PadStrideInfo info, unsigned int depth_multiplier, DepthwiseConvolutionMethod method, ActivationLayerInfo fused_activation=ActivationLayerInfo())
Constructor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:35
arm_compute::PadStrideInfo
Definition: CoreTypes.h:138
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::type
NodeType type() const override
Returns node's type.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:130
arm_compute::graph::INodeVisitor
Node visitor interface.
Definition: INodeVisitor.h:34
arm_compute::graph::ConvolutionMethod
ConvolutionMethod
Supported Convolution layer methods.
Definition: Types.h:130
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
arm_compute::graph::TensorDescriptor
Tensor metadata class.
Definition: TensorDescriptor.h:38
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::compute_output_descriptor
static TensorDescriptor compute_output_descriptor(const TensorDescriptor &input_descriptor, const TensorDescriptor &weights_descriptor, const PadStrideInfo &info, int depth_multiplier)
Computes convolution output descriptor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:81
arm_compute::graph::DepthwiseConvolutionMethod
DepthwiseConvolutionMethod
Supported Depthwise Convolution layer methods.
Definition: Types.h:139
arm_compute::test::validation::info
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::set_convolution_method
void set_convolution_method(ConvolutionMethod method)
Sets the convolution layer method to use.
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode::depthwise_convolution_method
DepthwiseConvolutionMethod depthwise_convolution_method() const
Depthwise convolution layer method accessor.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.cpp:51
arm_compute::graph::FusedDepthwiseConvolutionBatchNormalizationNode
Fused Depthwise Convolution Batch Normalization node.
Definition: FusedDepthwiseConvolutionBatchNormalizationNode.h:34