How to specify the number of features rather than their size ?

2 次查看(过去 30 天)
Hi there,
Please could anyone help me
I have 3 feautures with a column size of 361 each, how can i tell my LSTM neural network model that i have 3 features and not 1083 features ?matlab
Thanks in adavence

回答(1 个)

Manish
Manish 2024-8-30
Hi ,
I understand that you want to define a LSTM with required number of features.
You can achieve this by using the “sequenceInputLayer” function and passing an input layer of the size that corresponds to the number of features in your data. In this case it is 3.
Refer to the below example code for better understanding.
numFeatures = 12;
numHiddenUnits = 100;
numClasses = 9;
layers = [ ...
sequenceInputLayer(numFeatures)
lstmLayer(numHiddenUnits,OutputMode="sequence")
fullyConnectedLayer(numClasses)
softmaxLayer];
Refer to the following documentation for more understanding of the “sequenceInputLayer” function and relevant code examples.
Hope it helps!

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by