(self, n_steps, input_size, output_size, cell_size, batch_size)
| 37 | |
| 38 | class LSTMRNN(object): |
| 39 | def __init__(self, n_steps, input_size, output_size, cell_size, batch_size): |
| 40 | self.n_steps = n_steps |
| 41 | self.input_size = input_size |
| 42 | self.output_size = output_size |
| 43 | self.cell_size = cell_size |
| 44 | self.batch_size = batch_size |
| 45 | with tf.name_scope('inputs'): |
| 46 | self.xs = tf.placeholder(tf.float32, [None, n_steps, input_size], name='xs') |
| 47 | self.ys = tf.placeholder(tf.float32, [None, n_steps, output_size], name='ys') |
| 48 | with tf.variable_scope('in_hidden'): |
| 49 | self.add_input_layer() |
| 50 | with tf.variable_scope('LSTM_cell'): |
| 51 | self.add_cell() |
| 52 | with tf.variable_scope('out_hidden'): |
| 53 | self.add_output_layer() |
| 54 | with tf.name_scope('cost'): |
| 55 | self.compute_cost() |
| 56 | with tf.name_scope('train'): |
| 57 | self.train_op = tf.train.AdamOptimizer(LR).minimize(self.cost) |
| 58 | |
| 59 | def add_input_layer(self,): |
| 60 | l_in_x = tf.reshape(self.xs, [-1, self.input_size], name='2_2D') # (batch*n_step, in_size) |
nothing calls this directly
no test coverage detected