code: def __init__(self):
      super(Net, self).__init__()
  
      ## 1. Localisation network
      # use MLP as the localisation net
      self.flatten1 = Flatten()
      self.dense1 = Dense(n_units=20, in_channels=1600, act=tf.nn.tanh)
      self.dropout1 = Dropout(keep=0.8)
      # you can also use CNN instead for MLP as the localisation net
  
      ## 2. Spatial transformer module (sampler)
      self.stn = SpatialTransformer2dAffine(
          out_size=(40, 40), in_channels=20
      )
  
      ## 3. Classifier
      self.conv1 = Conv2d(
          16,
          (3, 3),
          (2, 2),
          act=tf.nn.relu,
          padding="SAME",
          in_channels=1,
      )
      self.conv2 = Conv2d(
          16,
          (3, 3),
          (2, 2),
          act=tf.nn.relu,
          padding="SAME",
          in_channels=16,
      )
      self.flatten2 = Flatten()
      self.dense2 = Dense(
          n_units=1024, in_channels=1600, act=tf.nn.relu
      )
      self.dense3 = Dense(n_units=10, in_channels=1024, act=tf.identity)
  
file_path: TensorLayer/examples/spatial_transformer_network/tutorial_spatial_transformer_network_dynamic.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 1 to create a new Net object from inherited base classes: Model with example: obj = Net()