2D池化IPoolingLayer

2D池化IPoolingLayer

IPooling层在通道内实现池化。支持的池类型为最大, 平均 和 最大平均混合。

层描述:二维池化

使用张量上的2D滤波器计算池化a tensor A, of dimensions a, to produce a tensor B, of dimensions b。b的尺寸取决于 尺寸, 视窗大小 R,对称填充 p ,stride大小 s 这样:

  • b = [a0a1...an-3bn-2bn-1]
  • bn-2 = (an-2+2p0-r0)/s0+1
  • bn-1 = (an-1+2p1-r1)/s1+1

张量 C 是A with dimensions[a0a1...an-2+2p0an-1+2p1]零填充copy。Bj......kl= func(Cj…. k:kk l:ll) wherekk = k+r0-1,andll = l+r1-1 Func是一种池化类型

PoolingType::kMAX

窗口中元素的最大值。

Maximum over elements in window.

PoolingType::kAVERAGE

窗口中元素的平均值。

Average over elements in the window.

PoolingType::kMAX_AVERAGE_BLEND

最大池和平均池的混合。最大合并和平均合并的结果与混合因子组合为

(1-blendFactor)*maximumPoolingResult + blendFactor*averagePoolingResult to yield the result. The blendFactor can be set to a value between 0 and 1.

blendFactor可以被设置为0和1之间的值。

默认情况下,对池化窗口和填充的输入之间的重叠执行平均池化。如果互斥参数设置为true,则对池化窗口和未填充输入之间的重叠区域执行平均池化。

层描述:3D池化

使用张量上的3D滤镜计算池化 a tensor A, of dimensions a, to produce a tensor B, of dimensions b。b的尺寸 取决于a尺寸,视窗大小 R,对称填充 p ,步长 s 这样:

  • b = [a0a1...an-4bn-3bn-2bn-1]
  • bn-3 = (an-3+2p0-r0)/s0+1
  • bn-2 = (an-2+2p1-r1)/s1+1
  • bn-1 = (an-1+2p2-r2)/s2+1

设张量 C 是A with dimensions [a0a1... an-3+2p0an-2+2p1an-1+2p2]的零填充copy。 一其中,Bj......klm= func(Cj…. k:kk l:ll m:mm) wherekk = k+r0-1,ll = l+r1-1, andmm = m+r2-1

 func 由池化类型之一t定义 :

oolingType::kMAX

窗口中元素的最大值。

Maximum over elements in window.

PoolingType::kAVERAGE

窗口中元素的平均值。

Average over elements in the window.

PoolingType::kMAX_AVERAGE_BLEND

最大池和平均池的混合。最大合并和平均合并的结果与混合因子组合为

 (1-blendFactor)*maximumPoolingResult + blendFactor*averagePoolingResult to yield the result. The blendFactor can be set to a value between 0 and 1.

blendFactor可以被设置为0和1之间的值

默认情况下,对池化窗口和填充的输入之间的重叠执行平均池化。如果互斥参数设置为true,则对池化窗口和未填充输入之间的重叠区域执行平均池化。

条件与限制

2D或3D由输入内核尺寸的数量确定。对于2D合并,输入和输出张量应具有3个或更大的尺寸。对于3D池,输入和输出张量应具有4个或更大的尺寸。

参阅C ++类 IPooling层Python类 IPooling层 有关更多详细信息。

人工智能芯片与自动驾驶
原文地址:https://www.cnblogs.com/wujianming-110117/p/14154565.html