MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / add_cell

Method add_cell

tensorflowTUT/tf20_RNN2.2/full_code.py:71–76  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

69 self.l_in_y = tf.reshape(l_in_y, [-1, self.n_steps, self.cell_size], name='2_3D')
70
71 def add_cell(self):
72 lstm_cell = tf.contrib.rnn.BasicLSTMCell(self.cell_size, forget_bias=1.0, state_is_tuple=True)
73 with tf.name_scope('initial_state'):
74 self.cell_init_state = lstm_cell.zero_state(self.batch_size, dtype=tf.float32)
75 self.cell_outputs, self.cell_final_state = tf.nn.dynamic_rnn(
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)

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected