How do I extract a ann's resulting function?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi. I have an ANN with 4 inputs, 10 neurons and 1 output. It's already trained and I would like to "extract" the resulting function. I don't want to use the command sim every time I need the results that the net would give me. Is there a way to do that?
Thanks!
0 件のコメント
回答 (1 件)
TED MOSBY
2025 年 6 月 9 日
Hi,
The Neural Network Toolbox includes "genFunction", which spits out an M-file you can call just like any other function:
% Suppose your trained network is called 'net' in your workspace:
genFunction(net, 'myNetFcn');
% This creates myNetFcn.m, containing something like:
% function y = myNetFcn(x)
% % AUTOGENERATED by Neural Network Toolbox
% .......
Then you can simple do:
y = myNetFcn(x); % x is your 4×N input matrix, y is 1×N output
Here is the documentation on "genfunction":
Hope this helps!
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!