- Data Preprocessing: The input data ('trainPredictors' and 'validatePredictors') is formatted as a cell array, where each cell contains a sequence (a matrix of size '[numFeatures, numSegments]'). The target data ('trainTargets' and 'validateTargets') should be a column vector if you're predicting a single value per sequence.
- Network Architecture: The 'flattenLayer' is generally not needed when using LSTM layers since LSTM layers handle sequences directly. However, if your input data has an extra dimension (e.g., '[numFeatures, numSegments, 1]'), you might need to flatten it.
- Fully Connected Layer: Ensure the output size of your final fullyConnectedLayer matches the size of your response data. If you're predicting a single scalar value, this should be '1'.
How can I make an example of Denoise Speech Using Deep Learning Networks with RNN?
15 views (last 30 days)
Show older comments
I want to repeat the example in the link with RNN. But I couldn't figure out exactly what changes I need to make. First I added lstmLayer. I understand that I need to use sequenceInputLayer instead of imageInputLayer. What else do I need to change?
numHiddenUnits=100;
layers = [
sequenceInputLayer([numFeatures,numSegments])
lstmLayer(numHiddenUnits,'OutputMode','last')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(1024)
batchNormalizationLayer
reluLayer
fullyConnectedLayer(numFeatures)
regressionLayer
];
miniBatchSize = 128;
options = trainingOptions("adam", ...
"MaxEpochs",3, ...
"InitialLearnRate",1e-5,...
"MiniBatchSize",miniBatchSize, ...
"Shuffle","every-epoch", ...
"Plots","training-progress", ...
"Verbose",false, ...
"ValidationFrequency",floor(size(trainPredictors,4)/miniBatchSize), ...
"LearnRateSchedule","piecewise", ...
"LearnRateDropFactor",0.9, ...
"LearnRateDropPeriod",1, ...
"ValidationData",{validatePredictors,validateTargets});
denoiseNetFullyConnected = trainNetwork(trainPredictors,trainTargets,layers,options);
0 Comments
Answers (1)
Subhajyoti
1 minute ago
Edited: Subhajyoti
less than a minute ago
It is my understanding that you are trying to adapt the example with an RNN.
To modify the given example to use an, you need to ensure that your data and network architecture are appropriately set up for sequence data. Here are some key points and changes you might consider:
Refer to the following MathWorks Documentation example to know more about implementing an RNN in MATLAB:
Additionally, you can refer to the following resource to know more about training deep learning neural networks:
0 Comments
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!