globalAveragePooling1dLayer error
Mostrar comentarios más antiguos
Dear Community,
I want to train and test a 1D convolutional network for sequence - to - sequence classification.
I have the following architecture:
layers = [ ...
sequenceInputLayer(numFeatures)
convolution1dLayer(filterSize,numFilters1,Padding="same")
reluLayer
convolution1dLayer(filterSize,numFilters1,Padding="same")
reluLayer
globalAveragePooling1dLayer
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer( ...
'Classes',classes, ...
'ClassWeights',classWeights)];
If I include the globalAveragePooling1dLayer after my second relu layer than i get the following error:
" Error using trainNetwork (line 184) Invalid training data. For image, sequence-to-label, and feature classification tasks, responses must be categorical" .
Without the globalAveragePooling1dLayer I don't get the error and trainings starts. What is the problem?
Respuesta aceptada
Más respuestas (1)
yanqi liu
el 17 de En. de 2022
0 votos
yes,sir,may be check Ydata,such as use
Ydata2 = categorical(Ydata);
to get categorical vector,then train
1 comentario
Bram Stegeman
el 18 de En. de 2022
Editada: Bram Stegeman
el 18 de En. de 2022
Categorías
Más información sobre Tuning en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!