import tensorflow as tf

        return tf.contrib.layers.batch_norm(inputs=x, 
                                            decay=0.95,
                                            center=True,
                                            scale=True,
                                            is_training=(mode=='train'),
                                            updates_collections=None,
                                            scope=(name+'batch_norm'))

    def build_model(self):
        features = self.features
        captions = self.captions
        batch_size = tf.shape(features)[0]

        captions_in = captions[:, :self.T]      
        captions_out = captions[:, 1:]  
        mask = tf.to_float(tf.not_equal(captions_out, self._null))
        
        
        # batch normalize feature vectors
        features = self._batch_norm(features, mode='train', name='conv_features')
        
        c, h = self._get_initial_lstm(features=features)
        x = self._word_embedding(inputs=captions_in)
        features_proj = self._project_features(features=features)

        loss = 0.0
        alpha_list = []
        lstm_cell = tf.contrib.rnn.BasicLSTMCell(num_units=self.H)

        for t in range(self.T):
