2020
10-08
10-08
pytorch 计算ConvTranspose1d输出特征大小方式
问题:如何经过convTransposed1d输出指定大小的特征?importtorchfromtorchimportnnimporttorch.nn.functionalasFconv1=nn.Conv1d(1,2,3,padding=1)conv2=nn.Conv1d(in_channels=2,out_channels=4,kernel_size=3,padding=1)#转置卷积dconv1=nn.ConvTranspose1d(4,1,kernel_size=3,stride=2,padding=1,output_padding=1)x=torch.randn(16,1,8)print(x.size())x1=conv1(x)x2=conv2(x1)print(x2.size...
继续阅读 >