how to reload saved ANN model in workspace properly

18 ビュー (過去 30 日間)
Sunita
Sunita 2023 年 11 月 25 日
コメント済み: Walter Roberson 2023 年 11 月 26 日
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)

採用された回答

Cris LaPierre
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?
Here's an example from this answer.
load breakersize2.mat
out = net([1;1])
out = 1.0344
  1 件のコメント
Sunita
Sunita 2023 年 11 月 26 日
i didn't use code to generate the ANN. This is what I have done
(1) define variable "input" and "output"
(2) nftool
(3) import data in neural network window
(3) train
(4) export to workspace (the problem is only struct file is getting transfer to the workspace)

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 11 月 26 日
Suppose that you exported from nftool to the variable named results then
net = results.Network;
  5 件のコメント
Walter Roberson
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
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 ExchangeClassification Learner App についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by