フィルターのクリア

How to train the neural network?

2 ビュー (過去 30 日間)
Nur safura
Nur safura 2013 年 12 月 1 日
コメント済み: Nur safura 2013 年 12 月 10 日
Hi there, I am trying to create a time-series response and predict the future energy demand. But I am having a problem to train the network.
EnergyDemand = xlsread('C:\Users\user\Desktop\FYP\Datasheet.xlsx','Case Study Table 2','B4:B15');
Targets = xlsread('C:\Users\user\Desktop\FYP\Datasheet.xlsx','Case Study Table 2','C4:E15');
% define signal
inputs = EnergyDemand;
% plot signal
figure;
plot(input)
% Create a Pattern Recognition Network
hiddenLayerSize = 10;
net = patternnet(hiddenLayerSize);
% Set up Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = .7;
net.divideParam.valRatio = .15;
net.divideParam.testRatio = .15;
%net1 = newff(inputs,Targets,1,{'tansig' 'purelin'},'traingdm');
%net = newff(x1,Target,1);
net = feedforwardnet(2);
net= train(net,inputs,Targets);
view(Net);
I keep on getting the error message Error using network/train (line 325) Inputs and targets have different numbers of samples.
Error in Case_Study (line 21) net= train(net,inputs,Targets);
I hope you are able to help me. Thanks in advance.

採用された回答

Greg Heath
Greg Heath 2013 年 12 月 2 日
You are way off base.
1. Time series functions are timedelaynet, narnet and narxnet.
2. Read the time series documentation and examples
3. See some of my examples by searching in NEWSGROUP and ANSWERS. Search using
greg timedelaynet
greg narnet
greg narxnet
HTH
Thank you for formally accepting my answer
Greg
  5 件のコメント
Greg Heath
Greg Heath 2013 年 12 月 11 日
1. I gave you 4 distinct pieces of advice.
2. You followed none of them
3. Why should I continue to waste my time?
Nur safura
Nur safura 2013 年 12 月 23 日
Hi Greg,
Thank you for your prompt reply.
I did tried to follow your advise. I tried running the preset datasets in the nndatasets. Then I tried running my own dataset using nnstart. after that I generated the codes and compare with the preset values. And I did search for greg narnet, there are so many and I kept on trying different codes to run. Sorry that I am a slow learner but I hope you will continue to advise me. And thank you for helping me.
Nur Safura

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by