(self, x)
| 122 | |
| 123 | # Spatial transformer network forward function |
| 124 | def stn(self, x): |
| 125 | xs = self.localization(x) |
| 126 | xs = xs.view(-1, 10 * 3 * 3) |
| 127 | theta = self.fc_loc(xs) |
| 128 | theta = theta.view(-1, 2, 3) |
| 129 | |
| 130 | grid = F.affine_grid(theta, x.size()) |
| 131 | x = F.grid_sample(x, grid) |
| 132 | |
| 133 | return x |
| 134 | |
| 135 | def forward(self, x): |
| 136 | # transform the input |
no outgoing calls
no test coverage detected