(self, x)
| 51 | |
| 52 | # Spatial transformer network forward function |
| 53 | def stn_ref(self, x): |
| 54 | xs = self.localization(x) |
| 55 | xs = xs.view(-1, 10 * 3 * 3) |
| 56 | theta = self.fc_loc(xs) |
| 57 | theta = theta.view(-1, 2, 3) |
| 58 | |
| 59 | grid = F.affine_grid(theta, x.size(), align_corners=False) |
| 60 | x = F.grid_sample(x, grid, align_corners=False) |
| 61 | return x |
| 62 | |
| 63 | def stn(self, x): |
| 64 | xs = self.localization(x) |