What I'm trying to do seems so simple, but I can't find any examples online. First, I'm not working in language, so all of the embedding
stuff adds needless complexity to my task.
I have input, in the form of a (1, 1000)
vector. They are time-series data, so I'll have 10 of them in sequence. Which, if I understand tensors correctly, gives me something of shape (10, 1, 1000)
, right?
I want to pass this through an RNN/LSTM and the output should be also of the same shape (10, 1, 1000)
. Namely, 10 vectors of 1000 dimensions each.
The first thing you need is to know "what" you consider a sequence there.
What are the steps? Are they 10 time steps? Or are they 1000 time steps?
I'll initially assume you have 1000 time steps.
Then the next question is: what are the 10 things? Are they 10 different independent examples of the same nature? Or are they 10 parallel things of different nature (features) from the same example?
These questions are the most important part, you need to know if you have:
(10, 1000, 1)
: 10 individual examples, 1000 timesteps per example, measuring a single variable/feature(1, 1000, 10)
: 1 long sequence, of 1000 timesteps, measuring 10 independent vars/veatures(more_examples, shorter_length, same_features)
(1000, 10, 1)
: 1000 different sequences of 10 time steps measuring a single var/feature(1, 10, 1000)
: 1 single sequence of 10 time steps, measuring 1000 independent vars/features(10, 1, 1000)
: 10 individual examples, 1 timestep, measuring 1000 vars/features(1000, 1, 10)
: 1000 different sequences of 1 time step measuring ten vars.Once you decided this, then it's time to work:
Stack the input data correctly according to your case and start a model.
I'll consider you have data with the shape
(samples, timesteps, features)
, then your model can go like:Notice that your output is necessarily
(samples, timesteps, desired_features)
. If you want a different final shape, reshape it outside the model.