def __lstm_cell(self, cell_dim, num_multi_cells): #TODO:old # cells = [tf.contrib.rnn.core_rnn_cell.LSTMCell(cell_dim, use_peepholes=True, forget_bias=0., # initializer=tf.random_uniform_initializer(-0.01, 0.01)) # for _ in range(num_multi_cells)] # # drop_cells = [tf.contrib.rnn.core_rnn_cell.DropoutWrapper(cell, # input_keep_prob=self.keep_prob, # output_keep_prob=self.keep_prob) for cell in cells] # multi_cell = tf.contrib.rnn.core_rnn_cell.MultiRNNCell(drop_cells) # return multi_cell #TODO:multi cell cells = [ rnn.ConvLSTMCell([None, 7, 7, cell_dim], [5, 5], use_peepholes=True, forget_bias=0., initializer=tf.random_uniform_initializer( -0.01, 0.01)) for _ in xrange(num_multi_cells) ] multi_cell = rnn.MultiRNNCell(cells) return multi_cell # TODO:single cell # cell = rnn.ConvLSTMCell([None, 7, 7, cell_dim], [3, 3], use_peepholes=True, forget_bias=0., # initializer=tf.random_uniform_initializer(-0.01, 0.01)) return cell
def __lstm_cell(self, cell_dim, num_multi_cells): cells = [rnn.ConvLSTMCell([None, 7, 7, cell_dim], [5, 5], use_peepholes=True, forget_bias=0., initializer=tf.random_uniform_initializer(-0.01, 0.01)) for _ in xrange(num_multi_cells)] multi_cell = rnn.MultiRNNCell(cells) return multi_cell return cell