I just try an example without adding localization network but a pre-defined parameters for transformation. I think it’s straight forward to be modified.

  
      github.com
  
  
    YongyiTang92/pytorch-tutorial/blob/master/tutorials/05-mytest/STN_test.ipynb 234
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Pytorch spatial tranformer Example\n",
    "See also https://github.com/fxia22/stn.pytorch\n",
    "Note that torch.nn.functional.affine_grid and torch.nn.functional.grid_sample only in Pytorch v0.2.0 or above"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",


  This file has been truncated. show original