comparison notebooks/test_music_segments.ipynb @ 63:b0e194bfb71d branch-tests

minor edits on server
author mpanteli <m.x.panteli@gmail.com>
date Thu, 21 Sep 2017 17:35:57 +0100
parents 90f8a2ea6f6f
children
comparison
equal deleted inserted replaced
61:ac3fcd42e7bd 63:b0e194bfb71d
25 " '/import/c4dm-04/mariap/test_data_melodia_8.pickle']" 25 " '/import/c4dm-04/mariap/test_data_melodia_8.pickle']"
26 ] 26 ]
27 }, 27 },
28 { 28 {
29 "cell_type": "code", 29 "cell_type": "code",
30 "execution_count": 13, 30 "execution_count": 25,
31 "metadata": {
32 "collapsed": true
33 },
34 "outputs": [],
35 "source": [
36 "# verify on the 30-second segments\n",
37 "filenames = ['/import/c4dm-04/mariap/train_data_melodia_8_30sec.pickle',\n",
38 " '/import/c4dm-04/mariap/val_data_melodia_8_30sec.pickle', \n",
39 " '/import/c4dm-04/mariap/test_data_melodia_8_30sec.pickle']"
40 ]
41 },
42 {
43 "cell_type": "code",
44 "execution_count": 26,
31 "metadata": { 45 "metadata": {
32 "collapsed": true 46 "collapsed": true
33 }, 47 },
34 "outputs": [], 48 "outputs": [],
35 "source": [ 49 "source": [
43 "all_Y = np.concatenate(all_Y)" 57 "all_Y = np.concatenate(all_Y)"
44 ] 58 ]
45 }, 59 },
46 { 60 {
47 "cell_type": "code", 61 "cell_type": "code",
48 "execution_count": 5, 62 "execution_count": 27,
49 "metadata": { 63 "metadata": {
50 "collapsed": true 64 "collapsed": true
51 }, 65 },
52 "outputs": [], 66 "outputs": [],
53 "source": [ 67 "source": [
144 "## Stats on average duration of the music segments for the Smithsonian tracks" 158 "## Stats on average duration of the music segments for the Smithsonian tracks"
145 ] 159 ]
146 }, 160 },
147 { 161 {
148 "cell_type": "code", 162 "cell_type": "code",
149 "execution_count": 23, 163 "execution_count": 28,
150 "metadata": {}, 164 "metadata": {},
151 "outputs": [ 165 "outputs": [
152 { 166 {
153 "name": "stdout", 167 "name": "stdout",
154 "output_type": "stream", 168 "output_type": "stream",
179 "## Stats on average duration of the music segments for the British Library tracks" 193 "## Stats on average duration of the music segments for the British Library tracks"
180 ] 194 ]
181 }, 195 },
182 { 196 {
183 "cell_type": "code", 197 "cell_type": "code",
184 "execution_count": 22, 198 "execution_count": 29,
185 "metadata": {}, 199 "metadata": {},
186 "outputs": [ 200 "outputs": [
187 { 201 {
188 "name": "stdout", 202 "name": "stdout",
189 "output_type": "stream", 203 "output_type": "stream",
190 "text": [ 204 "text": [
191 "n tracks: 2068\n", 205 "n tracks: 2068\n",
192 "mean 134.338008\n", 206 "mean 42.459381\n",
193 "median 163.000000\n", 207 "median 44.000000\n",
194 "std 44.855790\n", 208 "std 6.567739\n",
195 "mean duration 67.169004\n" 209 "mean duration 21.229691\n"
196 ] 210 ]
197 } 211 }
198 ], 212 ],
199 "source": [ 213 "source": [
200 "#British library tracks start with 'D:/Audio/...'\n", 214 "#British library tracks start with 'D:/Audio/...'\n",
203 "print 'n tracks: %d' % len(idx_BL_tracks)\n", 217 "print 'n tracks: %d' % len(idx_BL_tracks)\n",
204 "print 'mean %f' % np.mean(uniq_counts[idx_BL_tracks])\n", 218 "print 'mean %f' % np.mean(uniq_counts[idx_BL_tracks])\n",
205 "print 'median %f' % np.median(uniq_counts[idx_BL_tracks])\n", 219 "print 'median %f' % np.median(uniq_counts[idx_BL_tracks])\n",
206 "print 'std %f' % np.std(uniq_counts[idx_BL_tracks])\n", 220 "print 'std %f' % np.std(uniq_counts[idx_BL_tracks])\n",
207 "print 'mean duration %f' % (np.mean(uniq_counts[idx_BL_tracks]) / sr)" 221 "print 'mean duration %f' % (np.mean(uniq_counts[idx_BL_tracks]) / sr)"
222 ]
223 },
224 {
225 "cell_type": "code",
226 "execution_count": 12,
227 "metadata": {},
228 "outputs": [
229 {
230 "data": {
231 "text/plain": [
232 "8089"
233 ]
234 },
235 "execution_count": 12,
236 "metadata": {},
237 "output_type": "execute_result"
238 }
239 ],
240 "source": [
241 "6147+1942"
242 ]
243 },
244 {
245 "cell_type": "code",
246 "execution_count": 18,
247 "metadata": {},
248 "outputs": [
249 {
250 "data": {
251 "text/plain": [
252 "8099"
253 ]
254 },
255 "execution_count": 18,
256 "metadata": {},
257 "output_type": "execute_result"
258 }
259 ],
260 "source": [
261 "6119+1980"
262 ]
263 },
264 {
265 "cell_type": "code",
266 "execution_count": 24,
267 "metadata": {},
268 "outputs": [
269 {
270 "data": {
271 "text/plain": [
272 "8200"
273 ]
274 },
275 "execution_count": 24,
276 "metadata": {},
277 "output_type": "execute_result"
278 }
279 ],
280 "source": [
281 "6132+2068"
208 ] 282 ]
209 }, 283 },
210 { 284 {
211 "cell_type": "code", 285 "cell_type": "code",
212 "execution_count": null, 286 "execution_count": null,