Fast sequential lists for tensorflow?

83 views Asked by At

I have an array A of matrices (or a 3-dim tensor) and I want to do the following:

Denote each matrix with a number, so A is [1,2,3,4,...,], and let's say that we have a window of length 3, I want to pass as input to a TensorFlow graph the 4-dim array [[1,2,3],[2,3,4],[3,4,5],....]. What's the most efficient way of doing this? (It's a bit like a convolution with a constant kernel, but without summing over the resulting matrices).

At the moment this is what I'm doing:

input_NN = [data[t, t + window] for t in range(my_range)]

and then I pass it to a TF placeholder.

Shall I think of a better way of doing it in numpy and pass the result to a placeholder or is there a fast way of doing this in TensorFlow by passing A directly?

0

There are 0 answers