harkinnn
所属分类:matlab编程
开发工具:matlab
文件大小:317KB
下载次数:61
上传日期:2007-02-05 11:12:20
上 传 者:
coolautumn
说明: matlab神经网络代码,由大名鼎鼎的西蒙.哈克编写
(Matlab neural network code from the infamous Simon. Hack prepared)
文件列表:
247982 (0, 2011-02-18)
247982\haykin (0, 2011-02-18)
247982\haykin\bpm_dec_bnds.m (743, 1998-10-07)
247982\haykin\bpm_phi.m (38, 1998-10-07)
247982\haykin\bpm_phi_d.m (57, 1998-10-07)
247982\haykin\bpm_test.m (697, 1998-10-07)
247982\haykin\bpm_train.m (4347, 1998-10-07)
247982\haykin\bsb.m (1108, 1998-10-07)
247982\haykin\colmult.m (93, 1998-10-07)
247982\haykin\gha.m (875, 1998-10-07)
247982\haykin\gha_chopstak.m (562, 1998-10-07)
247982\haykin\gha_data.mat (262392, 1998-10-07)
247982\haykin\gha_dispwe.m (459, 1998-10-07)
247982\haykin\gha_getcoeffs.m (928, 1998-10-07)
247982\haykin\gha_getweights.m (164, 1998-10-07)
247982\haykin\gha_intermed_res.mat (332272, 1998-10-07)
247982\haykin\gha_quantcoeffs.m (1223, 1998-10-07)
247982\haykin\gha_recompose.m (565, 1998-10-07)
247982\haykin\gha_unchopst.m (505, 1998-10-07)
247982\haykin\hop_data.mat (15578, 1998-10-07)
247982\haykin\hop_demo.m (1657, 1998-10-07)
247982\haykin\hop_flip.m (369, 1998-10-07)
247982\haykin\hop_plotdig.m (343, 1998-10-07)
247982\haykin\hop_plotpats.m (589, 1998-10-07)
247982\haykin\hop_stor.m (351, 1998-10-07)
247982\haykin\hop_test.m (1805, 1998-10-07)
247982\haykin\ica.m (1215, 1998-10-07)
247982\haykin\mk_data.m (744, 1998-10-07)
247982\haykin\pim.m (233, 1998-10-07)
247982\haykin\pl_circ.m (791, 1998-10-07)
247982\haykin\rbf.m (592, 1998-10-07)
247982\haykin\rbf_correct.m (271, 1998-10-07)
247982\haykin\rbf_db.m (533, 1998-10-07)
247982\haykin\rbf_mkGF.m (452, 1998-10-07)
247982\haykin\rbf_test.m (426, 1998-10-07)
247982\haykin\sgn.m (183, 1998-10-07)
247982\haykin\shuffle.m (306, 1998-10-07)
247982\haykin\som_1d.m (1865, 1998-10-07)
247982\haykin\som_2d.m (2802, 1998-10-07)
... ...
--------------------
Notes on routines
--------------------
These M-files are User Contributed Routines which are being redistributed
by The MathWorks, upon request, on an "as is" basis. A User Contributed
Routine is not a product of The MathWorks, Inc. and The MathWorks assumes
no responsibility for any errors that may exist in these routines.
These files were created under Matlab 5.1 and use no specific toolboxes.
Examples of running the routines are given below.
Some of the routines have been incorporated into "demo" programs. The
demo programs are simple scripts that call the associated M-files.
All routines written by Hugh Pasika except for the SVM which was originally
composed by Antonio Artes (that's why the variables are all in Spanish) and
smoothed a bit by Hugh Pasika and the ICA mfile which was written by Himesh
Madhuranath.
pasika@soma.mcmaster.ca
--------------------------------------------
Back Propagation
(section 4.8)
--------------------------------------------
% 1. make the data
P=mk_data(500);
% 2. start the backprop algorithm
[W1, b1, W2, b2, ep_err, a, end_ep]=bpm_train(P, 4, 2, 2, .1, .5, 500, 0,0,0,0,0);
% 3. check the decision boundary
bpm_dec_bnds(W1, b1, W2, b2, .1);
% 4. make a test set
T=mk_data(10000);
% 5. check the accuracy
[cor, uncor]=bpm_test(W1,b1,W2,b2,T);
% 6. plot Bayesian decision boundary
c=pl_circ([-2/3 0], 2.34, .01, 1);
--------------------------------------------
Radial Basis Functions
(section 5.14)
--------------------------------------------
% 1. Make data set
P = mk_data(200);
% 2. Train the RBF
w = rbf(P(1:100,1:2), P(:,1:2), P(1:100,3:4), 4, 1);
% 3. make a test set
T = mk_data(500);
% 4. get network outputs with test set
rbfout = rbf_test(w,T(:,1:2),P(:,1:2),4);
% 5. determine percent correct
rbf_correct(rbfout, T(:,5));
% 6. plot decision boundary
rbf_db(w,P(:,1:2),4,.2)
--------------------------------------------
Support Vector Machine
(section ***)
--------------------------------------------
% 1. make data set
P = mk_data(200);
% 2. run the SVM routine
[pesos,vect,b] = svm_rbf(P, 8, 1000, .01, .1);
% 3. make a test set
T = mk_data(200);
% 4. test data
[c u] = svm_test(T, pesos, vect, b, 8);
% 5. plot decision surface
svm_dec_bnd(pesos, vect, b, 8)
-------------------------------------------------
Self Organizing Map (2d data, 2d map)
(section 9.6)
-------------------------------------------------
% 1. run the demo
som_2d_demo
% plotting between iterations has been taken out but can easily be added
% by uncommenting line 95 in som_2d.m "som_pl_map(W,1,2); drawnow"
-------------------------------------------------
Self Organizing Map (2d data, 1d map)
(section 9.6)
-------------------------------------------------
% 1. make the data
P=rand(1000,2);
% 2. ordering phase
[W1s p1]=som_1d(P,200,10, [.1 18]);
% 3. convergence phase
[W2s p2]=som_1d(P,200,50, [p1(1) .001 p1(2) 0],W1s);
--------------------------------------------
Generalized Hebbian Algorithm
(section 8.6)
--------------------------------------------
% 1. load the image data
load gha_data
% 2. set the colormap
colormap(gray(256))
% 3. run the algorithm
W=gha_getweights(parn,2000,8,.0001);
% 4. determine mask coefficients
% display masks and reconstructed image with unquantized coeffs
c=gha_getcoeffs(parn,W,1);
% 5. quantize the coeffecients according user specified bit rate
% and recompose the image
[I, st, xla] = gha_quantcoeffs(c,W,parn,[7 7 6 4 3 3 2 2]);
% 6. display the reconstructed image
subplot(2,2,4)
pim(I)
--------------------------------------------
Independent Component Analysis
(section 10.12)
--------------------------------------------
This example runs as a stand alone script.
% 1. ica
--------------------------------------------
Brain State in a Box
(section 14.11)
--------------------------------------------
% 1. run the routine
c=bsb([-.3 -.7], .9);
% 2. subsequent plots will be held
c=bsb([-.1 -.7], .9);
--------------------------------------------
Hopfield Network
(section 14.8)
--------------------------------------------
% 1. run the demo
hop_demo
近期下载者:
相关文件:
收藏者: