how exactly to use the trainNetwork function?
Show older comments
I want to use the function net = trainNetwork(sequences,layers,options) like this to train a recurrent network of the form lstm for identifying nonlinear systems. I have for training two sets of input data and one set of output data.
numResponses=1;
featureDimension=1;
numHiddenUnits=70;
miniBatchSize=300;
maxEpochs=1000;
layer=[...
sequenceInputLayer(featureDimension)
lstmLayer(numHiddenUnits,'OutputMode','last')
dropoutLayer(0.02)
fullyConnectedLayer(numResponses)
regressionLayer
];
options=trainingOptions('adam',...
'MaxEpochs',maxEpochs,...
'MiniBatchSize',miniBatchSize,...
'GradientThreshold',20,...
'Shuffle','once', ...
'Plots','training-progress',...
'ExecutionEnvironment','parallel',...
'LearnRateSchedule','piecewise',...
'LearnRateDropPeriod',200,...
'L2Regularization',1e-3,...
'LearnRateDropFactor',0.5,...
'Verbose',0,...
'Plots','training-progress');
C = num2cell(table2array(x1_train));
net = trainNetwork(C',layer,options);
Here is a part of my code.x1_train is a variable that contains the u1 regressor for the 2 tank system and I transformed it into a cell array because I understood that I had to do so that I could use this data in the train network function and I got the following error:
Error using trainNetwork
Not enough input arguments.
Error in sperproiectfinal1 (line 84)
net = trainNetwork(C',layer,options);
Caused by:
Error using nnet.internal.cnn.trainNetwork.DLTInputParser>iParseInputArguments
Not enough input arguments.
please help me with some steps that I should follow to use the function properly and be able to train my network with two sets of input data and one set of output data
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox 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!