LSTM-CNN “The size of the convolution dimension of the padded input data must be larger than or equal to the filter size”
Hello everyone,
I am trying to implement LSTM-CNN for speech recognition, I have a matrix for train and test which already are converted it to cell, when I excuted the code I got the error below:
net = trainNetwork(AllCellTrain, YCA, layers, options);
Caused by:
Layer 3: The size of the convolution dimension of the padded input data must be larger than or equal to the filter
size. For networks with sequence input, this check depends on the MinLength property of the sequence input layer. To
ensure that this check is accurate, set MinLength to the shortest sequence length of your training data.
The code that I have used:
% Define LSTM-CNN model architecture
numHiddenUnits = 100; % Number of hidden units in the LSTM layer
numFilters = 100; % Number of filters in the CNN layer
%filterSize = [3, 3]; % Size of the filters in the CNN layer
filterSize=3;
num_features = 39;
layers = [
sequenceInputLayer(num_features)
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
convolution1dLayer(filterSize, numFilters)
maxPooling2dLayer(2, ‘Stride’, 2)
fullyConnectedLayer(num_classes)
softmaxLayer
classificationLayer
];
% Specify the training options
max_epochs = 26;
mini_batch_size = 128;
initial_learning_rate = 0.001;
options = trainingOptions(‘adam’, …
‘MaxEpochs’, max_epochs, …
‘MiniBatchSize’, mini_batch_size, …
‘InitialLearnRate’, initial_learning_rate, …
‘GradientThreshold’, 1, …
‘Shuffle’, ‘every-epoch’, …
‘Verbose’, 1, …
‘ExecutionEnvironment’,’auto’, …
‘Plots’, ‘training-progress’);
% Train the LSTM-CNN model
YCA = categorical(CA);
net = trainNetwork(AllCellTrain, YCA, layers, options);
Thanks in advance!Hello everyone,
I am trying to implement LSTM-CNN for speech recognition, I have a matrix for train and test which already are converted it to cell, when I excuted the code I got the error below:
net = trainNetwork(AllCellTrain, YCA, layers, options);
Caused by:
Layer 3: The size of the convolution dimension of the padded input data must be larger than or equal to the filter
size. For networks with sequence input, this check depends on the MinLength property of the sequence input layer. To
ensure that this check is accurate, set MinLength to the shortest sequence length of your training data.
The code that I have used:
% Define LSTM-CNN model architecture
numHiddenUnits = 100; % Number of hidden units in the LSTM layer
numFilters = 100; % Number of filters in the CNN layer
%filterSize = [3, 3]; % Size of the filters in the CNN layer
filterSize=3;
num_features = 39;
layers = [
sequenceInputLayer(num_features)
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
convolution1dLayer(filterSize, numFilters)
maxPooling2dLayer(2, ‘Stride’, 2)
fullyConnectedLayer(num_classes)
softmaxLayer
classificationLayer
];
% Specify the training options
max_epochs = 26;
mini_batch_size = 128;
initial_learning_rate = 0.001;
options = trainingOptions(‘adam’, …
‘MaxEpochs’, max_epochs, …
‘MiniBatchSize’, mini_batch_size, …
‘InitialLearnRate’, initial_learning_rate, …
‘GradientThreshold’, 1, …
‘Shuffle’, ‘every-epoch’, …
‘Verbose’, 1, …
‘ExecutionEnvironment’,’auto’, …
‘Plots’, ‘training-progress’);
% Train the LSTM-CNN model
YCA = categorical(CA);
net = trainNetwork(AllCellTrain, YCA, layers, options);
Thanks in advance! Hello everyone,
I am trying to implement LSTM-CNN for speech recognition, I have a matrix for train and test which already are converted it to cell, when I excuted the code I got the error below:
net = trainNetwork(AllCellTrain, YCA, layers, options);
Caused by:
Layer 3: The size of the convolution dimension of the padded input data must be larger than or equal to the filter
size. For networks with sequence input, this check depends on the MinLength property of the sequence input layer. To
ensure that this check is accurate, set MinLength to the shortest sequence length of your training data.
The code that I have used:
% Define LSTM-CNN model architecture
numHiddenUnits = 100; % Number of hidden units in the LSTM layer
numFilters = 100; % Number of filters in the CNN layer
%filterSize = [3, 3]; % Size of the filters in the CNN layer
filterSize=3;
num_features = 39;
layers = [
sequenceInputLayer(num_features)
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
convolution1dLayer(filterSize, numFilters)
maxPooling2dLayer(2, ‘Stride’, 2)
fullyConnectedLayer(num_classes)
softmaxLayer
classificationLayer
];
% Specify the training options
max_epochs = 26;
mini_batch_size = 128;
initial_learning_rate = 0.001;
options = trainingOptions(‘adam’, …
‘MaxEpochs’, max_epochs, …
‘MiniBatchSize’, mini_batch_size, …
‘InitialLearnRate’, initial_learning_rate, …
‘GradientThreshold’, 1, …
‘Shuffle’, ‘every-epoch’, …
‘Verbose’, 1, …
‘ExecutionEnvironment’,’auto’, …
‘Plots’, ‘training-progress’);
% Train the LSTM-CNN model
YCA = categorical(CA);
net = trainNetwork(AllCellTrain, YCA, layers, options);
Thanks in advance! cnn, audio, lstm, deep learning, machine learning, classification MATLAB Answers — New Questions