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

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -

php - Autoloader issue not returning Class -