source: proiecte/PPPP/ica/runica_parallel.m @ 138

Last change on this file since 138 was 138, checked in by (none), 14 years ago

PPPP - ica

File size: 1.6 KB
Line 
1% Copyright 1996 Tony Bell
2% This may be copied for personal or academic use.
3% For commercial use, please contact Tony Bell
4% (tony@salk.edu) for a commercial license.
5
6
7% Script to run ICA on a matrix of images. Original by Tony Bell.
8% Modified by Marian Stewart Bartlett.
9
10%Assumes image gravalues are in rows of x. Note x gets overwritten.
11%Will find N independent components, where N is the number of images.
12
13%There must be at least 5 times as many examples (cols of x) as the
14%dimension of the data (rows of x).
15
16N=size(x,1); P=size(x,2); M=N;   %M is dimension of the ICA output
17spherex;                          % remove first and second order stats from x
18xx=inv(wz)*x;                     % xx thus holds orig. data, w. mean extracted.
19
20%******** setup various variables
21w=eye(N); count=0; perm=randperm(P); sweep=0; Id=eye(M);
22oldw=w; olddelta=ones(1,N*M); angle=1000; change=1000;
23
24%******** Train. outputs a report every F presentations.
25% Watch "change" get small as it converges. Try annealing learning
26% rate, L, downwards to 0.0001 towards end.
27% For large numbers of rows in x (e.g. 200), you need to use a low
28% learning rate (I used 0.0005). Reduce if the output blows
29% up and becomes NAN. If you have fewer rows, use 0.001 or larger.
30
31B=50; L=0.0005; F=5000; parfor I=1:1000, sep96; end;
32B=50; L=0.0003; F=5000; parfor I=1:200, sep96; end;
33B=50; L=0.0002; F=5000; parfor I=1:200, sep96; end;   
34B=50; L=0.0001; F=5000; parfor I=1:200, sep96; end;
35
36%********
37uu=w*wz*xx;  % make separated output signals.
38cov(uu')     % check output covariance. Should approximate 3.5*I.
Note: See TracBrowser for help on using the repository browser.