PyTorch深度学习实践(10. Basic CNN-3)

源自课程:《PyTorch深度学习实践》完结合集

Chapter10 卷积神经网络(基础篇)

import torch

input = [3, 4, 6, 5,
         2, 4, 6, 8,
         1, 6, 7, 8,
         9, 7, 4, 6]

input = torch.Tensor(input).view(1, 1, 4, 4)

maxpooling_layer = torch.nn.MaxPool2d(kernel_size=2)

output = maxpooling_layer(input)
print(output)

你可能感兴趣的:(深度学习,pytorch,cnn)