Unlock this feature

This feature isn’t part of your plan yet

Contact sales to get upgraded to the full DevStudio experience.

Unlock this feature

This feature isn't part of your plan yet.

Channel Normalization

channelNormfunction
File: /src/image.hppLines 4564–4605

Implements a normalization step on tensors, where each channel is normalized given mean and standard deviation parameters for that channel.

x_norm = (x / 255 - mean) / stdev(x)

template <typename InShape,
          typename OutShape,
          typename ChannelInfoShape,
          typename OcmAllocatorType,
          std::enable_if_t<isTensorT<ChannelInfoShape>::value == 1, int> = 0>
INLINE void channelNorm(InShape& tensorIn,
                        OutShape& tensorOut,
                        ChannelInfoShape& means,
                        ChannelInfoShape& stdDevs,
                        OcmAllocatorType& ocmMemAlloc)
NameTypeDefaultDescription
InShapetypenameThe input tensor shape.
OutShapetypenameThe output tensor shape.
ChannelInfoShapetypenameThe tensor shape of mean and stdDev info.
OcmAllocatorTypetypename
NameTypeDescription
tensorInInShape&The input tensor.
tensorOutOutShape&The output tensor.
meansChannelInfoShape&The tensor containing the mean info for each channel.
stdDevsChannelInfoShape&The tensor containing the standard deviation info for each channel.
ocmMemAllocOcmAllocatorType&OCM memory allocator.

INLINE void — void

Sign in to your account

Don't have an account? 
By signing in, you are agreeing to our Terms of Use and Privacy Policy.
Quadric // One architecture. Every algorithm.

Develop.

Simulate.

Profile.

Collaborate.