# Train a recurrent neural network by concatenating time series. Is it safe?

As the title says, I want to train a Jordan network (i.e. a particular kind of recurrent neural network) using a certain number of time series.

Let's say that $$x_1, x_2, \ldots x_N$$ are $$N$$ input time series (i.e. $$x_i = [x_{i,1}, x_{i,2}, \ldots, x_{i,T}]$$, where $$T$$ is the length of the time series) and $$y_1, y_2, \ldots y_N$$ (i.e. $$x_i = [y_{i,1}, y_{i,2}, \ldots, y_{i,T}]$$) are the corresponding target time series.

More specifically, the target time series are just sequences of "$$0$$s", which may end with sequences of "$$1$$"s. Here I show you some example:

$$y_i = [0 ~ 0 ~ 0 \ldots 0 ~ 0 ~ 1 ~ 1 ~ 1 \ldots 1 ~1 ],$$ $$y_i = [0 ~ 0 ~ 0 \ldots 0 ~ 0].$$

This means that I want that my machine "learn to raise" under some situations related to the corresponding inputs $$x_i$$. Indeed, the objective of my network is to "raise" an alarm if "something" happens.

At the moment, my training strategy is the following. I create a new time series which corresponds the concatenation of all the available $$x_i$$ and $$y_i$$. Let's call the concatenated series $$X$$ and $$Y$$. Then I use $$X$$ and $$Y$$ to train a network.

Here is my problem. If I concatenate, then I also teach to my machine to "drop", since I can have situation like this:

$$Y = [ \ldots 1 ~ 1 ~ 0 ~ 0 \ldots].$$

Is this really a problem? Are there other "training strategies" to be employed so that I avoid this kind of unwanted behaviors?

• My first thought when reading this was that the issue would be with the Xs instead. By concatenating the Xs, you are artificially including a transition from x_{i,T} to x_{j, 1}. If this transition does actually happen in your data, you might get some interference so its worth exploring your data for that. Otherwise, I think that this approach is fine. – Jaden Travnik Nov 14 '18 at 14:13
• @JadenTravnik you are right, thanks. Anyway, I'm trying to train a neural network since it is very difficult to assess if there is a real transition in the data $x$. Indeed, data $x$ are multidimensional. If there was a "graphical evidence", then maybe machine learning would have been unnecessary. – the_candyman Nov 14 '18 at 18:50
• Why a downvote? I think it is stupid to downvote without commenting. – the_candyman Jan 11 at 23:56