title: How does Spatial Transform Network LEARN to transform images appropriately?
body: <p>After reading this <a href="https://kevinzakka.github.io/2017/01/18/stn-part2/" rel="nofollow noreferrer">post</a>, I sort of understand how the network transforms images; however, I cannot get how it actually <strong>LEARNS</strong> which orientation is helpful for a subsequent classification step.</p>
  <p>Almost at the end of the post and <a href="https://pytorch.org/tutorials/intermediate/spatial_transformer_tutorial.html" rel="nofollow noreferrer">PyTorch's STN tutorial</a> , they show how STN rotates and translates images for better classification performance.</p>
  <p>Is it solely based on a training set? Like, if a majority of images tend to have a certain orientation, let's say rotated by 20 deg, do the network learn to rotate unrotated images?</p>