I'm currently doing some research on signal processing and I got a dataset which includes the signal in itself and its "translation".

A signal and its translation

So I want to use a Many-to-Many RNN to translate the first into the second.

After spending a week reading about the different option I have, I ended up learning about RNN and Seq2Seq models. I believe this is the right solution for the problem (correct me if I'm wrong).

Now, as the input and the output are of the same length, I don't need to add padding and thus I tried a simple LSTM layer and TimeDistributed Dense layer (Keras):

model = Sequential([
    LSTM(256, return_sequences=True, input_shape=SHAPE, dropout=0.2),
    TimeDistributed(Dense(units=1, activation="softmax"))

model.compile(optimizer='adam', loss='categorical_crossentropy')

But the model seems to learn nothing from the sequence and when I plot the "prediction", it nothing but values between 0 and 1.

As you can see, I'm a beginner and the code I wrote might not make sense to you but I need guidance on few questions:

  • Does the model make sense for the problem I'm trying to solve ?
  • Am I'm using the right loss/activation functions ?
  • And finally, please correct/teach me

1 Answer 1


I am skeptical that machine learning is the right tool for this problem. I would look for a more direct solution, perhaps using peak detection or changepoint detection, or some other form of classical method for time-series analysis.

If you do use machine learning, cross-entropy loss is not the right loss for your problem, and you will definitely need to change that.

  • $\begingroup$ Seems to be a fair answer, and I guess that's where I will be heading to. I just wanted to be a little bit more generic and recognize the patterns with DL model. $\endgroup$ Sep 11, 2020 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.