class_docstr: Defines end to end MatchLSTM and Answer_Pointer network for Reading Comprehension
class_docstr_tok: ["Defines","end","to","end","MatchLSTM","and","Answer_Pointer","network","for","Reading","Comprehension"]
docstr: Function to create variables used for training
docstr_tok: ["Function","to","create","variables","used","for","training"]
code: def create_variables(self):
      """
      Function to create variables used for training
  
      """
      # define all variables required for training
      self.W_p = tf.get_variable(
          "W_p", [1, self.hidden_size, self.hidden_size]
      )
      self.W_r = tf.get_variable(
          "W_r", [1, self.hidden_size, self.hidden_size]
      )
      self.W_q = tf.get_variable(
          "W_q", [1, self.hidden_size, self.hidden_size]
      )
      self.w_lr = tf.get_variable("w_lr", [1, 1, self.hidden_size])
      self.b_p = tf.get_variable("b_p", [1, self.hidden_size, 1])
      self.c_p = tf.get_variable("c_p", [1])
      self.ones_vector = tf.constant(
          np.ones([1, self.max_question]), dtype=tf.float32
      )
  
      self.ones_vector_exp = tf.tile(
          tf.expand_dims(self.ones_vector, 0), [self.batch_size, 1, 1]
      )
  
      self.ones_vector_para = tf.constant(
          np.ones([1, self.max_para]), dtype=tf.float32
      )
  
      self.ones_para_exp = tf.tile(
          tf.expand_dims(self.ones_vector_para, 0),
          [self.batch_size, 1, 1],
      )
  
      self.ones_embed = tf.tile(
          tf.expand_dims(
              tf.constant(
                  np.ones([1, self.hidden_size]), dtype=tf.float32
              ),
              0,
          ),
          [self.batch_size, 1, 1],
      )
  
      self.V_r = tf.get_variable(
          "V_r", [1, self.hidden_size, 2 * self.hidden_size]
      )
      self.W_a = tf.get_variable(
          "W_a", [1, self.hidden_size, self.hidden_size]
      )
      self.b_a = tf.get_variable("b_a", [1, self.hidden_size, 1])
      self.v_a_pointer = tf.get_variable(
          "v_a_pointer", [1, 1, self.hidden_size]
      )
      self.c_pointer = tf.get_variable("c_pointer", [1, 1, 1])
      self.Wans_q = tf.get_variable(
          "Wans_q", [1, self.hidden_size, self.hidden_size]
      )
      self.Wans_v = tf.get_variable(
          "Wans_v", [1, self.hidden_size, self.hidden_size]
      )
      self.Vans_r = tf.get_variable(
          "Vans_r", [1, self.hidden_size, self.max_question]
      )
  
      self.mask_ques_mul = tf.matmul(
          tf.transpose(self.ones_embed, [0, 2, 1]),
          tf.expand_dims(self.ques_mask, 1),
      )
  
file_path: nlp-architect/examples/reading_comprehension/match_lstm_mrc/matchlstm_ansptr.py
imports: from __future__ import division
  from __future__ import print_function
  import re
  from collections import Counter
  import numpy
  import tensorflow
  from nlp_architect.utils.text import SpacyInstance
label_desc: Use image node_id 2 for calling the MatchLSTMAnswerPointer obj's underlying member method code with example usage: obj.create_variables() without return types