TransposedConvolution3dLayer
Transposed 3-D convolution layer
Description
A transposed 3-D convolution layer upsamples three-dimensional feature maps.
该层有时被错误地称为“反卷积”或“ deconv”层。该层是卷积的转置,不执行反卷积。
创建
Create a transposed convolution 3-D layer using转置Conv3dLayer
。
特性
转置卷积
过滤
—过滤器的高度,宽度和深度
三个正整数的向量
过滤器的高度,宽度和深度,指定为矢量[h w d]
在三个积极整数中h
是高度,w
是宽度,d
是深度。过滤
定义神经元在输入中连接的局部区域的大小。
When creating the layer, you can specify过滤
as a scalar to use the same value for the height, width, and depth.
Example:[5 5 5]
指定高度,宽度和深度为5的过滤器。
数字
—Number of filters
正整数
This property is read-only.
Number of filters, specified as a positive integer. This number corresponds to the number of neurons in the layer that connect to the same region in the input. This parameter determines the number of channels (feature maps) in the layer output.
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
大步
—Step size for traversing input
[1 1 1]
(默认)|三个正整数的向量
用于遍历三维输入的步长,指定为向量[a b c]
在三个积极整数中a
is the vertical step size,b
is the horizontal step size, andc
is the step size along the depth. When creating the layer, you can specify大步
作为标量,可以在所有三个方向上使用相同的阶跃大小。
Example:[2 3 1]
指定垂直步长为2,水平步长为3,沿1的深度为步长。
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
裁切模式
—Method to determine cropping size
'手动的'
(默认)|'相同的'
Method to determine cropping size, specified as'手动的'
或者'相同的'
。
该软件会自动设置裁切模式
based on the'Cropping'
value you specify when creating the layer.
如果您设置
种植
数值值的选项,然后软件自动设置裁切模式
property of the layer to'手动的'
。如果您设置
'Cropping'
option to'相同的'
,然后software automatically sets the裁切模式
property of the layer to'相同的'
并设置裁剪以使输出尺寸等于inputSize .* Stride
, whereinputSize
是层输入的高度,宽度和深度。
To specify the cropping size, use the'Cropping'
option of转置Conv3dLayer
。
裁切
—Output size reduction
[0 0 0;0 0 0]
(默认)|matrix of nonnegative integers
Output size reduction, specified as a matrix of nonnegative integers[t l f; b r bk]
,t
,l
,f
,b
,r
,bk
are the amounts to crop from the top, left, front, bottom, right, and back of the input, respectively.
To specify the cropping size manually, use the'Cropping'
option oftransposedconv2dlayer
。
Example:[0 1 0 1 0 1]
NumChannels
—Number of input channels
'auto'
(默认)|正整数
This property is read-only.
Number of input channels, specified as one of the following:
'auto'
— Automatically determine the number of input channels at training time.Positive integer — Configure the layer for the specified number of input channels.
NumChannels
和the number of channels in the layer input data must match. For example, if the input is an RGB image, thenNumChannels
must be 3. If the input is the output of a convolutional layer with 16 filters, thenNumChannels
必须是16。
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
|char
|细绳
Parameters and Initialization
WeightsInitializer
—Function to initialize weights
'glorot'
(默认)|'he'
|“窄正常”
|'zeros'
|'ones'
|function handle
Function to initialize the weights, specified as one of the following:
'glorot'
– Initialize the weights with the Glorot initializer[1](also known as Xavier initializer). The Glorot initializer independently samples from a uniform distribution with zero mean and variance2/(numIn + numOut)
, wherenumIn = FilterSize(1)*FilterSize(2)*FilterSize(3)*NumChannels
和numOut = filtersize(1)*filtersize(2)*filtersize(3)*numfilters
。'he'
– Initialize the weights with the He initializer[2]。来自均值和方差的正态分布的HE初始化样品样本2/numIn
, wherenumIn = FilterSize(1)*FilterSize(2)*FilterSize(3)*NumChannels
。“窄正常”
– Initialize the weights by independently sampling from a normal distribution with zero mean and standard deviation 0.01.'zeros'
– Initialize the weights with zeros.'ones'
– Initialize the weights with ones.功能处理 - 使用自定义功能初始化权重。如果指定函数句柄,则该函数必须是表单的
weights = func(sz)
, whereSZ
is the size of the weights. For an example, see指定自定义重量初始化功能。
该层仅在Weights
property is empty.
Data Types:char
|细绳
|function_handle
双重化器
—功能初始化偏差
'zeros'
(默认)|“窄正常”
|'ones'
|function handle
Function to initialize the bias, specified as one of the following:
'zeros'
- 初始化零的偏差。'ones'
- 用一个初始化偏见。“窄正常”
- 通过从平均值为零和标准偏差为0.01的正态分布中独立采样来初始化偏差。Function handle — Initialize the bias with a custom function. If you specify a function handle, then the function must be of the form
偏见= func(sz)
, whereSZ
是偏见的大小。
The layer only initializes the bias when the偏见
property is empty.
Data Types:char
|细绳
|function_handle
Weights
—层weights
[]
(默认)|数字阵列
层weights for the transposed convolutional layer, specified as a numeric array.
层权重是可学习的参数。您可以使用该权重指定权重的初始值Weights
层的属性。When you train a network, if theWeights
该层的属性是非空的,然后trainNetwork
使用Weights
属性作为初始值。如果theWeights
property is empty, thentrainNetwork
使用由WeightsInitializer
层的属性。
At training time,Weights
是一个过滤(1)
-by-过滤(2)
-by-过滤(3)
-by-数字
-by-NumChannels
array.
Data Types:单身的
|double
偏见
—层biases
[]
(默认)|数字阵列
层的层偏置,用于指定为数字阵列的转置卷积层。
The layer biases are learnable parameters. When you train a network, if偏见
那是非空的trainNetwork
使用偏见
属性作为初始值。如果偏见
is empty, thentrainNetwork
使用由双重化器
。
At training time,偏见
是一个1-by-1-by-1-by-数字
array.
Data Types:单身的
|double
Learning Rate and Regularization
重量应培训
—Learning rate factor for weights
1
(默认)|nonnegative scalar
权重的学习率因子,指定为非负标量。
该软件将该因素乘以全局learning rate to determine the learning rate for the weights in this layer. For example, if重量应培训
is2
,然后learning rate for the weights in this layer is twice the current global learning rate. The software determines the global learning rate based on the settings you specify using the训练
function.
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
偏见LearnRateFactor
—学习速率因子偏见
1
(默认)|nonnegative scalar
Learning rate factor for the biases, specified as a nonnegative scalar.
该软件将该因素乘以全球学习率,以确定该层中偏见的学习率。例如,如果偏见LearnRateFactor
is2
的学习速率,然后biases in the layer is twice the current global learning rate. The software determines the global learning rate based on the settings you specify using the训练
function.
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
举重2因子
—L2重量正规化因子
1(默认)|nonnegative scalar
L2权重的正则化因子,指定为非负标量。
该软件将该因素乘以全局L2regularization factor to determine theL2regularization for the weights in this layer. For example, if举重2因子
is2
,然后L2regularization for the weights in this layer is twice the globalL2regularization factor. You can specify the globalL2使用的正规化因子使用训练
function.
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
偏见L2Factor
—L2偏差的正则化因子
0
(默认)|nonnegative scalar
L2regularization factor for the biases, specified as a nonnegative scalar.
该软件将该因素乘以全局L2regularization factor to determine theL2regularization for the biases in this layer. For example, if偏见L2Factor
is2
,然后L2regularization for the biases in this layer is twice the globalL2regularization factor. You can specify the globalL2使用的正规化因子使用训练
function.
Data Types:单身的
|double
|int8
|int16
|int32
|int64
|UINT8
|uint16
|UINT32
|Uint64
层
姓名
—层name
''
(默认)|character vector|字符串标量
层name, specified as a character vector or a string scalar. For层
数组输入,trainNetwork
,assembleNetwork
,LayerGraph
, 和dlnetwork
functions automatically assign names to layers with name''
。
Data Types:char
|细绳
NumInputs
—Number of inputs
1
(default)
This property is read-only.
Number of inputs of the layer. This layer accepts a single input only.
Data Types:double
InputNames
—输入名称
{'在'}
(default)
This property is read-only.
层的输入名称。该层仅接受单个输入。
Data Types:cell
NumOutputs
—输出数量
1
(default)
This property is read-only.
输出数量of the layer. This layer has a single output only.
Data Types:double
OutputNames
—Output names
{'出去'}
(default)
This property is read-only.
层的输出名称。该层仅具有单个输出。
Data Types:cell
Examples
创建转置的3D卷积层
创建一个带有32滤波器的转置3D卷积层,每个卷积层的高度,宽度和深度为11。在水平和垂直方向上使用4步,沿深度2。
layer = transposedConv3dLayer(11,32,'Stride',[4 4 2])
layer = TransposedConvolution3DLayer with properties: Name: '' Hyperparameters FilterSize: [11 11 11] NumChannels: 'auto' NumFilters: 32 Stride: [4 4 2] CroppingMode: 'manual' CroppingSize: [2x3 double] Learnable Parameters Weights: [] Bias: [] Show all properties
算法
3-D转置卷积层
A transposed 3-D convolution layer upsamples three-dimensional feature maps.
Thestandardconvolution operationdownsamples通过将滑动卷积过滤器应用于输入来输入。通过扁平输入和输出,您可以将卷积操作表示为 for the convolution matrixC和biasB可以从层的重量和偏见中得出。
Similarly, the转置convolution operation示例通过将滑动卷积过滤器应用于输入来输入。To upsample the input instead of downsampling using sliding filters, the layer zero-pads each edge of the input with padding that has the size of the corresponding filter edge size minus 1.
通过平移输入和输出,转置卷积操作等同于 , whereC和B分别表示从层的权重和偏见得出的标准卷积的卷积和偏置矩阵。该操作等同于标准卷积层的向后功能。
References
[1] Glorot, Xavier, and Yoshua Bengio. "Understanding the Difficulty of Training Deep Feedforward Neural Networks." In第十三国际人工智能与统计会议论文集, 249–356. Sardinia, Italy: AISTATS, 2010.
[2] He, Kaiming, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification." InProceedings of the 2015 IEEE International Conference on Computer Vision, 1026–1034. Washington, DC: IEEE Computer Vision Society, 2015.
Version History
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
您还可以从以下列表中选择一个网站:
如何获得最佳网站性能
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)