How to define 'layers' for single to multiple sequence regression using lstm network?

2 views (last 30 days)
Hello
I was trying to modify the example:
for denoising my signals. The difference is that rather than just getting the denoised signal I am interested in getting both the denoised signal and the extracted noise. I thought that in addition to noisy and clean signals, I need to add the noise signal to my input datastore. I am not so sure about that and also I don't know how to define the layers in this case. Can anyone please help?
Thanks in advance.

Accepted Answer

Akshat Dalal
Akshat Dalal on 15 Dec 2023
Edited: Akshat Dalal on 18 Dec 2023
Hi Nasrin,
I understand that you want to create a deep learning model wherein you can clean a noisy signal and also get the noise that was added to the clean signal.
You would have to to train a network that takes the noisy signal as input and outputs two things: the denoised signal and the noise signal itself. To do this, you will need to modify the architecture of the neural network to have two output layers: one for the denoised signal and another for the noise. You can follow the below steps to achieve this:
  1. Define the Network Architecture: You will need to define a network with two regression outputs. The last layers of the network should branch into two separate paths, each ending with a regression layer.
  2. Specify the Training Options: When you train the model, you will need to use a custom training loop or specify custom training options to handle the multiple outputs. To read more about custom tranining loops, you can refer the following documentation: https://www.mathworks.com/help/deeplearning/deep-learning-custom-training-loops.html
  3. Train the Network: Train the network with the noisy signals as inputs and the two targets (clean signals and noise signals). The loss function should be designed to minimize the error for both outputs.
To read more about training deep learning networks with multiple outputs, you could refer the following documentation: https://in.mathworks.com/help/deeplearning/ug/multiple-input-and-multiple-output-networks.html
Hope this helps!

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!