最新网址:www.kushuxs.net
从前有座山,叫巴里赫德,他一个当一座山,十分的爽。哎,想不到吧。
这个山里面有树林,有庙,有这个山里灵活的狗。山上有棵树,这棵树不叫高树,因为这个梗太老了。这棵树的形状有些奇特,大概就长这个样子。
import torch
from torch import nn
import torch.nn.functional as F
import os
import tensorboardX
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class VGGBaseSimpleS2(nn.Module):
def __init__(self):
super(VGGBaseSimpleS2, self).__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(1, 12, kernel_size=3, stride=1, padding=1),
#nn.BatchNorm2d(16),
nn.ReLU()
)
# 6*6
self.max_pooling1 = nn.MaxPool2d(kernel_size=2, stride=1)
# 5*5
self.conv2_1 = nn.Sequential(
nn.Conv2d(12, 24, kernel_size=3, stride=1, padding=1),
nn.ReLU()
)
self.max_pooling2_1 = nn.MaxPool2d(kernel_size=2, stride=1)
# 4*4
self.conv2_2 = nn.Sequential(
nn.Conv2d(24, 24, kernel_size=3, stride=1, padding=1),
nn.ReLU()
)
self.max_pooling2 = nn.MaxPool2d(kernel_size=2, stride=2)
# 2*2
# 2*2
self.fc = nn.Linear(24*2*2, 2)
def forward(self, x):
batchsize = x.size(0)
out = self.conv1(x)
out = self.max_pooling1(out)
out = self.conv2_1(out)
out = self.conv2_2(out)