Expression of ANN Model
이전 댓글 표시
I am a beginner of Matlab. I developed several ANN model via "nftool" but I could not find the expression of those models. Although I know that I can use them via "sim" to get outputs, I do need mathematical expression because only with the expression can I see the correlation of input variables. Is there any approach I can use to extract the expression?
채택된 답변
추가 답변 (1개)
Greg Heath
2013년 7월 3일
The standard MLP for regression and curve-fitting is FITNET. The standard MLP for classification and pattern-recognition is PATTERNNET; Both call the generic MLP FEEDFORWARDNET.
Duplicating the functionality by writing explicit code is made difficult by default operations that are under the hood . For example,
1. inputs and targets are preprocessed, normalized and randomly divided into training, validation and testing subsets.
2. Initial weights are randomly assigned
3. outputs are unnormalized and postprocessed.
If you just want to replicate the overall I/O function (and not the training), you only have to consider the default mapminnmax normalizations:
close all,clear all, clc
[x,t] = simplefit_dataset;
net = fitnet; % H=10 default
[ net tr y0 ]= train(net,x,t);
[ I N ] = size(x) % [ 1 94]
[ O N ] = size(t) % [ 1 94]
IW = net.IW{1,1} % [ H I ]
b1 = net.b{1} % [ H 1 ]
LW = net.LW{2,1} % [ O H ]
b2 = net.b{2} % [ O 1 ]
[ xn, xsettings ] = mapminmax(x);
[ tn, tsettings ] = mapminmax(t);
yn = repmat(b2 ,1,N) + LW*tansig( repmat(b1,1,N) + IW*xn );
y = mapminmax('reverse', yn, tsettings);
err = max(abs(y-y0))
%trn/val/tst decompositions can be obtained using tr.trainInd, tr.valInd and tr.testInd
P.S. If you want to duplicate runs, inititalize the RNG before the call of train
카테고리
도움말 센터 및 File Exchange에서 Pattern Recognition에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!