Time Series Forecasting Using Deep Learning Example is wrong

1 回表示 (過去 30 日間)
Andriy Chubatyy
Andriy Chubatyy 2020 年 3 月 30 日
コメント済み: Andriy Chubatyy 2020 年 3 月 30 日
Hi
I´m new in use of Deep Learning toolbox.
I was try execute the example 'Time Series Forecasting Using Deep Learning'
but it has an error (Matrix dimensions must agree.) in line:
rmse = sqrt(mean((YPred-YTest).^2))
YPred and YTest don´t have the same dimensions, and then if i truncate rmse value, the code has other error (Vectors must be the same length.) in line:
plot(idx,[data(numTimeStepsTrain) YPred],'.-')
So, how i can solve this problem?
Thank you.
Regards.
  2 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 3 月 30 日
Did you accidently change something in the example. did you run from the beginning ? i dont get any error on mine
openExample('nnet/TimeSeriesForecastingUsingDeepLearningExample')
Andriy Chubatyy
Andriy Chubatyy 2020 年 3 月 30 日
Yes, i changed one think and it is my mistake, in line:
[net,YPred] = predictAndUpdateState(net,YTrain(end)); --> [net,YPred] = predictAndUpdateState(net,YTrain);
because i had error:
The construct "YTrain(...end...)" is ambiguous in this context, because "YTrain" cannot be ascertained to be either the name of a variable or of a function. To make it a variable, assign to it; to allow it to become a function at execution time, replace "end" with a call to LENGTH, SIZE, or NUMEL on the desired array.
So this line: [net,YPred] = predictAndUpdateState(net,YTrain(end)); if i execute it in script editor it give me a error but if i execute it in command window is good.
And yes, i run from the beginning.
Now i executed:
openExample('nnet/TimeSeriesForecastingUsingDeepLearningExample')
step by step and it is working.
thank you Mohammad, regards.

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

回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by