summaryrefslogtreecommitdiff
path: root/examples/testmnist.m
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-09-21 18:28:08 +0000
committerAlberto Ruiz <aruiz@um.es>2007-09-21 18:28:08 +0000
commit0198366bba7a5f2d67338633f9eb90889ffc31b2 (patch)
tree4897d90233b333ee2092e63a4b74c7bcb2d22577 /examples/testmnist.m
parentd4cb2692f9dae748da23371057a983deca4b2f80 (diff)
add examples
Diffstat (limited to 'examples/testmnist.m')
-rw-r--r--examples/testmnist.m29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/testmnist.m b/examples/testmnist.m
new file mode 100644
index 0000000..38625a7
--- /dev/null
+++ b/examples/testmnist.m
@@ -0,0 +1,29 @@
1#! /usr/bin/octave -qf
2% measuring Octave computing times
3
4t0=time();
5load mnist.txt
6disp("load");
7disp(time()-t0)
8
9
10x = mnist(:,1:784);
11d = mnist(:,785);
12
13
14t0=time();
15xc = x - repmat(mean(x),rows(x),1);
16disp("x - repmat(mean(x),rows(x),1)");
17disp(time()-t0)
18
19t0=time();
20mc = (xc'*xc)/rows(x);
21disp("(xc'*xc)/rows(x)");
22disp(time()-t0)
23
24t0=time();
25[v,l]=eig(mc);
26disp("eig");
27disp(time()-t0)
28
29disp(flipud(diag(l))(1:10)); \ No newline at end of file