In a recurrent neural network for sequence generation, can the input be multiple sequences (a matrix) instead of one sequence (a vector)?

236 Views Asked by At

I read a bit about RNNs and it seems like sequence generation (i.e. generating arbitrarily long sequences of words) is a big use case. But frequently, the training data and input data consists only of past sequences, i.e. also of words. Is it possible to use other sequence features as well besides the thing that we're trying to predict?

For example:

Problem: Categorize activity by Low, Medium, High

Input: activity of the last N timesteps (L, L, M, H, M, ...)

Other features: other things that are related to activity, also represented in a sequence with a 1:1 correspondence with the input.

Goal: generate predictions for M timesteps in the future. We would not be prescient of the values of the "other features" in the future either, so either we need to predict them, or (preferably) the neural net would do the prediction itself.

Is it possible to use other features in this classification problem as well? If not, are there any other algorithms that would be a better fit to this problem?

Thank you.

1

There are 1 best solutions below

0
On

The short answer is yes. Nothing stops neural networks from doing this, and although I can't point to a concrete GitHub project right away, I'm absolutely sure it has been done.

It's important to remember that (any) neural network can have several outputs (as correctly commented by @reuns). The most widely known example is convolutional neural networks that solve object recognition and detection tasks using the same hidden weights (there're usually multiple heads on top of the deep network, one predicts the object class, the other predicts the bounding rectangle). See ImageNet competitions: it's common for a team to participate in different competitions with (almost) the same network.

Recurrent neural network is no exception. RNN doesn't "remember" where the input features came from, so it can take as an input its own predicted outputs. Andrew Karpathy blog post "The Unreasonable Effectiveness of Recurrent Neural Networks" suggests it must be equally effective.

One particular application of multiple time-series prediction is stock market prediction, where the features include not only the price (min, max, closing, whatever), but also the trading volume. There is evidence that shows that volume prediction is more accurate, so by predicting both it's in theory possible to achieve better accuracy for the price several steps ahead.