How to load ANN trained model in a new matlab script
13 ビュー (過去 30 日間)
古いコメントを表示
0 件のコメント
回答 (1 件)
Pranav Verma
2020 年 7 月 24 日
編集済み: Pranav Verma
2020 年 7 月 24 日
The size of the data used to train and simulate the network must be same. From the information you provided, it seems that your training and simulation dataset sizes are different. You should find out the training dataset size and accordingly change your simulation data.
Below is an example simulating the same behaviour:
%NN trained using P as dataset
P = [0 1 2 3 4 5 6 7 8 9 10;
0 1 2 3 4 5 6 7 8 9 10];
T = [0 1 2 3 4 3 2 1 2 3 4];
net = newff([0 10; 0 10],[5 1],{'tansig' 'purelin'});
net.trainParam.epochs = 50;
net = train(net,P,T);
save('NN2.mat')
%Trained NN loaded and simulated with data of same dimension
load('NN2.mat')
%Simulation data
simdata = [0 1 2 3 4 8 6 7 8 9 10;
0 1 2 3 4 5 6 7 8 9 10];
input = sim(net, simdata)
Thanks,
Pranav Verma
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!