LSTM in App Designer: predictAndUpdateState Error

조회 수: 1 (최근 30일)
Ibrahim Patel
Ibrahim Patel 2022년 11월 13일
편집: cr 2022년 11월 19일
for i = 1:app.count
net = networks{i};
temp = dataStandardized{i};
XTrain = temp(1:app.Timer.TasksExecuted-2);
YTrain = temp(2:app.Timer.TasksExecuted-1);
net = predictAndUpdateState(net,XTrain);
[net,YPred] = predictAndUpdateState(net,YTrain(end));
[net,YPred(:,app.Timer.TasksExecuted)] = predictAndUpdateState(net,YPred(:,app.Timer.TasksExecuted-1),'ExecutionEnvironment','cpu');
%Unstandardize the predictions
YPred = app.sig{app.idxFailDs(i)}.*YPred + app.mu{app.idxFailDs(i)};
app.C(app.idxFailDs(i)) = YPred;
app.EditField.Value = "Predicted for "+ app.count +".";
app.Lamp.Color = [1 1 0];
end
I have trained several LSTM networks stored in a cell array and being called in the loop, one at a time.
However the code is not running as I want to and the Command Window says to the effect that the function predictAndUpdateState is not defined for type double arguments.
But the arguments of type double arrays in the network were tested by me in a separate live script; working perfectly fine.
Please suggest a solution for using my LSTM networks in App Designer.

채택된 답변

cr
cr 2022년 11월 14일
The error doens't necessarily mean it cannot work with double type parameters. I may also be that it cannot find the function. Make sure the function def file is in the same directory as the app you are creating in app designer. You may check visibility of the file using which()
>> which predictAndUpdateState
  댓글 수: 14
Ibrahim Patel
Ibrahim Patel 2022년 11월 19일
Calling the function in the app is working out. Can you please post that as an answer so that I can acknowledge you.
cr
cr 2022년 11월 19일
편집: cr 2022년 11월 19일
Cool. You may just accept this answer. Thanks for confirming.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sequence 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