(self)
| 76 | lstm_cell, self.l_in_y, initial_state=self.cell_init_state, time_major=False) |
| 77 | |
| 78 | def add_output_layer(self): |
| 79 | # shape = (batch * steps, cell_size) |
| 80 | l_out_x = tf.reshape(self.cell_outputs, [-1, self.cell_size], name='2_2D') |
| 81 | Ws_out = self._weight_variable([self.cell_size, self.output_size]) |
| 82 | bs_out = self._bias_variable([self.output_size, ]) |
| 83 | # shape = (batch * steps, output_size) |
| 84 | with tf.name_scope('Wx_plus_b'): |
| 85 | self.pred = tf.matmul(l_out_x, Ws_out) + bs_out |
| 86 | |
| 87 | def compute_cost(self): |
| 88 | losses = tf.contrib.legacy_seq2seq.sequence_loss_by_example( |
no test coverage detected