MCPcopy Create free account
hub / github.com/pytorch/tutorials / stn

Method stn

intermediate_source/spatial_transformer_tutorial.py:124–133  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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

Callers 2

forwardMethod · 0.95
visualize_stnFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected