Deep Learning for Regression
1 次查看(过去 30 天)
显示 更早的评论
Hello to everyone,
I am a newbie to Deep Learning and I am having some problems with training a Convolutional Neural Network for regression. I have a boolean vector x (20x175), which is used as a training set, and a continuous vector y (20x1), which contains the labelled values associated to x. I would like to train a Convolutional Neural Network to predict the labelled values (Y_hat) of the boolean test set X (2480x175). This is the snippet of my code:
layers = [ ...
sequenceInputLayer(size(x,1))
convolution2dLayer(2,2)
reluLayer
fullyConnectedLayer(1)
regressionLayer];
options = trainingOptions('sgdm','InitialLearnRate',0.001, ...
'MaxEpochs',15);
net = trainNetwork(x,y,layers,options);
Y_hat = predict(net,X);
But at the last but one line I get the following exception:
Error using trainNetwork (line 140)
Index exceeds matrix dimensions.
What is it due to? And what can I do to solve such a problem? Many thanks for your kind attention and my best regrards,
Fabio.
3 个评论
Greg Heath
2017-11-15
It helps others to understand if you use the MATLAB variable conventions
inputs x,X
targets t,T
outputs y,Y
Hope this helps.
Greg
Rana S.Chegani
2018-2-8
Hi, I think the problem is you are using convolution2dLayer , while your data is a 1D vector. This layer "The layer convolves the input by moving the filters along the input vertically and horizontally and computing the dot product of the weights and the input, and then adding a bias term.", rhile you don't have vertical and horizontal for each data sample. remove that and try it again, hopeful it helps
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!