Skip to content

Commit 1879c68

Browse files
committed
update code
1 parent 63c21df commit 1879c68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tensorflowTUT/tf22_scope/tf22_RNN_scope.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _built_RNN(self):
6161

6262
with tf.variable_scope('output_layer'):
6363
# cell_outputs_reshaped (BATCH*TIME_STEP, CELL_SIZE)
64-
cell_outputs_reshaped = tf.reshape(tf.concat(1, self.cell_outputs), [-1, self._cell_size])
64+
cell_outputs_reshaped = tf.reshape(tf.concat(self.cell_outputs, 1), [-1, self._cell_size])
6565
Wo = self._weight_variable((self._cell_size, self._output_size))
6666
bo = self._bias_variable((self._output_size,))
6767
product = tf.matmul(cell_outputs_reshaped, Wo) + bo
@@ -76,13 +76,13 @@ def _built_RNN(self):
7676
self._cost = mse_sum_across_time
7777
self._cost_ave_time = self._cost / self._time_steps
7878

79-
with tf.name_scope('trian'):
79+
with tf.variable_scope('trian'):
8080
self._lr = tf.convert_to_tensor(self._lr)
8181
self.train_op = tf.train.AdamOptimizer(self._lr).minimize(self._cost)
8282

8383
@staticmethod
84-
def ms_error(y_pre, y_target):
85-
return tf.square(tf.sub(y_pre, y_target))
84+
def ms_error(y_target, y_pre):
85+
return tf.square(tf.subtract(y_target, y_pre))
8686

8787
@staticmethod
8888
def _weight_variable(shape, name='weights'):

0 commit comments

Comments
 (0)