23、手写并验证滑动相乘实现PyTorch二维卷积
蓝色的input_feature 5*5深蓝色小字部分kernel_size 3*3绿色部分out_feature 3*3stride = 1padding = 0channel = 1padding = 1stride = 2底部input_channels = 2顶端绿色为out_channels = 3kernels = 2*3 = 6(倒数第二行)input = input_feature_map # 卷积输入特征图
kernel = conv_layer.weight.data # 卷积核
input = torch.randn(5, 5) # 卷积输入特征图
kernel = torch.randn(3, 3) # 卷积核
bias = torch.randn(1) # 卷积偏置项,默认输出通道数目=1
# Func1 用原始的矩阵运算...