18 : m_RangeTracker(rangeTracker)
21 void StaticRangeVisitor::SetRange(
const IConnectableLayer* layer,
unsigned int outputIdx,
float min,
float max)
23 m_RangeTracker.
SetRange(layer, outputIdx, min, max);
29 SetRange(layer, 0, parentRange.first, parentRange.second);
35 SetRange(layer, 0, -20.f, 20.f);
52 SetRange(layer, 0, -15.0f, 15.0f);
65 SetRange(layer, 0, -15.0f, 15.0f);
78 SetRange(layer, 0, -15.0f, 15.0f);
93 SetRange(layer, 0, 0.f, 15.f);
96 SetRange(layer, 0, 0.f, activationDescriptor.
m_A);
99 SetRange(layer, 0, -1.f, 1.f);
102 SetRange(layer, 0, -5.f, 15.f);
105 SetRange(layer, 0, -15.f, 15.f);
120 SetRange(layer, 0, -15.0f, 15.0f);
129 ForwardParentParameters(layer);
138 ForwardParentParameters(layer);
147 ForwardParentParameters(layer);
156 SetRange(layer, 0, 0.f, 1.f);
165 float min = std::numeric_limits<float>::max();
166 float max = std::numeric_limits<float>::lowest();
173 min = std::min(min, range.first);
174 max = std::max(max, range.second);
176 SetRange(layer, 0, min, max);
192 const float* inputData =
reinterpret_cast<const float*
>(input.
GetMemoryArea());
194 float min = std::numeric_limits<float>::max();
195 float max = std::numeric_limits<float>::lowest();
197 for (
unsigned int i = 0; i < inputNumElements; i++)
199 const float inputValue = inputData[i];
201 min = std::min(min, inputValue);
202 max = std::max(max, inputValue);
204 SetRange(layer, 0, min, max);
213 ForwardParentParameters(layer);
222 ForwardParentParameters(layer);
231 ForwardParentParameters(layer);
240 ForwardParentParameters(layer);
249 ForwardParentParameters(layer);
258 ForwardParentParameters(layer);
A ViewsDescriptor for the SplitterLayer.
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
void VisitConvolution2dLayer(const IConnectableLayer *layer, const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&) function is ...
virtual unsigned int GetNumInputSlots() const =0
Returns the number of connectable input slots.
A ReshapeDescriptor for the ReshapeLayer.
void VisitFullyConnectedLayer(const IConnectableLayer *layer, const FullyConnectedDescriptor &desc, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name) override
Function that a fully connected layer should call back to when its Accept(ILayerVisitor&) function is...
A Convolution2dDescriptor for the Convolution2dLayer.
void VisitConcatLayer(const IConnectableLayer *layer, const OriginsDescriptor &originsDescriptor, const char *name=nullptr) override
Function that a concat layer should call back to when its Accept(ILayerVisitor&) function is invoked...
void VisitActivationLayer(const IConnectableLayer *layer, const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
Function that an activation layer should call back to when its Accept(ILayerVisitor&) function is inv...
void VisitReshapeLayer(const IConnectableLayer *layer, const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr) override
Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked...
unsigned int GetNumElements() const
void VisitResizeBilinearLayer(const IConnectableLayer *layer, const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Function that a resize bilinear layer should call back to when its Accept(ILayerVisitor&) function is...
MemoryType GetMemoryArea() const
Copyright (c) 2020 ARM Limited.
void IgnoreUnused(Ts &&...)
void VisitBatchNormalizationLayer(const IConnectableLayer *layer, const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr) override
Function that a batch normalization layer should call back to when its Accept(ILayerVisitor&) functio...
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
std::pair< float, float > MinMaxRange
A ResizeDescriptor for the ResizeLayer.
MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const
Retrieve the Range for a particular output slot on a particular layer.
void VisitAdditionLayer(const IConnectableLayer *layer, const char *name=nullptr) override
Functions to set the Range on a per-layer-type basis.
void SetRange(const IConnectableLayer *layer, unsigned int outputIdx, float min, float max)
Set the range for an output slot on a layer.
An output connection slot for a layer.
An OriginsDescriptor for the ConcatLayer.
A FullyConnectedDescriptor for the FullyConnectedLayer.
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
void VisitStridedSliceLayer(const IConnectableLayer *layer, const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoke...
void VisitPermuteLayer(const IConnectableLayer *layer, const PermuteDescriptor &permuteDescriptor, const char *name) override
Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked...
virtual unsigned int CalculateIndexOnOwner() const =0
void VisitSpaceToBatchNdLayer(const IConnectableLayer *layer, const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invok...
An ActivationDescriptor for the ActivationLayer.
min(a, max(b, input)) ReLu1 & ReLu6.
StaticRangeVisitor(RangeTracker &rangeTracker)
void VisitConstantLayer(const IConnectableLayer *layer, const ConstTensor &input, const char *name=nullptr) override
Function a layer with no inputs and a single output, which always corresponds to the passed in consta...
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH).
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
void VisitResizeLayer(const IConnectableLayer *layer, const ResizeDescriptor &resizeDescriptor, const char *name=nullptr) override
Function that a resize layer should call back to when its Accept(ILayerVisitor&) function is invoked...
void VisitSoftmaxLayer(const IConnectableLayer *layer, const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked...
A StridedSliceDescriptor for the StridedSliceLayer.
void VisitSplitterLayer(const IConnectableLayer *layer, const SplitterDescriptor &splitterDescriptor, const char *name=nullptr) override
Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoke...
DataType GetDataType() const
void VisitBatchToSpaceNdLayer(const IConnectableLayer *layer, const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Function that a batch to space ND layer should call back to when its Accept(ILayerVisitor&) function ...
virtual LayerGuid GetOwningLayerGuid() const =0
void VisitPooling2dLayer(const IConnectableLayer *layer, const Pooling2dDescriptor &pooling2dDescriptor, const char *name) override
Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked...
A Pooling2dDescriptor for the Pooling2dLayer.
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
void VisitDepthwiseConvolution2dLayer(const IConnectableLayer *layer, const DepthwiseConvolution2dDescriptor &desc, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Function that a 2D depthwise convolution layer with biases should call back to when its Accept(ILayer...
A SoftmaxDescriptor for the SoftmaxLayer.
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square).
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
A PermuteDescriptor for the PermuteLayer.