These are chat archives for arita37/tensorflow
I have a question regarding the use of
I have a numpy array of size
x_shape = (50, 30, 10),
batch size = 50,
max length of series (max_time) = 30
input vector of length = 10.
I'm getting an error of
TypeError: 'Tensor' object is not iterable.
According to the documatation:
If time_major == False (default), this must be a Tensor of shape: [batch_size, max_time, ...], or a nested tuple of such elements.
How should I format my input if not an array of rank three e.g. [50, 30, 10]? Perhaps a list of 30 elements each of which each element is a vector of length 10?
@didw Your example is quite helpful, but in your case you're only interested in the last state so you use
w1 = tf.Variable(tf.random_normal([h_size, n_classes])) b1 = tf.Variable(tf.random_normal([n_classes])) outputs, states = tf.nn.dynamic_rnn(lstm_cell, self.X, initial_state=init_state) self.pred = tf.matmul(outputs[:,-1], w1) + b1
How should I modify this is I am interested in it at every step?
ValueError: Shape must be rank 2 but is rank 3 for 'MatMul' (op: 'MatMul') with input shapes: [5,3,32], [32,1]
outputs = tf.reshape(outputs, [-1, 32])