Simple neural network (for electricity price prediction) training problem
Show older comments
I'm trying to train the following neural network, it has an input matrix of 26 variables and 6999 samples (I imported the dataset from excel and saved it as a numeric matrix). The output is 1x6999. It is a large data set (I attach it in the message) and using the app Neural Net Fitting the training takes 16 minutes approximately, but when I use my own designed network the training just goes for 6 seconds (and therefore, the results aren't good enough when I test it). I assume I'm not training it correctly, but I don't know where the problem is. I have already tried to change number of maxEpochs, MinitBatchsize or even increasing the number of hidden layers (the training keeps being too short). I know that I should use validation during the training but I guess this is not the problem.
Thank you in advance.
CODE:
X_train=INPUTSP12TRAIN;
Y_train=OUTPUTSP1TRAIN;
X_test=INPUTSP12TEST;
Y_test=OUTPUTSP1TEST;
layers = [
sequenceInputLayer(26,"Name","sequence","Normalization","zscore")
fullyConnectedLayer(200,"Name","fc_1")
reluLayer("Name","relu")
fullyConnectedLayer(1,"Name","fc_2")
regressionLayer("Name","regressionoutput")];
maxEpochs = 50;
miniBatchSize = 20;
options = trainingOptions('adam', ...
'MaxEpochs',maxEpochs, ...
'MiniBatchSize',miniBatchSize, ...
'InitialLearnRate',0.01, ...
'GradientThreshold',1, ...
'Shuffle','every-epoch', ...
'Plots','training-progress',...
'Verbose',0);
net = trainNetwork(X_train,Y_train,layers,options);
Y_pred = predict(net,X_test,'MiniBatchSize',1);

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!