Neural Network in Matlab App Designer

Is it possible to incorporate a Neural Network into an app created from the Matlab App Designer?

6 Comments

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
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);
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??
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
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.
Thanks a lot. It works ok ?

Sign in to comment.

 Accepted Answer

Yes, Neural Network (both shallow and deep neural networks) works with applications created by AppDesigner both for training and predict. Could you specify your use case, if possible?

4 Comments

I'm creating a graph through the use of a photorestistor operated by an Arduino. I would then extract numerical voltage values of the graph and record specific points of it in an excel file. The values would then be processed in a trained neural network for it to classify the graph that I generated. Is this possible? If so, how can I call a neural network into the AppDesigner?
Thank you for sharing your use case. Yes, it is possible in AppDesigner apps.
Here is one solution.
1. Train a neural network model and save the model as a mat file (for example, net.mat)
2. In AppDesigner, create a Private Property(net).
3. In a startup function, load the mat file and set as app.net.
net = load('net.mat');
app.net = net.net;
4. In a function callback which processes graph data (inputData), use classfiy with neural network.
[YPred, scores] = classify(app.net, inputData);
This has been very helpful. Thanks a lot, Kojiro Saito.
Estoy creando un calisificador de sonidos cardiacos, mediante el modulo max4466 el cual es procesado con filtros analogicos y posteriormente digitalizado para su procesamiento digital. Una vez realizado esto, entrara a una red autoencoder, la cual tendra una base de datos con sonidos cardiacos, y asi determinar en que categoria entra el sonido, si en sanos o no sanos.

Sign in to comment.

More Answers (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 Comment

I have just answered your question in this link. Please take a look.

Sign in to comment.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2017b

Community Treasure Hunt

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

Start Hunting!