在深度学习模型中,卷积层绝对是最常见的基本操作,因此学习卷积操作很重要。 卷积运算是一种线性变换,是一种稀疏连接的线性变换(一种紧密连接的线性变换,即与全连接不同的线性转换层)。
卷积运算的运算包含两个dldyg
第一个dldyg是输入dldyg,第二个是线性变换权重dldyg (也称为卷积核或滤波器) Pytorch,卷积操作主要可以分为两类,第一类是常规卷积操作,第二类是反卷积。 这两种卷积分别有三个子类:一维卷积和二维卷积的三维卷积。 卷积内核卷积有一个通用的父类: _ConvNd类。 该类是隐藏的,具体代码位于torch/nn/modules/conv.py文件夹下。
_ConvNd父类# _ConvNd父类class_convnd(in_channels,out_channels,kernel_size,stride,padding,dilation ) padding _ mode (http://www.Sina.com/controlsthestrideforthecross-correlation.http://www.Sina.com/controlstheamountofimplicitzero-paddingsonbothsidesfordilation (kernel size1) p a d d i n g dilation * -(Kernel_size-1 )-paddingdilation(Kernelsize1) paddingnumberofpoints.seenotebelowfordetails.3358 www.Sina . theoutputshape.seenotebelowfordetails.http://www.Sina.com/controlsthespacingback alsoknownasthetrous algorithm.itishs utthislinkhasanicevisualizationofwhatdilationdoes.http://www.Sina.com/controlstheconnectionsbetweeninputsandoutputs.iiiiouts
卷积操作# nn.Conv2d卷积classtorch.nn.conv 2d (in _ channels,out_channels,kernel_size,stride=1,padding=0
卷积操作# nn.ConvTranspose2d反卷积torch.nn.conv transpose 2d (in _ channels 3360 int,out_channels : int,kernel _ sisinel bias : bool=True,dilation : iion,其中填充: union [ t,Tuple[T,t]=0,output_padding: Union[T,t ]