Error using digraph.validateEdgeProperties (line 363) Edge properties must be a table.
Show older comments
I am training a LSTM network with training data of dimension 2x142. YTrain is a categorical input. i have ran the same code and got output yesterday. but today it suddenly shows the error
Error using trainNetwork (line 183)
Edge properties must be a table.
Error using digraph.validateEdgeProperties (line 363)
Edge properties must be a table.
my code is
Labels=categorical(Response);
CnX = Signals(Labels=='1');
CnY = Labels(Labels=='1');
SzX = Signals(Labels=='0');
SzY = Labels(Labels=='0');
[trainIndCn,ValIndCn,testIndCn] = dividerand(75,0.7,0.0,0.3);
[trainIndSz,ValIndSz,testIndSz] = dividerand(72,0.7,0.0,0.3);
XTrainCn = CnX(trainIndCn);
YTrainCn = CnY(trainIndCn);
XTrainSz = SzX(trainIndSz);
YTrainSz = SzY(trainIndSz);
XTestCn = CnX(testIndCn);
YTestCn = CnY(testIndCn);
XTestSz = SzX(testIndSz);
YTestSz = SzY(testIndSz);
XTrain=[XTrainCn,XTrainSz];
YTrain=[YTrainCn,YTrainSz];
XTest=[XTestCn,XTestSz];
YTest=[YTestCn,YTestSz];
Val={XTest, YTest};
numFeatures = 127;
numResponses = 2;
numHiddenUnits4 =200;
layers = [ ...
sequenceInputLayer(4)
bilstmLayer(numHiddenUnits4,'OutputMode','sequence')
fullyConnectedLayer(50)
dropoutLayer(0.5)
fullyConnectedLayer(2)
softmaxLayer
classificationLayer];
opts=trainingOptions('adam',...
'MiniBatchSize',40, ...
'MaxEpochs',100, ...
'Shuffle','every-epoch',...
'InitialLearnRate',0.001, ...
'SequenceLength', 'longest',...
'ValidationData',Val, ...
'ValidationFrequency',30, ...
'ValidationPatience',Inf, ...
'Verbose',true, ...
'VerboseFrequency',30, ...
'Plots','training-progress');
net = trainNetwork(XTrain,YTrain,layers,opts);
trainPred = classify(net,XTrain,'SequenceLength','longest');
figure
plotconfusion(YTrain',trainPred','Training Accuracy');
testPred = classify(net,XTest,'SequenceLength','longest');
figure
plotconfusion(YTest',testPred','Testing Accuracy');
1 Comment
yanqi liu
on 17 Feb 2022
yes,sir,may be check your data on today,is it normal
Answers (0)
Categories
Find more on Pattern Recognition 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!