예제 #1
0
 def forward(self, x):
     x = self.c1(x)
     x = self.stage1(x)
     x = self.stage2(x)
     x = self.stage3(x)
     x = self.stage4(x)
     x = self.bn1(x)
     x = M.flatten(x)
     x = F.dropout(x, 0.4, self.training, False)
     x = self.fc1(x)
     return x
예제 #2
0
파일: resnet.py 프로젝트: ddddwee1/TorchSUL
 def forward(self, x):
     x = self.c1(x)
     x = self.stage1(x)
     x = self.stage2(x)
     x = self.stage3(x)
     x = self.stage4(x)
     x = self.bn1(x)
     x = M.flatten(x)
     x = F.dropout(x, 0.4, self.training, False)
     res = []
     for fc in self.fcs:
         res.append(fc(x))
     x = torch.cat(res, dim=1)
     return x
예제 #3
0
 def forward(self, x):
     x = self.body(x)
     x = M.flatten(x)
     feat = self.fc1(x)
     return feat