def reduct(self, x):
h = F.relu(self.conv1_1(x))
h = F.relu(self.bn1(self.conv1_2(h)))
# 100 -> 50
h = F.max_pooling_2d(h, 2, stride=2)
h = F.relu(self.conv2_1(h))
h = F.relu(self.bn2(self.conv2_2(h)))
# 50 -> 25
h = F.max_pooling_2d(h, 2, stride=2)
h = F.relu(self.conv3_1(h))
h = F.relu(self.bn3(self.conv3_2(h)))
# 25 -> (25 + 1 * 2 - 3) / 3 + 1 = 9
h = F.max_pooling_2d(h, 3, stride=3, pad=1)
h = F.relu(self.conv4_1(h))
h = F.relu(self.bn4(self.conv4_2(h)))
# 9 -> 1
h = F.average_pooling_2d(h, 9, stride=1)
return h
cnn_feature_extractors.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录