(self, x)
| 22 | self.bn5 = nn.BatchNorm1d(256) |
| 23 | |
| 24 | def forward(self, x): |
| 25 | batchsize = x.size()[0] |
| 26 | x = F.relu(self.bn1(self.conv1(x))) |
| 27 | x = F.relu(self.bn2(self.conv2(x))) |
| 28 | x = F.relu(self.bn3(self.conv3(x))) |
| 29 | x = torch.max(x, 2, keepdim=True)[0] |
| 30 | x = x.view(-1, 1024) |
| 31 | |
| 32 | x = F.relu(self.bn4(self.fc1(x))) |
| 33 | x = F.relu(self.bn5(self.fc2(x))) |
| 34 | x = self.fc3(x) |
| 35 | |
| 36 | iden = Variable(torch.from_numpy(np.array([1, 0, 0, 0, 1, 0, 0, 0, 1]).astype(np.float32))).view(1, 9).repeat( |
| 37 | batchsize, 1) |
| 38 | if x.is_cuda: |
| 39 | iden = iden.cuda() |
| 40 | x = x + iden |
| 41 | x = x.view(-1, 3, 3) |
| 42 | return x |
| 43 | |
| 44 | class STNkd(nn.Module): |
| 45 | def __init__(self, k=64): |
nothing calls this directly
no outgoing calls
no test coverage detected