code/char_model.py
def add_placeholders(self):
        """
        Add placeholders to the graph. Placeholders are used to feed in inputs.
        """
        # Add placeholders for inputs.
        # These are all batch-first: the None corresponds to batch_size and
        # allows you to run the same model with variable batch_size
        self.context_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len])
        self.context_mask = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len])
        self.qn_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len])
        self.qn_mask = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len])
        self.ans_span = tf.placeholder(tf.int32, shape=[None, 2])

        # Add a placeholder to feed in the keep probability (for dropout).
        # This is necessary so that we can instruct the model to use dropout when training, but not when testing
        self.keep_prob = tf.placeholder_with_default(1.0, shape=())

        # Chars
        self.context_char_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len, self.FLAGS.char_limit])
        # self.context_char_masks = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len, self.FLAGS.char_limit])
        self.qn_char_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len, self.FLAGS.char_limit])
        # self.qn_char_masks = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len, self.FLAGS.char_limit])

        Add placeholders to the graph. Placeholders are used to feed in inputs.
        
Add placeholders to the graph. Placeholders are used to feed in inputs.
Add placeholders to the graph . Placeholders are used to feed in inputs .
def add_placeholders(self):
        self.context_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len])
        self.context_mask = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len])
        self.qn_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len])
        self.qn_mask = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len])
        self.ans_span = tf.placeholder(tf.int32, shape=[None, 2])
        self.keep_prob = tf.placeholder_with_default(1.0, shape=())
        self.context_char_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len, self.FLAGS.char_limit])
        self.qn_char_ids = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len, self.FLAGS.char_limit])
def add_placeholders ( self ) : self . context_ids = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . context_len ] ) self . context_mask = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . context_len ] ) self . qn_ids = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . question_len ] ) self . qn_mask = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . question_len ] ) self . ans_span = tf . placeholder ( tf . int32 , shape = [ None , 2 ] ) self . keep_prob = tf . placeholder_with_default ( 1.0 , shape = ( ) ) self . context_char_ids = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . context_len , self . FLAGS . char_limit ] ) self . qn_char_ids = tf . placeholder ( tf . int32 , shape = [ None , self . FLAGS . question_len , self . FLAGS . char_limit ] )
Add placeholders to the graph.
Add placeholders to the graph .
"""
        Add placeholders to the graph. Placeholders are used to feed in inputs.
        """ # Add placeholders for inputs. # These are all batch-first: the None corresponds to batch_size and # allows you to run the same model with variable batch_size # Add a placeholder to feed in the keep probability (for dropout). # This is necessary so that we can instruct the model to use dropout when training, but not when testing # Chars # self.context_char_masks = tf.placeholder(tf.int32, shape=[None, self.FLAGS.context_len, self.FLAGS.char_limit]) # self.qn_char_masks = tf.placeholder(tf.int32, shape=[None, self.FLAGS.question_len, self.FLAGS.char_limit])
self