code: def perform_learning_step(epoch):
      """Makes an action according to eps-greedy policy, observes the result
      (next state, reward) and learns from the transition"""
  
      def exploration_rate(epoch):
          """# Define exploration rate change over time"""
          start_eps = 1.0
          end_eps = 0.1
          const_eps_epochs = 0.1 * epochs  # 10% of learning time
          eps_decay_epochs = 0.6 * epochs  # 60% of learning time
  
          if epoch < const_eps_epochs:
              return start_eps
          elif epoch < eps_decay_epochs:
              # Linear decay
              return start_eps - (epoch - const_eps_epochs) / (
                  eps_decay_epochs - const_eps_epochs
              ) * (start_eps - end_eps)
          else:
              return end_eps
  
      s1 = preprocess(game.get_state().screen_buffer)
  
      # With probability eps make a random action.
      eps = exploration_rate(epoch)
      if random() <= eps:
          a = randint(0, len(actions) - 1)
      else:
          # Choose the best action according to the network.
          a = get_best_action(s1)
      reward = game.make_action(actions[a], frame_repeat)
  
      isterminal = game.is_episode_finished()
      s2 = (
          preprocess(game.get_state().screen_buffer)
          if not isterminal
          else None
      )
  
      # Remember the transition that was just experienced.
      memory.add_transition(s1, a, s2, isterminal, reward)
  
      learn_from_memory()
  
imports: import itertools
  import pickle
  from random import randint, random, sample
  from time import sleep, time
  import numpy
  import skimage.color
  import skimage.transform
  import theano
  from lasagne.init import Constant, HeUniform
  from lasagne.layers import Conv2DLayer, DenseLayer, InputLayer, get_all_param_values, get_all_params, get_output, set_all_param_values
  from lasagne.nonlinearities import rectify
  from lasagne.objectives import squared_error
  from lasagne.updates import rmsprop
  from theano import tensor
  from tqdm import trange
  from vizdoom import DoomGame, Mode, ScreenFormat, ScreenResolution, os, vzd
label_desc: Use image node_id 4 for calling a global function with example usage: perform_learning_step(epoch) and returns: start_eps, unknown, end_eps