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

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

Answers (1)

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!

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 11 Nov 2022

Answered:

on 30 Aug 2024

Community Treasure Hunt

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

Start Hunting!