testnn.m

来自「基于贝叶斯理论的指纹识别算法及学习套件, 使用贝叶斯概率论实现对指纹识别,特征码」· M 代码 · 共 38 行

M
38
字号
function testnn()% Min/Max values for each inputPR = [0 1;       0 1];% Size of hidden/output layerS = [5 1];% Cols - Input vectors, each col diff. vectorTI = [0 0 1 1;      0 1 0 1];% Cols - Target output for each vector   TO = [-.9 .9 .9 -.9];% Unit type for hidden and output layersT = {'tansig' 'tansig'};% Create neural netnet = newff(PR,S,T,'traingdm');% Simulate and plotY1 = sim(net, TI);subplot(1,3,1);plot([1 2 3 4], Y1);% Set number of training epochs and errorsubplot(1,3,2);net.trainParam.epochs = 500;net.trainParam.goal   = 0.001;% Train[net, tr] = train(net, TI, TO);%tr.perf  % - trace of performance error [epochs+1]% Simulate and plotY1 = sim(net, TI);subplot(1,3,3);plot([1 2 3 4], Y1);      

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?