木有诚意,直接贴图,都不翻一下
去chegg不香吗?为什么要来csdn。。。
1.
from torch import nn
import torch
layer=nn.Conv2d(3,4,kernel_size=(3,3),stride=(2,2),padding=(1,1),dilation=(2,2))
input=torch.ones(1,3,32,32)
print("input shape[bs,C,H,W] is:" ,input.shape)
out=layer(input)
print(out.shape)
输出结果是【4,15,15】
2.这题没给图片通道数啊,假设通道数为ch
3个卷积核参数量3x(4x4+1)=3x17=51
最大池化参数不计算为0
经过最大池化之后的特征图大小为chx4x4,也就是第一个全连接层输入为16xch,输出为5,则参数量为16xchx5 +5=80ch +5
最后一层为输入5,输出1 参数量为5x1+1=6
总参数量为51+6+5+80ch为62+80ch
3 这中题目好久没做过了,所以也不会了