def forward(self, x):
if self.deep:
x = x.view(-1, 28*28)
for fc in self.fcs[:-1]:
x = F.relu(fc(x))
x = self.fcs[-1](x)
return F.log_softmax(x)
else:
x = x.view(-1, 28*28)
x = F.relu(self.fc1(x))
x = F.relu(self.fc2(x))
x = F.relu(self.fc3(x))
x = F.relu(self.fc4(x))
x = self.fc5(x)
return F.log_softmax(x)
backpropagation.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录