1D convolution layer and Understanding Filter Size
Show older comments
Hi there I am trying to understand the number of filters parameter within the 1D convolution layer. Why is it that I am not able to set the number of fiilters in this model to 20. I have one feature I am trying to use to predict a continuous variable. Xtrain is the a 1x500 double containing the data from the one feature and Ytrain is the corresponging 1x500 double of the vairavle I am trying to predict. How come I am getting an:
Number of channels in predictions (20) must match the number of channels in the targets (1).1
It works when I set the number of filters =1 but I dont understand why the number of filters cant be larger? Does the number of filters always have to equal the number of features/inputs? In this example there are 3 input features and 64 filters so I am confused: https://www.mathworks.com/help/deeplearning/ug/sequence-to-sequence-classification-using-1-d-convolutions.html
Any help would be greatly appreciated!
numFilters = 20;
filterSize = 5;
net = dlnetwork;
layers = [
sequenceInputLayer(1, Name="inputaccelerometers")
convolution1dLayer(filterSize,numFilters,Padding="causal", Name="conv1_")
];
net = addLayers(net,layers);
options = trainingOptions("adam", ...
MaxEpochs=60, ...
miniBatchSize=1, ...
InputDataFormats="CTB", ...
Metrics="rmse", ...
Verbose=0);
net = trainnet(Xtrain',Ytrain',net,"mse",options)
Accepted Answer
More Answers (0)
Categories
Find more on Import Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!