code: def create_VIN(
      input_image_shape=(8, 8, 2),
      n_hidden_filters=150,
      n_state_filters=10,
      k=10,
  ):
      # Default initialization method
      normal = init.Normal()
  
      # Create shared weights
      q_weight = create_random_weight((3, 3, 1, n_state_filters))
      fb_weight = create_random_weight((3, 3, 1, n_state_filters))
  
      # Define basic layers
      SamePadConv = partial(Convolution, padding="SAME", bias=None)
  
      R = join(
          Input(input_image_shape, name="grid-input"),
          SamePadConv(
              (3, 3, n_hidden_filters), weight=normal, bias=normal
          ),
          SamePadConv((1, 1, 1), weight=normal),
      )
      Q = R >> SamePadConv((3, 3, n_state_filters), weight=q_weight)
  
      for i in range(k):
          V = Q >> ChannelGlobalMaxPooling()
          Q = join(
              # Convolve R and V separately and then add outputs together with
              # the Elementwise layer. This part of the code looks different
              # from the one that was used in the original VIN repo, but
              # it does the same operation.
              #
              # conv(x, w) == (conv(x1, w1) + conv(x2, w2))
              # where, x = concat(x1, x2)
              #        w = concat(w1, w2)
              #
              # See code sample from Github Gist: https://bit.ly/2zm3ntN
              parallel(
                  R
                  >> SamePadConv(
                      (3, 3, n_state_filters), weight=q_weight
                  ),
                  V
                  >> SamePadConv(
                      (3, 3, n_state_filters), weight=fb_weight
                  ),
              ),
              Elementwise("add"),
          )
  
      input_state_1 = Input(UNKNOWN, name="state-1-input")
      input_state_2 = Input(UNKNOWN, name="state-2-input")
  
      # Select the conv-net channels at the state position (S1, S2)
      VIN = (
          Q | input_state_1 | input_state_2
      ) >> SelectValueAtStatePosition()
  
      # Set up softmax layer that predicts actions base on (S1, S2)
      # position. Each action encodes specific direction:
      # N, S, E, W, NE, NW, SE, SW (in the same order)
      VIN = VIN >> Softmax(8, bias=None, weight=normal)
  
      return VIN
  
imports: import os
  import argparse
  from functools import partial
  import tensorflow
  from neupy import init, algorithms, storage
  from neupy.layers import *
  from neupy.utils import as_tuple, asfloat, tf_utils, tensorflow_session
  from loaddata import load_data
  from settings import MODELS_DIR, environments
  from evaluation import evaluate_accuracy
label_desc: Use image node_id 2 for calling a global function with example usage: create_VIN(input_image_shape, n_hidden_filters, n_state_filters, k) and returns: VIN