Mercurial > hg > silvet
comparison yeti/silvet.yeti @ 28:cd9fd74931bb
Reuse some calculations, plot some plots
author | Chris Cannam |
---|---|
date | Mon, 31 Mar 2014 17:21:51 +0100 |
parents | 9ec18d453889 |
children |
comparison
equal
deleted
inserted
replaced
27:9ec18d453889 | 28:cd9fd74931bb |
---|---|
3 | 3 |
4 { prepareTimeFrequency } = load timefreq; | 4 { prepareTimeFrequency } = load timefreq; |
5 { loadTemplates, extractRanges } = load templates; | 5 { loadTemplates, extractRanges } = load templates; |
6 | 6 |
7 em = load em; | 7 em = load em; |
8 em1 = load em_onecolumn; | |
9 | 8 |
10 mat = load may.matrix; | 9 mat = load may.matrix; |
11 vec = load may.vector; | 10 vec = load may.vector; |
12 plot = load may.plot; | 11 plot = load may.plot; |
13 | 12 |
42 chunks = chunkify columns; | 41 chunks = chunkify columns; |
43 | 42 |
44 eprintln "we have \(length chunks) chunks of size \(mat.size (head chunks))"; | 43 eprintln "we have \(length chunks) chunks of size \(mat.size (head chunks))"; |
45 | 44 |
46 oneIteration emdata chunk n = | 45 oneIteration emdata chunk n = |
47 ({ estimate, q } = em.performExpectation emdata chunk; | 46 (eprintln "E"; |
47 { estimate, q } = em.performExpectation emdata chunk; | |
48 eprintln "M"; | |
48 newdata = em.performMaximisation emdata chunk q; | 49 newdata = em.performMaximisation emdata chunk q; |
49 if (n % 6 == 0) then | 50 if (n % 6 == 0) then |
50 \() (plot.plot [ Grid chunk ]); | 51 \() (plot.plot [ Grid chunk ]); |
51 \() (plot.plot [ Grid estimate ]); | 52 \() (plot.plot [ Grid estimate ]); |
52 fi; | 53 fi; |
58 for [1..iterations] do i: | 59 for [1..iterations] do i: |
59 eprintln "iteration \(i)..."; | 60 eprintln "iteration \(i)..."; |
60 d := oneIteration d (head chunks) i; | 61 d := oneIteration d (head chunks) i; |
61 done; | 62 done; |
62 | 63 |
63 eprintln "done"; | 64 eprintln "done, plotting pitch activation matrix"; |
65 | |
66 \() (plot.plot [Grid d.pitches]); | |
67 \() (plot.plot [Contour d.pitches]); | |
64 | 68 |
65 | 69 |
66 (); | 70 (); |
67 | 71 |
68 | 72 |