ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

How do I implement a LRN layer in ACL supporting multiple channels?

Open yangyanzhan opened this issue 9 years ago • 2 comments

I've found out that NENormalizationLayer requires its input tensor having exactly one channel. How could I extend NENormalizationLayer so that its input tensor could have more than one channels? Does ACL team has any plan to support this feature in the future?

yangyanzhan avatar Apr 18 '17 13:04 yangyanzhan

In the ARM Compute library the "number of channels" describes interleaved data only. If your data is planar (which is usually the case for CNN functions) then you need to use the 3rd dimension ( feature_map ) of the tensor to store several channels inside a single tensor:

3 channels [ 2, 2 ] tensor:

R G B R G B <paddng>
R G B R G B <padding>

1 channel [ 2, 2, 3] tensor:

R R <padding>
R R <padding>
<padding>
G G <padding>
G G <padding>
<padding>
B B <padding>
B B <padding>

Does it make sense ?

AnthonyBarbier avatar Apr 18 '17 13:04 AnthonyBarbier

Thank you, Anthony. I have made a try and it works perfectly now.

yangyanzhan avatar Apr 19 '17 12:04 yangyanzhan