9

I have multiple features in a time series and want to predict the values of the same features for the next time step. I have already trained an LSTM which is working okay, but takes a bit long to train.

So now my question: is it reasonable to use a CNN instead of an LSTM, even though it is a time series? Are there any indicators for when you should never switch to a CNN?

drops
  • 220
  • 1
  • 2
  • 7

3 Answers3

6

Is it reasonable to use a CNN instead of an LSTM, even though it is a time series?

Yes, it is. Convolutional Neural Networks are applied to any kind of data in which neighboring information is supposedly relevant for the analysis of the data.

CNN are very popular with images, where data is correlated in space, and in video, where correlation happens both in space and time.

Are there any indicators for when you should never switch to a CNN?

CNNs are limited in a sense: they have a rigid, forward structure.

If you are trying to perform:

  • classification in sequences that have varying length ($N$ to $1$);
  • trying to output another sequence which has no fixed proportion between their length and the length of the input ($N$ to $M$).

Simple feed-forward neural networks will fail (due to dimension inconsistency). So, in that case you should use a recursive neural network such as a LSTM.

Pedro Henrique Monforte
  • 1,682
  • 1
  • 13
  • 26
1

A time series represents a temporal sequence of data - and generally for sequential data LSTM is the preferred DNN algorithm as it handles sequences much better . CNN generally becomes useful when you want to capture neighbourhood information like in an image.

having said this , please refer this article on how to use CNN for multivariate time series : [https://machinelearningmastery.com/how-to-develop-convolutional-neural-network-models-for-time-series-forecasting/#:~:text=%5B%5B101.67965%5D%5D-,Multivariate%20CNN%20Models,Multiple%20Parallel%20Series]

Vivek
  • 87
  • 3
0

In general you need to think about how your data behave. If your data depends on its neighbours, CNN could be a solution. If it’s like a sequence and closely relate to its neighbours then RNN could be good. If you instead see you need longer memory across, then LSTM is required. So it all depends on what you are working on.