- Please take a look at the doc. It says: "At training time, the layer randomly sets input elements to zero ..and helps prevent the network from overfitting. .. At prediction time, the output of the layer is equal to its input.". When you place trained LSTM in Simulink, there is no training happening, only inference. Therefore, the output of the droput layer should just be equal to its input.
- Regarding slow speed of Stateful Predict bloc. By default it will run in interpreted mode, meaning it call into MATLAB at each execution. You can improve performance by simulating using code generation. This requires you to do a few steps that are described here. Please see if that helps you improve the speed.
Using a neural network with a dropout layer in Simulink
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Emirhan INANC
am 23 Okt. 2022
Kommentiert: Emirhan INANC
am 27 Okt. 2022
I am trying to add a dropout layer to my LSTM structure to prevent overfitting. Then, I am using this LSTM model in Simulink Environment, using Stateful Predict block. Unfortunately, this block is very slow on forward passing my network (it takes too much time for me, even with the accelerator). Therefore, I had to use my own forward pass code, but to do that I need to know which neurons are disabled in my dropout layer. Is there a way for me to obtain this information?
Note: There is no learning happening in dropout layer, but the simulation results are affecting my training process as well, so i need to disable corresponding neurons.
0 Kommentare
Akzeptierte Antwort
Arkadiy Turevskiy
am 24 Okt. 2022
Hi,
I'd like to mention a couple of things.
Hope this helps.
Arkadiy
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!