class Classifier(nn.Module):
def __init__(self):
super(Classifier, self).__init__()
self.cnn = nn.Sequential(
nn.Conv1d(1, 64, 13, 1, 1),
nn.BatchNorm1d(64),
nn.ReLU(),
nn.MaxPool1d(3, 3, 0),
nn.Conv1d(64, 128, 3, 1, 1),
nn.BatchNorm1d(128),
nn.ReLU(),
nn.MaxPool1d(3, 3, 0),
nn.Conv1d(128, 256, 3, 1, 1),
nn.BatchNorm1d(256),
nn.ReLU(),
nn.MaxPool1d(3, 3, 0),
)
self.fc = nn.Sequential(
nn.Linear(1792, 1024),
nn.ReLU(),
nn.Linear(1024, 3)
)
def forward(self, x):
out = self.cnn(x)
out = out.view(out.size()[0], -1)
return self.fc(out)
课程PPT设计
于 2022-10-26 17:21:42 首次发布