|
9 | 9 | In this tutorial, you will learn how to augment your network using |
10 | 10 | a visual attention mechanism called spatial transformer |
11 | 11 | networks. You can read more about the spatial transformer |
12 | | -networks in `DeepMind paper <https://arxiv.org/abs/1506.02025>`__ |
| 12 | +networks in the `DeepMind paper <https://arxiv.org/abs/1506.02025>`__ |
13 | 13 |
|
14 | 14 | Spatial transformer networks are a generalization of differentiable |
15 | 15 | attention to any spatial transformation. Spatial transformer networks |
16 | | -(STN for short) allows a neural network to learn how to do spatial |
17 | | -transformations to the input image in order to enhance the geometric |
| 16 | +(STN for short) allow a neural network to learn how to perform spatial |
| 17 | +transformations on the input image in order to enhance the geometric |
18 | 18 | invariance of the model. |
19 | | -For example it can crop a region of interest, scale and correct |
20 | | -the orientation of an image. It can be a useful mechanism because CNN |
21 | | -are not invariant to rotation and scale and more generally : affine |
| 19 | +For example, it can crop a region of interest, scale and correct |
| 20 | +the orientation of an image. It can be a useful mechanism because CNNs |
| 21 | +are not invariant to rotation and scale and more general affine |
22 | 22 | transformations. |
23 | 23 |
|
24 | 24 | One of the best things about STN is the ability to simply plug it into |
25 | | -any existing CNN with very little modifications. |
| 25 | +any existing CNN with very little modification. |
26 | 26 | """ |
27 | 27 | # License: BSD |
28 | 28 | # Author: Ghassen Hamrouni |
|
76 | 76 | # the spatial transformations that enhances the global accuracy. |
77 | 77 | # - The grid generator generates a grid of coordinates in the input |
78 | 78 | # image corresponding to each pixel from the output image. |
79 | | -# - The sampler uses the parameters of the transformation and apply |
| 79 | +# - The sampler uses the parameters of the transformation and applies |
80 | 80 | # it to the input image. |
81 | 81 | # |
82 | 82 | # .. figure:: /_static/img/stn/stn-arch.png |
@@ -133,7 +133,7 @@ def forward(self, x): |
133 | 133 | # transform the input |
134 | 134 | x = self.stn(x) |
135 | 135 |
|
136 | | - # Perform the usual froward pass |
| 136 | + # Perform the usual forward pass |
137 | 137 | x = F.relu(F.max_pool2d(self.conv1(x), 2)) |
138 | 138 | x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2)) |
139 | 139 | x = x.view(-1, 320) |
|
0 commit comments