how to reload saved ANN model in workspace properly
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sunita
am 25 Nov. 2023
Kommentiert: Walter Roberson
am 26 Nov. 2023
I am not able to load the saved ANN model on the workspace . The "net" file does not appear only input , output and results. (check the image)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1551907/image.png)
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 25 Nov. 2023
It looks like your network was not saved in your mat file. What code did you use to create the mat file? Had your network variable been created at the time you create the mat file?
load breakersize2.mat
out = net([1;1])
Weitere Antworten (1)
Walter Roberson
am 26 Nov. 2023
Suppose that you exported from nftool to the variable named results then
net = results.Network;
5 Kommentare
Walter Roberson
am 26 Nov. 2023
Fine. Then after you get results extract Network from it into net and save it to a mat file just so that you can still l file to load()
Walter Roberson
am 26 Nov. 2023
x = rand(4,241);
y = randi(3, 1, 241);
nftool
%Import -> Import Data, select x and y, Observations in Columns, OK
%Train
%Export Model -> Export to Workspace, variable named results
net = results.Network;
predicted_y = round(net(x));
accuracy = mean(y == predicted_y) * 100 %percent
Siehe auch
Kategorien
Mehr zu Classification Learner App finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!