Neural Network in Matlab App Designer
이전 댓글 표시
Is it possible to incorporate a Neural Network into an app created from the Matlab App Designer?
댓글 수: 6
Juan Carlos Pozuelos Buezo
2019년 10월 23일
편집: Juan Carlos Pozuelos Buezo
2019년 10월 23일
Hi, i am trying to charge a neuronal network (net.mat) into the app designer. The net is for get a forecast of electricity load. The input is a table with predictors. How i can call de net into de app designer?
For get the result: have i to use function “sim”?
[ypredict]=sim(app.net,input);
I try but i have problem
Thanks fotmr your help, and sorry for my English
Kojiro Saito
2019년 10월 24일
Which neural network are you using?
For example, in order to forecast numeric values, you can use LSTM networks for regression.
In this case, you can use predict.
YPred = predict(app.net, input);
If you're using Autoencoder, you can also use predict for forecasting.
YPred = predict(app.net, input);
Juan Carlos Pozuelos Buezo
2019년 10월 26일
편집: Juan Carlos Pozuelos Buezo
2019년 10월 26일
Thanks Kojiro. From Deep Neural toolbox i used the “neural network fitting tool” to get a model (pre trained). The model i saved as “net.mat”. When i used the net outside the app designer, i write y_pred = sim(net,input_target) and works, But into the app designer i can’t used that.
I have tried y_pred=Predict(app.net,input_target) but “predict” is not accepted in app designer. I have tried y_pred=net(app.net,input_target), but it wasn’t work too.
Can you help me??
Juan Carlos Pozuelos Buezo
2019년 11월 7일
Hi.
I wil try use the recomendation.
first, i used starupTcn(app) to load de net model. its call netdia.mat:
properties(Access = private)
net;
Y_predict;
end
function startupFcn(app)
app.net.net = load("C:\Predictor Demanda S.N.I\net\netdia.mat");
app.net = app.net.net;
end
then, into de code i tried to call de net with "YPred = predict(app.net, input);", like that:
Y_predict = predict(app.net,Xp_prediccion);
but, i got this error:
Undefined function 'predict' for input arguments of type
'struct'.
Error in
Predictor_Demanda_SNI_Corto_Plazo3/ProcesaDIASIGUIENTEButtonValueChanged
(line 336)
Y_predict =
predict(app.net,Xp_prediccion) % el
modelo previamente entrenado
únicamente generará la salida
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 378)
Error while evaluating StateButton PrivateValueChangedFcn.
what is my error?
thanks
Kojiro Saito
2019년 11월 8일
편집: Kojiro Saito
2019년 11월 9일
The structure to be input in predict might be different.
How about changing as the follows?
function startupFcn(app)
app.net = load("C:\Predictor Demanda S.N.I\net\netdia.mat");
app.net = app.net.net;
end
If the above does not work, add a breakpoint in the line of
Y_predict = predict(app.net,Xp_prediccion);
and pause at this line. Then, what is a variable type of app.net? You can konw the variable type by whos command.
Juan Carlos Pozuelos Buezo
2019년 11월 8일
Thanks a lot. It works ok ?
채택된 답변
추가 답변 (1개)
Pablo Salaverria
2019년 6월 10일
1 개 추천
Dear all,
while creating an app using app designer I am not able to compeltelly deploy my trainned CNN. My main issue is wiht the function classify which should be valid with:
[YPred]= classify(app.net,app.imds1);
Where app.net is the trainned CNN, app.imds1 is the imageDatastore where all the images that I want to classify are stored.
The error message that I got is:
Error using classify (line 123)
Requires at least three arguments.
Meaning that the function classify is using a 2nd options instead of the one that I want it to use. Is there a way to make it work?
댓글 수: 1
Kojiro Saito
2019년 6월 11일
카테고리
도움말 센터 및 File Exchange에서 Get Started with Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!