python - Why I get different results using reshape and expand_dims in Tensorflow? -


overall, writing rnn model using tensorflow. inherit rnncell , customize own cell. finally, use dynamic_rnn build entire rnn. detail want transform tensor shape [n, m] [n, m, 1]. use 2 methods implement this:

tf.reshape(matrix, [n, m, 1]) # first method tf.expand_dims(matrix, -1) # second method 

what expect using these 2 methods, totally identical training , prediction results(all random seeds fixed). results different. confused.

tf.reshape rearranges elements, tf.expand_dims adds dimension tensor. functions different.

however, expect due random initialization, everytime train results should different.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -