how to reload saved ANN model in workspace properly
18 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
Cris LaPierre
2023-11-25
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])
更多回答(1 个)
Walter Roberson
2023-11-26
Suppose that you exported from nftool to the variable named results then
net = results.Network;
5 个评论
Walter Roberson
2023-11-26
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
2023-11-26
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Classification Learner App 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!