主要内容

spaceToDepthLayer

Space to depth layer

Description

A space to depth layer permutes the spatial blocks of the input into the depth dimension. Use this layer when you need to combine feature maps of different size without discarding any feature data.

Given an input feature map of size [HWC] and blocks of size [heightwidth], the output feature map size is [地面(H/height)地面(W/width)C*height*width].

This object requires Deep Learning Toolbox™.

Creation

Description

layer = spaceToDepthLayer(blockSize)creates a space to depth layer, specifying the block size to reorder the input activation. TheblockSizeinput sets theBlockSizeproperty.

example

layer = spaceToDepthLayer(blockSize,'Name',Name)creates a space to depth layer and sets the optionalNameproperty.

Properties

expand all

Block size to reorder the input activation, specified as a vector of two positive integers[h w], whereh是高度和wis the width. When creating the layer, you can specifyBlockSize作为标量,可以在两个维度上使用相同的值。

Example:[2 1]specifies blocks of height 2 and width 1.

图层名称,指定为字符向量或字符串标量。为了Layerarray input, thetrainNetwork,汇编工作,LayerGraph, 和dlnetwork功能自动将名称分配给图层Nameset to''.

Data Types:char|string

This property is read-only.

该层的输入数量。该层仅接受单个输入。

Data Types:double

This property is read-only.

Input names of the layer. This layer accepts a single input only.

Data Types:cell

This property is read-only.

Number of outputs of the layer. This layer has a single output only.

Data Types:double

This property is read-only.

层的输出名称。该层仅具有单个输出。

Data Types:cell

Examples

collapse all

指定块大小以重新排序输入激活。

blockSize = [2 2];

Create a space to depth layer named'spacetodepth'.

layer = spaceToDepthLayer(blockSize,'Name','spacetodepth')
layer = SpaceToDepthLayer with properties: Name: 'spacetodepth' BlockSize: [2 2] Learnable Parameters No properties. State Parameters No properties. Show all properties

Extended Capabilities

GPU Arrays
使用并行计算工具箱™在图形处理单元(GPU)上运行加速代码。

See Also

(Computer Vision Toolbox)|(Computer Vision Toolbox)|||

Topics

Introduced in R2020b