def build_graph(self):
with tf.variable_scope('lstm'):
lstm_cell = LSTMCell(self.layer_size)
rnn_cell = MultiRNNCell([lstm_cell] * self.layers)
cell_output, self.init_state = rnn_cell(self.model_input, self.init_state)
print("%i layers created" % self.layers)
self.output_layer = self.__add_output_layer("fc_out", cell_output, self.layer_size, self.output_dim)
self.output_layer = tf.Print(self.output_layer, [self.output_layer, tf.convert_to_tensor(self.ground_truth)],
'Value of output layer and ground truth:', summarize=6)
tf.histogram_summary('lstm_output', self.output_layer)
return self.output_layer
评论列表
文章目录