(self, x)
| 61 | self.k = k |
| 62 | |
| 63 | def forward(self, x): |
| 64 | batchsize = x.size()[0] |
| 65 | x = F.relu(self.bn1(self.conv1(x))) |
| 66 | x = F.relu(self.bn2(self.conv2(x))) |
| 67 | x = F.relu(self.bn3(self.conv3(x))) |
| 68 | x = torch.max(x, 2, keepdim=True)[0] |
| 69 | x = x.view(-1, 1024) |
| 70 | |
| 71 | x = F.relu(self.bn4(self.fc1(x))) |
| 72 | x = F.relu(self.bn5(self.fc2(x))) |
| 73 | x = self.fc3(x) |
| 74 | |
| 75 | iden = Variable(torch.from_numpy(np.eye(self.k).flatten().astype(np.float32))).view(1, self.k * self.k).repeat( |
| 76 | batchsize, 1) |
| 77 | if x.is_cuda: |
| 78 | iden = iden.cuda() |
| 79 | x = x + iden |
| 80 | x = x.view(-1, self.k, self.k) |
| 81 | return x |
| 82 | |
| 83 | class pointnet_encoder(nn.Module): |
| 84 | def __init__(self): |
nothing calls this directly
no outgoing calls
no test coverage detected