How can I make an example of Denoise Speech Using Deep Learning Networks with RNN?

3 ビュー (過去 30 日間)
studentmatlaber
studentmatlaber 2022 年 5 月 30 日
編集済み: Subhajyoti 2024 年 11 月 26 日
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);

回答 (1 件)

Subhajyoti
Subhajyoti 2024 年 11 月 26 日
編集済み: Subhajyoti 2024 年 11 月 26 日
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:
  • 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'.
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:

カテゴリ

Help Center および File ExchangeGet Started with Deep Learning Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by