code: def get_model(inputs_shape):
      ni = Input(inputs_shape)
  
      ## 1. Localisation network
      # use MLP as the localisation net
      nn = Flatten()(ni)
      nn = Dense(n_units=20, act=tf.nn.tanh)(nn)
      nn = Dropout(keep=0.8)(nn)
      # you can also use CNN instead for MLP as the localisation net
  
      ## 2. Spatial transformer module (sampler)
      stn = SpatialTransformer2dAffine(
          out_size=(40, 40), in_channels=20
      )
      nn = stn((nn, ni))
      s = nn
  
      ## 3. Classifier
      nn = Conv2d(16, (3, 3), (2, 2), act=tf.nn.relu, padding="SAME")(
          nn
      )
      nn = Conv2d(16, (3, 3), (2, 2), act=tf.nn.relu, padding="SAME")(
          nn
      )
      nn = Flatten()(nn)
      nn = Dense(n_units=1024, act=tf.nn.relu)(nn)
      nn = Dense(n_units=10, act=tf.identity)(nn)
  
      M = Model(inputs=ni, outputs=[nn, s])
      return M
  
file_path: TensorLayer/examples/spatial_transformer_network/tutorial_spatial_transformer_network_static.py
imports: import time
  import numpy
  import tensorflow
  import tensorlayer
  from tensorlayer.layers import *
  from tensorlayer.models import Model
label_desc: Use image node_id 3 for calling a global function with example usage: get_model(inputs_shape) and returns: M