In [1]:
%matplotlib inline

from __future__ import division, print_function

import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import IPython

import SHS_data
import util
import paired_data

import learn
reload(learn)


Out[1]:
<module 'learn' from 'learn.pyc'>

Learning cover song fingerprints

This notebook contains experiments in which a fingerprint is learned from a dataset of cover songs. The main idea behind this is explained in our Audio Bigrams paper [1].

Very briefly explained:

  1. most fingerprints encode some kind of co-occurrence of salient events (e.g., Shazam, 'Intervalgram')
  2. 'salient event detection' can be implemented as a convolution:
     conv2d(X, W)
    
    with W the 'salient events'.
  3. co-occurrence can be implemented as
     conv2d(X, w) @ X.T
    
    with w a window and @ the matrix product.
  4. all of this is differentiable, therefore, any fingerprinting system that can be formulated like this can be trained 'end-to-end'.

To evaluate the learned fingerprint, we compare to the state-of-the-art '2D Fourier Transform Magniture Coeffients' by Bertin-Mahieux and Ellis [2], and a simpler fingerprinting approach by Kim et al [3].

We use the Second-hand Song Dataset with dublicates removed as proposed by Julien Osmalskyj.

[1] Van Balen, J., Wiering, F., & Veltkamp, R. (2015). Audio Bigrams as a Unifying Model of Pitch-based Song Description.

[2] Bertin-Mahieux, T., & Ellis, D. P. W. (2012). Large-Scale Cover Song Recognition Using The 2d Fourier Transform Magnitude. In Proc. International Society for Music Information Retrieval Conference.

[3] Kim, S., Unal, E., & Narayanan, S. (2008). Music fingerprint extraction for classical music cover song identification. IEEE Conference on Multimedia and Expo.

Training data


In [2]:
n_patches, patch_len = 8, 64

In [3]:
# train, test, validation split
ratio = (50,20,30)
clique_dict, _ = SHS_data.read_cliques()
train_cliques, test_cliques_big, _ = util.split_train_test_validation(clique_dict, ratio=ratio)

# preload training data to memory (just about doable)
print('Preloading training data...')
train_uris = util.uris_from_clique_dict(train_cliques)
chroma_dict = SHS_data.preload_chroma(train_uris)

# make a training dataset of cover and non-cover pairs of songs
print('Preparing training dataset...')
X_A, X_B, Y, pair_uris = paired_data.dataset_of_pairs(train_cliques, chroma_dict,
                                                             n_patches=n_patches, patch_len=patch_len)
print('    Training set:', X_A.shape, X_B.shape, Y.shape)


Preloading training data...
Preparing training dataset...
    Training set: (32436, 512, 12) (32436, 512, 12) (32436,)

Test data

For now, load just a small part of the test set that we'll evaluate at every iteration, e.g., a few times batch size


In [4]:
# pick a test subset
n_test_cliques = 50  # e.g., 50 ~ small actual datasets
test_cliques = {uri: test_cliques_big[uri] for uri in test_cliques_big.keys()[:n_test_cliques]}

# preload test data to memory (just about doable)
print('Preloading test data...')
test_uris = util.uris_from_clique_dict(test_cliques)
chroma_dict_T = SHS_data.preload_chroma(test_uris)

# make a test dataset of cover and non-cover pairs of songs
print('Preparing test dataset...')
X_A_T, X_B_T, Y_T, test_pair_uris_T = paired_data.dataset_of_pairs(test_cliques, chroma_dict_T,
                                                         n_patches=n_patches, patch_len=patch_len)
print('    Test set:', X_A_T.shape, X_B_T.shape, Y_T.shape)


Preloading test data...
Preparing test dataset...
    Test set: (340, 512, 12) (340, 512, 12) (340,)

Network

Set up a siamese network.


In [27]:
# for repeated runs with different networks
tf.reset_default_graph()

In [28]:
# make network
network = learn.siamese_network(input_shape=(n_patches*patch_len, 12))
network.add_conv_layer(shape=(1,12), n_filters=12, padding='VALID')
network.add_matmul_layer(filter_len=12, n_filters=12)

Training

Set training parameters and run for n_epoque iterations. Current implementation requires an 'interactive session'.


In [29]:
alpha = 4
m = 10
lr = 3e-4
batch_size = 100
n_iterations = 3200  # 3200 ~ 10 epoques (train set ~ 320 x 100)

# training metrics
loss, pair_loss, non_pair_loss = network.loss(m=m, alpha=alpha)
bhatt, d_pairs, d_non_pairs = network.bhattacharyya()

# optimiser
train_step = network.train_step(loss, learning_rate=lr)

# choose which metrics to log
metrics = [loss, d_pairs, d_non_pairs]

In [30]:
# start Tensorflow session
sess = tf.InteractiveSession()
sess.run(tf.initialize_all_variables())


Exception AssertionError: AssertionError() in <bound method InteractiveSession.__del__ of <tensorflow.python.client.session.InteractiveSession object at 0x128ae8190>> ignored

In [31]:
# train and test batches
train_batches = learn.get_batches([X_A, X_B, Y], batch_size=batch_size)
test_batch = [X_A_T, X_B_T, Y_T]

# train
for step in range(n_iterations):  
    train_batch = next(train_batches)
    
    # report
    network.log_errors(sess, train_batch=train_batch,
                       test_batch=test_batch, metrics=metrics, log_every=10)
    
    # train
    train_feed = {network.x_A:train_batch[0], network.x_B:train_batch[1],
                  network.is_cover:train_batch[2]}
    train_step.run(feed_dict=train_feed)
    
# report final
network.log_errors(sess, train_batch=train_batch,
                   test_batch=test_batch, metrics=metrics)


   TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
0  43.5403    5.11521        7.30174  45.6209    6.25334        7.82205 

    TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
10  46.2566    6.48997        8.09015  43.449    6.51223        8.19473 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
20  43.6188    6.93647        8.16343  42.1766    6.66544        8.40268 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
30  37.6923    6.75306        8.96504  41.2071     6.7171        8.46571 

   TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
40  53.201     8.2057        7.94933  40.528    6.71458        8.45561 

   TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
50  39.752    6.95889        8.67382  40.0099    6.75888        8.50724 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
60  41.5869    7.03172        8.21864  39.6046    6.77288        8.52355 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
70  47.7017    7.55597        7.90635  39.2518    6.58555        8.27234 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
80  40.8777     6.8135        7.96211  39.1295     6.4533        8.08538 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
90  34.3202    6.04549        8.01772  38.8348    6.51763        8.16417 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
100  34.7437    5.53694        7.68401  38.5148    6.59577        8.27186 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
110  39.1977    7.50432        8.94033  38.3297     6.7425        8.46763 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
120  25.0708    5.52274        9.27837  38.165    6.75767        8.49297 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
130  36.8008    6.44687        8.29943  37.9857    6.80255        8.56182 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
140  38.2324    6.60984        8.61963  37.8049    6.80838        8.57763 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
150  32.5302    5.90598         8.0799  37.5349    6.72001        8.47248 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
160  41.4071    7.63957        9.16632  37.3954     6.7734        8.53868 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
170  37.8645    6.86932        8.24409  37.2007    6.74556        8.49805 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
180  35.0457    6.87259        8.82783  37.0049    6.69299        8.43433 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
190  41.3194    7.06996        8.04794  36.8587     6.6826        8.42237 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
200  37.7014    6.39026        7.89669  36.6748    6.70132        8.45841 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
210  52.8262    9.24387        9.32736  36.4069    6.60146        8.35251 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
220  31.2434    5.47828        7.76178  36.3627      6.435        8.14253 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
230  34.6236    5.77741        7.61703  36.2222     6.5667        8.32426 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
240  37.9644    6.67956         8.6221   36.23    6.71368        8.51739 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
250  36.3788    6.19884        8.00849  36.2443    6.78856        8.60522 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
260  36.0509    7.13083        8.43101  36.1497    6.77337        8.58696 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
270  42.693    6.79694        7.56245  35.9742    6.58168        8.34412 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
280  39.1164    7.05445         8.6269  35.8999    6.57557        8.33085 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
290  34.7188    6.57786        8.23342  35.8248     6.6154          8.373 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
300  45.6693    7.30934        7.80138  35.7933    6.69672        8.48203 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
310  36.7344    6.38241        7.98314  35.6762    6.67189          8.453 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
320  47.1647     7.8217        8.15565  35.6293    6.71533         8.5019 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
330  32.1421     6.2349        8.67543  35.6847    6.83613        8.64375 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
340  40.5062    7.88595        8.87262  35.8347    6.95498        8.78423 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
350  27.4655    5.39962        8.05326  35.652    6.92257         8.7466 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
360  40.1694    7.53653        8.42328  35.3601    6.82193        8.61399 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
370  30.9223    6.21849        8.22387  35.1881    6.74259        8.51151 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
380  35.426     6.9648        8.44264  35.1282    6.72618        8.49199 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
390  42.7194    7.07416        7.71899  35.0653    6.59323        8.31123 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
400  45.3913    7.98787        8.17174  35.0801    6.56555         8.2657 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
410  35.7805    6.36642        8.08474  35.0548    6.68359        8.40552 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
420  36.1803    6.45312        7.95312  34.9749    6.74789        8.49626 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
430  37.6193    6.92529         8.3276  34.9315    6.81067        8.58265 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
440  38.9319    6.78643        8.01762  34.8261    6.77917        8.53836 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
450  33.7369    6.49344        8.07451  34.7988    6.80336        8.56528 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
460  38.1374    6.76596        7.98402  34.8667    6.86476        8.64168 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
470  43.9835    8.08917        8.72237  34.8406    6.82863        8.59178 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
480  35.6574    6.18726        7.73042  34.7868    6.79352        8.54169 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
490  39.5931    7.17392        8.15222  34.8427    6.88601        8.64281 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
500  43.6549     8.2044        8.50248  34.8213    6.88969        8.64487 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
510  38.2294    6.54495        7.87691  34.7539    6.84074        8.57236 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
520  34.2626    6.66437         8.2236  34.6841    6.83926        8.56749 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
530  48.4841    7.87987        7.71161  34.5543    6.74858        8.45613 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
540  31.3915    5.99427        8.14784  34.5808     6.5528        8.19332 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
550  42.1952    7.38298        7.93763  34.5451     6.5814        8.23495 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
560  34.6156    6.35396        7.79055  34.4682    6.69274        8.38605 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
570  36.2202    6.72333        8.09955  34.4759    6.84953        8.59265 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
580  35.3645    6.90652        8.68061  34.4963    6.92333        8.68718 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
590  33.6665    6.33403        8.27158  34.3767    6.82098        8.54598 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
600  38.0675    7.19841          8.232  34.3496    6.75815        8.44953 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
610  37.9689    7.11345        8.42095  34.3479    6.76468        8.44263 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
620  38.7353    7.10723        8.29858  34.3295    6.84993        8.55949 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
630  31.9445    6.26122        8.02154  34.3242    6.85445         8.5702 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
640  38.1591    6.90958        8.02217  34.2914    6.89063        8.61935 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
650  30.8554      6.243        8.37868  34.3282    6.96761        8.72102 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
660  29.2718    6.12057        8.23585  34.3961    7.04322        8.82167 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
670  38.7479    7.09476        8.28207  34.3985    7.04976        8.82872 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
680  38.2311    7.05672        8.21698  34.2987    7.00502        8.76104 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
690  32.3838    6.28984        8.20055  34.2234     6.9361        8.65831 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
700  30.3151    6.42901        8.43965  34.1779    6.88622        8.59316 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
710  35.6673    7.16528        8.39311  34.1601      6.832        8.51399 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
720  42.3553    7.44352         7.9438  34.2883    6.69107        8.31691 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
730  35.7597    6.45835        8.05563  34.3149    6.70162        8.32737 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
740  35.002    6.79156        8.53756  34.2163     6.8026        8.46584 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
750  53.3678    8.06812        8.09002  34.1564    6.87437        8.56936 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
760  40.1235      7.476         8.1999  34.1187    6.90099        8.61073 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
770  31.3726    6.63396        8.70383  34.0899    6.86858        8.56428 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
780  34.128    6.99001        9.19669  34.1162    6.92973        8.64883 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
790  38.7198    7.55244        8.69319  34.1323    6.90689        8.62806 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
800  33.2942    5.68088        7.75124  34.1227    6.81422        8.50742 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
810  33.143    6.31509         8.0881  34.1577    6.92928        8.65032 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
820  37.0549    7.30857        8.29879  34.1829    6.95896         8.6778 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
830  35.1722    6.41665         7.8033  34.1705     6.9081        8.60834 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
840  33.401    6.71163        8.48202  34.1611    6.88703        8.57433 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
850  35.4135    6.81086        8.13929  34.1338    6.86589         8.5511 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
860  26.3468    5.93669        8.85734  34.1093    6.78009        8.44083 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
870  36.2175    6.88814        8.44378  34.1679    6.68112        8.31444 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
880  36.0372    6.16858        7.72635  34.1966    6.68438        8.32635 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
890  43.1865    7.86061        8.29977  34.1282    6.83581        8.53219 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
900  36.6404    7.39766        8.59048  34.1248    6.93997        8.66995 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
910  32.7244    6.62801        8.66838  34.1061    6.94823        8.68132 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
920  35.8668    6.49993        7.81155  34.0951     6.8477        8.53208 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
930  33.7229    6.98906        8.57994  34.1012    6.84404        8.51801 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
940  28.5102    6.12539        8.38542  34.0795    6.87923        8.55791 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
950  32.6044    6.57435        8.53108  34.0871    6.91675        8.62265 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
960  34.9701    6.59162         8.0036  34.0742    6.91989        8.63248 

    TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
970  37.269    7.16249        8.34836  34.0777    6.98076         8.7198 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
980  32.3021    6.56554        8.53118  34.1128    7.03928        8.80173 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
990  29.0151    6.42073        8.83196  34.1663    7.07819        8.85767 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1000  35.9751    7.20182        8.79416  34.1567    7.06972        8.84475 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1010  33.3246    6.61792        8.34506  34.0886    6.99864        8.73547 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1020  32.4216    6.70169        8.52849  34.0414    6.93325        8.64604 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1030  32.1027    6.89699        8.85881  33.9935    6.89381        8.59853 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1040  38.6011    7.48165         8.3394  33.9909    6.78536        8.44934 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1050  35.7591    6.76316        8.12063  34.0281    6.73024        8.38151 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1060  33.9061    7.12478        8.93631  33.9881    6.79247         8.4604 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1070  30.3191    6.51493        8.40019  33.9252     6.8389        8.53241 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1080  37.1411    6.96635        8.07509  33.8903    6.89373         8.6153 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1090  37.029    6.83421        8.20588  33.8469    6.86528         8.5812 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1100  38.1007    7.48305        8.89387  33.8535    6.88521        8.60551 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1110  31.2495    6.46967        8.53837  33.8687    6.90266        8.64082 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1120  39.1758    7.72712        8.82406  33.8699     6.8467        8.57271 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1130  36.1927    7.08105        8.19923  33.8932    6.87056        8.60082 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1140  56.0056     8.9149        8.33987  33.9821    6.97592        8.72234 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1150  39.3045    7.99949        8.77745  33.9852    6.96336        8.70898 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1160  32.7479    6.97707        8.89389  33.9384    6.90504         8.6329 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1170  35.0143    7.03698        8.49296  33.9189    6.89618        8.62237 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1180  32.1099    6.56211        8.13006  33.8941    6.81304          8.524 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1190  30.3978    6.19793        8.36756  33.9694    6.67837        8.34843 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1200  39.2971    7.19004        8.16867  34.0131    6.65457        8.32673 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1210  36.4626     6.5944        8.05114  33.9527    6.76221        8.47209 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1220  32.4529    6.86724        9.05621  33.9367     6.8978        8.64784 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1230  41.4659     7.6272        9.02029   33.93    6.97198        8.74908 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1240  34.8943    7.13743        8.65015  33.866    6.88395        8.62387 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1250  36.7508    7.40455        8.89773  33.8602    6.85026        8.57187 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1260  38.7119    7.14474        8.11983  33.864    6.84131        8.54897 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1270  34.1685    6.85832         8.6493  33.8845    6.90202        8.64163 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1280  35.9934    7.03951        8.36304  33.8923    6.90028        8.64919 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1290  32.0587    6.25387        8.18333  33.8646    6.93161        8.69471 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1300  27.181    6.35549        8.95704  33.8786    6.99145        8.77594 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1310  31.4261     6.4896        8.46803  33.9366    7.04232        8.84952 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1320  24.0537    5.54935        8.82415  33.9643     7.0473        8.86199 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1330  29.213    6.17249        8.51995  33.8904    6.99213        8.78233 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1340  32.8295    6.35771        8.26171  33.8304    6.93025        8.69262 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1350  32.9287    6.77638        8.36926  33.7776    6.88046        8.63033 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1360  40.1914    7.56007        8.58243  33.7269      6.834        8.56918 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1370  40.6317    7.60181        8.27243  33.7966    6.71973        8.41388 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1380   33.31    6.34096        8.03639  33.7926    6.73618        8.43343 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1390  34.5966    7.27733         9.0709  33.7529    6.83919        8.57161 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1400  40.4333    7.78061        8.88525  33.7383    6.88957        8.64818 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1410  38.0164    6.95342        8.15991  33.6936    6.84984        8.59869 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1420  31.3494    5.93674        7.98008  33.6819    6.81739        8.55481 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1430  54.7227    9.63138        9.23983  33.7143    6.90109        8.67028 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1440  38.873    7.33136        8.10504  33.7137    6.85084        8.61176 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1450  31.625    6.25335        8.00493  33.7085    6.77023        8.51213 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1460  32.842    6.65889        8.51689  33.7856    6.93151        8.70562 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1470  31.3606    6.71252        8.83867  33.8349    6.96455        8.73802 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1480  31.5728    6.08035        8.36825  33.7796    6.89014        8.64703 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1490  33.6217     6.9793        8.59088  33.7506    6.86062        8.61119 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1500  37.0351    7.22274        8.42918  33.7359    6.81136         8.5581 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1510  37.0648    7.83505        9.65056  33.7751    6.71522        8.43622 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1520  37.2239    6.56562        8.02321  33.8702    6.62508        8.32316 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1530  30.661    5.48209        7.70208  33.8555    6.65325         8.3676 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1540  29.3265    6.15493        8.38461  33.7765    6.82922        8.59892 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1550  29.6952    6.09139        8.40399  33.7525    6.92062        8.71221 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1560  39.4029    7.44419        8.64244  33.708    6.91376        8.70222 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1570  32.4833    7.04628        9.15551  33.6999    6.81566         8.5597 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1580  33.2639    6.46292        8.43392  33.7102    6.80814        8.54457 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1590  41.9434    7.40033        7.93677  33.7252    6.87233        8.63051 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1600  34.069    6.91117        8.54427  33.7667    6.89243        8.67149 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1610  34.8842     7.0494        8.34573  33.745    6.89555        8.68356 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1620   35.88    7.06653         8.7262  33.7455    6.94939        8.75594 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1630  37.5796    7.14999        8.59704  33.7829    6.99488        8.82079 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1640  34.7304    7.07697        8.57783  33.8317    7.02212        8.86765 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1650  38.949    7.67518        8.72907  33.8325    7.01627        8.85859 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1660  31.983    6.99454        8.83013  33.7347    6.93703        8.74318 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1670  30.3901    6.35448        8.61376  33.6731    6.87417        8.65877 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1680  38.2459     7.6628        8.83631  33.6257    6.86102        8.64726 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1690  43.8054     7.9722        8.12203  33.6476    6.74483        8.47846 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1700  29.9021    6.12553        8.37323  33.7003    6.70568        8.42439 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1710  31.1781    6.62417        8.47918  33.671    6.78703        8.52637 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1720  34.9695    6.38537        7.96302  33.6379    6.81398        8.57271 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1730  36.2132     6.9211        8.38906  33.6248    6.84091        8.61484 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1740  37.3857    7.26034        8.54898  33.6039    6.79437        8.55041 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1750  32.8849    6.88984        8.70927  33.6044    6.84565         8.6191 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1760  38.5669    7.50796        8.62642  33.6201    6.84088        8.62339 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1770  37.8636    6.61536        7.77578  33.6276    6.75395        8.51208 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1780  32.4461     6.4933        8.11031  33.6359    6.84092        8.61924 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1790  31.0141    6.59001        8.57286  33.7164    6.94204        8.73037 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1800  35.638    6.70556        8.16909  33.7092    6.89755        8.67206 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1810  37.0556    7.15579        8.56646  33.6853    6.83395        8.59118 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1820  39.6005    8.11184        9.49712  33.6821    6.83127         8.5937 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1830  39.9962     7.3435        8.21658  33.7125    6.74303        8.48718 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1840  34.3519    7.08461        8.73561  33.8079    6.64186         8.3543 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1850  29.1798    5.56802        7.80151   33.85    6.61625        8.32922 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1860  36.3462    7.20291        8.28331   33.72    6.72984        8.48321 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1870  38.006    7.32936        8.29435  33.6529    6.85304        8.64054 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1880  33.168    6.98912        8.77069  33.636     6.9241        8.73213 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1890  33.1079    6.19797        8.13516  33.6529    6.83325        8.59376 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1900  34.2317     6.2855        8.05744  33.6788    6.81752        8.56666 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1910  36.0811    6.56317        7.82806  33.6942    6.82306        8.56516 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1920  35.9319    7.20199        8.57408  33.7373    6.86194        8.63178 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1930  36.3441    6.40205        7.76193  33.744    6.86365        8.64559 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1940  28.4428    6.38035        8.67351  33.7212    6.90339        8.70284 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1950  26.6382    5.94821        8.50783  33.7205     6.9529        8.76907 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1960  30.211    6.33177        8.40975  33.7444    6.98103        8.81614 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1970  29.6717    6.65581        9.15595  33.7733    6.99219        8.84215 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
1980  34.9931    7.00131        8.51661  33.722    6.95932        8.79193 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
1990  36.5749    7.47415        9.04464  33.6675    6.92893        8.74539 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2000  33.3544    6.97706        8.49984  33.5913    6.87588        8.68253 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2010  42.2321    8.13229        8.76843  33.5359    6.82147        8.60486 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2020  38.2397    7.47949        8.50417  33.6104    6.74108        8.48808 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2030  31.0192     6.3203        8.44109  33.6198    6.75738        8.50111 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2040  35.4496    6.91778        8.73346  33.6081    6.78241        8.53513 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2050  40.1613    7.71319        8.45566  33.5859    6.80191         8.5687 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2060  27.0829    5.89952        8.88099  33.567    6.77471        8.53011 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2070  30.9376    5.94887        8.17314  33.5586    6.77315        8.52712 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2080  32.7774    6.75044        8.30347  33.569    6.83413        8.61459 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2090  40.2881      7.909        8.44208  33.5814    6.80394        8.58157 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2100  35.8956    6.41085        7.69688  33.5777    6.75334          8.519 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2110  36.2524    7.32888        8.76616  33.632    6.88474        8.66646 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2120  37.9977    7.38408        8.52772  33.6833    6.91474        8.69326 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2130  34.9821    6.89098        8.50812  33.6706    6.85865        8.62528 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2140  32.5159    6.31817        8.25483  33.6554    6.83374        8.59773 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2150  38.214    6.64846        8.04292  33.666    6.77865        8.54075 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2160  30.2028    6.24266        8.41041  33.7071     6.6943        8.43498 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2170  39.4688     7.1967        7.90824  33.7516    6.62246        8.35037 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2180  35.6266    6.93709        8.34997  33.7223    6.63809        8.37904 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2190  39.4659    7.36593        8.23649  33.6053    6.78587        8.57131 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2200  34.9227    6.74645        8.29555  33.562    6.88621        8.69641 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2210  41.9647    8.09618        9.10945  33.5346    6.87206         8.6697 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2220  29.5655    6.15514         8.4867  33.5728     6.8067        8.56903 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2230  38.4021    6.76226        8.03534  33.5901    6.78604        8.53807 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2240  34.2024    7.14758         8.6379  33.6251    6.83068         8.5992 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2250  30.5691    6.73444        8.79514  33.6743    6.85405        8.64039 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2260  30.0031     6.4241        8.49177  33.6472    6.87502        8.67593 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2270  32.368    6.99029        8.92381  33.6523    6.92775        8.74561 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2280  30.0711    6.16796        8.46692  33.674    6.95837        8.79468 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2290  43.7473    7.34428        7.77529  33.6968    6.97332        8.83253 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2300  36.9423    7.59138        9.37934  33.6993    6.97597        8.83501 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2310  40.187    7.96975        8.78384  33.6271    6.93221        8.76844 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2320  34.4945    7.07228        8.55705  33.5507     6.8703        8.68643 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2330  35.0818    7.07348        8.35306  33.4937    6.83513        8.64555 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2340  37.0864    7.27612        8.28827  33.5239    6.74466        8.51255 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2350  31.8484     6.5135        8.43533  33.5593    6.71811        8.47383 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2360  36.7855    6.95111        8.41953  33.5561    6.77337        8.53667 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2370  30.434    6.14985        8.19993  33.5379    6.76831        8.53524 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2380  35.3326      7.089         8.4211  33.5185     6.7652        8.53269 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2390  29.3465    6.34878        8.76276  33.5041    6.73385        8.48848 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2400  33.4879    6.88616        8.62524  33.4965    6.80439        8.58291 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2410  29.7325    6.04466        8.19736  33.5106    6.79989        8.59115 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2420  28.9911    6.07004        8.59687  33.5088    6.73517        8.51121 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2430  34.3545     7.1851        8.73451  33.5306    6.83518        8.62501 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2440  34.0302    6.69113        8.41707  33.5986    6.91074        8.70085 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2450  35.6532    7.50233        9.09378  33.6014    6.88363        8.66956 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2460  38.6834    7.48097         8.5332  33.5754    6.83518        8.61532 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2470  30.9127    6.74616        9.23295  33.5744    6.79971        8.57959 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2480  52.1498     8.9436        8.41685  33.6068    6.72403         8.4909 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2490  29.4145    6.49049        8.57138  33.662    6.61445        8.35309 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2500  41.028    7.64705        8.63686  33.7093    6.57457        8.31236 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2510  33.3531    6.65922        8.67756  33.5608    6.71557        8.49712 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2520  33.914    6.10012        7.67795  33.5033    6.82959        8.63741 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2530  37.9089    7.40426        8.35262  33.4676    6.88219        8.70177 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2540  37.5141     6.6187         7.7352  33.4754    6.80216        8.58116 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2550  29.5016    6.85595        9.56591  33.4903    6.78506        8.55391 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2560  37.9762    6.87381        7.85687  33.5177    6.79492        8.55917 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2570  36.7791    6.91866        7.96428  33.582    6.84007        8.63018 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2580  37.2223    7.18969         8.3332  33.5848    6.85056        8.65273 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2590  37.8625    7.37283        8.59364  33.5734    6.89786        8.72015 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2600  32.2061    6.57541        8.67927  33.5715    6.93348        8.77015 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2610  35.1567    6.96721        8.39081  33.6001    6.96116        8.82388 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2620  25.3519    5.73145        8.71873  33.6102     6.9579        8.83221 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2630   30.39    6.10911        8.13727  33.5396    6.90931        8.75883 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2640  33.7564    6.79418        8.53406  33.4881    6.87133        8.70159 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2650  32.6678    6.94454        9.00355  33.4347    6.83144        8.65761 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2660  33.3746    6.95041        8.58976  33.4188    6.76854        8.56639 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2670  50.1821    8.63994        8.11408  33.4871    6.71048        8.48516 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2680  34.4756    6.78371        8.38488  33.4867     6.7546        8.53539 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2690  35.619    6.71675        8.02968  33.4853    6.76036        8.54088 

     TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2700  36.608    7.08445        8.47241  33.462    6.77041        8.55801 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2710  34.8888    6.73326         8.5158  33.4379    6.73093        8.50132 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2720  33.8214    6.46193        8.08747  33.4176    6.74708        8.52393 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2730  38.1245    7.33127        8.59081  33.4263    6.81311         8.6215 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2740  41.5325    8.12752        8.97337  33.4316    6.77803        8.58031 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2750  33.3673    6.24628        7.93099  33.4225    6.75348        8.54605 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2760  34.4898    7.22083        9.04758  33.5009    6.89681        8.70904 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2770  43.9961    8.14167        8.52988  33.5277    6.90693         8.7171 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2780  31.756     6.2247        8.48434  33.4904    6.82053        8.61094 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2790  32.1326    6.83941        8.68861  33.4826    6.78761        8.57711 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2800  42.1534    7.51799        8.00094  33.4987    6.72521        8.51055 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2810  32.5269     6.5364        8.23403  33.5565    6.63578        8.39374 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2820  34.6161    6.78274        8.52618  33.6156    6.57068        8.31983 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2830  36.3156    6.68271        7.92236  33.5518     6.6231        8.39044 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2840  32.8818    6.61501         8.2705  33.4528     6.7733        8.58068 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2850  34.3701    6.76283        8.38704  33.4137    6.86455        8.69313 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2860  27.954    5.70166         8.5213  33.3817    6.81784        8.62163 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2870  31.8443    6.95499         8.4802  33.414    6.78338        8.56617 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2880  33.9277    6.79365        8.49715  33.4428     6.7752        8.54854 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2890  36.4027    6.78913        8.40834  33.4884    6.82182        8.61234 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2900  33.3286    6.99973        8.59824  33.5256    6.84014        8.64451 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2910  36.3923    7.21456        8.63042  33.5016    6.86514        8.68354 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2920  26.2691    5.91867        8.68341  33.5046     6.9069         8.7398 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2930  34.7535     6.6529        7.95745  33.5284    6.92987        8.78178 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2940  37.114    6.88656        8.08281  33.5461    6.94535        8.82676 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2950  29.4851    6.82189        9.18459  33.521    6.93512        8.81223 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2960  35.0428    7.01226         8.6075  33.4554    6.89536        8.74985 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2970  27.2787    6.38478        9.18814  33.3909    6.83406        8.67089 

      TR.loss TR.d_pairs TR.d_non_pairs TE.loss TE.d_pairs TE.d_non_pairs
2980  30.2172    6.48661        8.71847  33.355     6.8046        8.63491 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
2990  41.4874    7.73534        8.42874  33.3999    6.72232        8.51742 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3000  37.4132    7.34945         8.4391  33.4243    6.71056        8.49601 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3010  32.0406    6.80794        8.84238  33.4276     6.7555        8.54561 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3020  32.9977    6.89584        8.41426  33.4116    6.75595         8.5484 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3030  36.3105    7.31893         8.6239  33.3958    6.74314        8.52779 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3040  28.8677    6.37877         8.4617  33.3766    6.71466        8.48883 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3050  28.7933    6.22567        8.82355  33.3703     6.7978        8.60041 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3060  29.2274    6.45005         8.8938  33.3781    6.77909        8.59095 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3070  27.8928    5.19329        7.79018  33.3696    6.70884        8.50312 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3080  33.4264    6.65784        8.50039  33.4013    6.84595        8.66053 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3090  32.1336    7.11876        9.01658  33.4612     6.9146        8.73181 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3100  39.1469    6.88132        8.25148  33.4224    6.85798        8.66628 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3110  34.3302    6.36508        8.35128  33.3906    6.79239         8.5918 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3120  31.1982    6.16945        8.21163  33.3925    6.74799        8.54914 

     TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3130  30.721    6.65844        8.75108  33.4464    6.67358        8.45524 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3140  32.4117    6.91693        8.96086  33.5261    6.57255        8.32732 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3150  34.0715    5.67127        7.57098  33.5753    6.54318        8.29888 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3160  33.6351     6.8174        8.32194  33.4083    6.71279        8.51775 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3170  33.3606    7.20612        8.84145  33.3617    6.81837        8.64439 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3180  31.2317    6.79606          8.574  33.3329    6.84472        8.67246 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3190  32.6545    6.63326        8.27141  33.3595    6.78418         8.5793 

      TR.loss TR.d_pairs TR.d_non_pairs  TE.loss TE.d_pairs TE.d_non_pairs
3200  33.0516    7.24116        9.36907  33.3831    6.77395        8.56043 

Plot train and test outcome

loss functions

Note that training loss fluctuates much more as it's computed for a different batch at every step, while test error is (currently) computed for the same (slightly larger) subset at every step.


In [32]:
plt.figure(figsize=(10,4))
plt.plot(network.train_log['TR.loss']);
plt.plot(network.train_log['TE.loss'], color='k');
plt.title('train (b) and test (k) loss function');


distances


In [33]:
def plot_distances(feed):
    y_A, y_B = sess.run([network.subnet_A[-1], network.subnet_B[-1]],
                                  feed_dict=feed)
    is_cover = feed[network.is_cover]

    pair_dists = np.sqrt(np.sum((y_A - y_B)**2, axis=1))[np.where(is_cover==1)]
    non_pair_dists = np.sqrt(np.sum((y_A - y_B)**2, axis=1))[np.where(is_cover==0)]

    bins = np.arange(0,20,0.5)
    plt.figure(figsize=(16,4))
    plt.subplot(121)
    plt.hist(non_pair_dists, bins=bins, alpha=0.5);
    plt.hist(pair_dists, bins=bins, color='r', alpha=0.5);
    plt.subplot(143)
    plt.boxplot([non_pair_dists, pair_dists]);
    
# train distances
train_feed = {network.x_A:train_batch[0], network.x_B:train_batch[1], network.is_cover: train_batch[2]}
plot_distances(train_feed)

# test distances
test_feed = {network.x_A: X_A_T, network.x_B: X_B_T, network.is_cover: Y_T}
plot_distances(test_feed)


Test fingerprint

Test the learned fingerprint and compare to other impelementations.


In [34]:
import main
import fingerprints as fp

In [35]:
def fingerprint(chroma, n_patches=8, patch_len=64):
    n_frames, n_bins = chroma.shape
    if not n_frames == n_patches * patch_len:
        chroma = paired_data.patchwork(chroma, n_patches=n_patches,
                                       patch_len=patch_len)
    fps = []
    for i in range(12):
        chroma_trans = np.roll(chroma, -i, axis=1)
        chroma_tensor = chroma_trans.reshape((1, n_patches*patch_len, 12))
        network_out = network.subnet_A[-1]
        fp = network_out.eval(feed_dict={network.x_A : chroma_tensor})
        fps.append(fp.flatten())
    return fps

covariance-based fingerprint

Kim, S., Unal, E., & Narayanan, S. (2008). Music fingerprint extraction for classical music cover song identification. IEEE Conference on Multimedia and Expo.

test_cliques_big:

results: {'mean r5': 0.073941374228151044, 'mean ap': 0.069848998736677395, 'mean p1': 0.097366977509599564}

In [36]:
results = main.run_leave_one_out_experiment(test_cliques_big,
                                            fp_function=fp.cov,
                                            print_every=50)
print('results:', results)


Computing fingerprints...
    Fingerprinting track 50/3646...
    Fingerprinting track 100/3646...
    Fingerprinting track 150/3646...
    Fingerprinting track 200/3646...
    Fingerprinting track 250/3646...
    Fingerprinting track 300/3646...
    Fingerprinting track 350/3646...
    Fingerprinting track 400/3646...
    Fingerprinting track 450/3646...
    Fingerprinting track 500/3646...
    Fingerprinting track 550/3646...
    Fingerprinting track 600/3646...
    Fingerprinting track 650/3646...
    Fingerprinting track 700/3646...
    Fingerprinting track 750/3646...
    Fingerprinting track 800/3646...
    Fingerprinting track 850/3646...
    Fingerprinting track 900/3646...
    Fingerprinting track 950/3646...
    Fingerprinting track 1000/3646...
    Fingerprinting track 1050/3646...
    Fingerprinting track 1100/3646...
    Fingerprinting track 1150/3646...
    Fingerprinting track 1200/3646...
    Fingerprinting track 1250/3646...
    Fingerprinting track 1300/3646...
    Fingerprinting track 1350/3646...
    Fingerprinting track 1400/3646...
    Fingerprinting track 1450/3646...
    Fingerprinting track 1500/3646...
    Fingerprinting track 1550/3646...
    Fingerprinting track 1600/3646...
    Fingerprinting track 1650/3646...
    Fingerprinting track 1700/3646...
    Fingerprinting track 1750/3646...
    Fingerprinting track 1800/3646...
    Fingerprinting track 1850/3646...
    Fingerprinting track 1900/3646...
    Fingerprinting track 1950/3646...
    Fingerprinting track 2000/3646...
    Fingerprinting track 2050/3646...
    Fingerprinting track 2100/3646...
    Fingerprinting track 2150/3646...
    Fingerprinting track 2200/3646...
    Fingerprinting track 2250/3646...
    Fingerprinting track 2300/3646...
    Fingerprinting track 2350/3646...
    Fingerprinting track 2400/3646...
    Fingerprinting track 2450/3646...
    Fingerprinting track 2500/3646...
    Fingerprinting track 2550/3646...
    Fingerprinting track 2600/3646...
    Fingerprinting track 2650/3646...
    Fingerprinting track 2700/3646...
    Fingerprinting track 2750/3646...
    Fingerprinting track 2800/3646...
    Fingerprinting track 2850/3646...
    Fingerprinting track 2900/3646...
    Fingerprinting track 2950/3646...
    Fingerprinting track 3000/3646...
    Fingerprinting track 3050/3646...
    Fingerprinting track 3100/3646...
    Fingerprinting track 3150/3646...
    Fingerprinting track 3200/3646...
    Fingerprinting track 3250/3646...
    Fingerprinting track 3300/3646...
    Fingerprinting track 3350/3646...
    Fingerprinting track 3400/3646...
    Fingerprinting track 3450/3646...
    Fingerprinting track 3500/3646...
    Fingerprinting track 3550/3646...
    Fingerprinting track 3600/3646...
Running queries...
    Running queries for clique 50/1166
    Running queries for clique 100/1166
    Running queries for clique 150/1166
    Running queries for clique 200/1166
    Running queries for clique 250/1166
    Running queries for clique 300/1166
    Running queries for clique 350/1166
    Running queries for clique 400/1166
    Running queries for clique 450/1166
    Running queries for clique 500/1166
    Running queries for clique 550/1166
    Running queries for clique 600/1166
    Running queries for clique 650/1166
    Running queries for clique 700/1166
    Running queries for clique 750/1166
    Running queries for clique 800/1166
    Running queries for clique 850/1166
    Running queries for clique 900/1166
    Running queries for clique 950/1166
    Running queries for clique 1000/1166
    Running queries for clique 1050/1166
    Running queries for clique 1100/1166
    Running queries for clique 1150/1166
results: {'mean r5': 0.073941374228151044, 'mean ap': 0.069848998736677395, 'mean p1': 0.097366977509599564}

2d-DFT-based fingerprint

Bertin-Mahieux, T., & Ellis, D. P. W. (2012). Large-Scale Cover Song Recognition Using The 2d Fourier Transform Magnitude. In Proc. International Society for Music Information Retrieval Conference.

The PCA step at the end of the algorithm is not implemented at the moment. Without PCA, a patch length of 64 was found to be better than the original 75, and mean pooling across patches worked better than median-pooling, so these parameters were used instead. The difference between PCA and no PCA performance on a 12K test set was 0.08912 vs. 0.09475 mean average precision, or about 6%.

test_cliques_big:

results: {'mean r5': 0.11885786185784572, 'mean ap': 0.11072061679198177, 'mean p1': 0.14070213933077344}

In [37]:
results = main.run_leave_one_out_experiment(test_cliques_big,
                                            fp_function=fp.fourier,
                                            print_every=50)
print('results:', results)


Computing fingerprints...
    Fingerprinting track 50/3646...
    Fingerprinting track 100/3646...
    Fingerprinting track 150/3646...
    Fingerprinting track 200/3646...
    Fingerprinting track 250/3646...
    Fingerprinting track 300/3646...
    Fingerprinting track 350/3646...
    Fingerprinting track 400/3646...
    Fingerprinting track 450/3646...
    Fingerprinting track 500/3646...
    Fingerprinting track 550/3646...
    Fingerprinting track 600/3646...
    Fingerprinting track 650/3646...
    Fingerprinting track 700/3646...
    Fingerprinting track 750/3646...
    Fingerprinting track 800/3646...
    Fingerprinting track 850/3646...
    Fingerprinting track 900/3646...
    Fingerprinting track 950/3646...
    Fingerprinting track 1000/3646...
    Fingerprinting track 1050/3646...
    Fingerprinting track 1100/3646...
    Fingerprinting track 1150/3646...
    Fingerprinting track 1200/3646...
    Fingerprinting track 1250/3646...
    Fingerprinting track 1300/3646...
    Fingerprinting track 1350/3646...
    Fingerprinting track 1400/3646...
    Fingerprinting track 1450/3646...
    Fingerprinting track 1500/3646...
    Fingerprinting track 1550/3646...
    Fingerprinting track 1600/3646...
    Fingerprinting track 1650/3646...
    Fingerprinting track 1700/3646...
    Fingerprinting track 1750/3646...
    Fingerprinting track 1800/3646...
    Fingerprinting track 1850/3646...
    Fingerprinting track 1900/3646...
    Fingerprinting track 1950/3646...
    Fingerprinting track 2000/3646...
    Fingerprinting track 2050/3646...
    Fingerprinting track 2100/3646...
    Fingerprinting track 2150/3646...
    Fingerprinting track 2200/3646...
    Fingerprinting track 2250/3646...
    Fingerprinting track 2300/3646...
    Fingerprinting track 2350/3646...
    Fingerprinting track 2400/3646...
    Fingerprinting track 2450/3646...
    Fingerprinting track 2500/3646...
    Fingerprinting track 2550/3646...
    Fingerprinting track 2600/3646...
    Fingerprinting track 2650/3646...
    Fingerprinting track 2700/3646...
    Fingerprinting track 2750/3646...
    Fingerprinting track 2800/3646...
    Fingerprinting track 2850/3646...
    Fingerprinting track 2900/3646...
    Fingerprinting track 2950/3646...
    Fingerprinting track 3000/3646...
    Fingerprinting track 3050/3646...
    Fingerprinting track 3100/3646...
    Fingerprinting track 3150/3646...
    Fingerprinting track 3200/3646...
    Fingerprinting track 3250/3646...
    Fingerprinting track 3300/3646...
    Fingerprinting track 3350/3646...
    Fingerprinting track 3400/3646...
    Fingerprinting track 3450/3646...
    Fingerprinting track 3500/3646...
    Fingerprinting track 3550/3646...
    Fingerprinting track 3600/3646...
Running queries...
    Running queries for clique 50/1166
    Running queries for clique 100/1166
    Running queries for clique 150/1166
    Running queries for clique 200/1166
    Running queries for clique 250/1166
    Running queries for clique 300/1166
    Running queries for clique 350/1166
    Running queries for clique 400/1166
    Running queries for clique 450/1166
    Running queries for clique 500/1166
    Running queries for clique 550/1166
    Running queries for clique 600/1166
    Running queries for clique 650/1166
    Running queries for clique 700/1166
    Running queries for clique 750/1166
    Running queries for clique 800/1166
    Running queries for clique 850/1166
    Running queries for clique 900/1166
    Running queries for clique 950/1166
    Running queries for clique 1000/1166
    Running queries for clique 1050/1166
    Running queries for clique 1100/1166
    Running queries for clique 1150/1166
results: {'mean r5': 0.11885786185784572, 'mean ap': 0.11072061679198177, 'mean p1': 0.14070213933077344}

learned fingerprint

We now see that with the right configuration, we are able to make the fingerprinter do a little bit better than the 2d-DFT-based fingerprints:

test_cliques_big with W_1 = 12x12 and W_2 = 12x12.

fp_results: {'mean r5': 0.13775251746235256, 'mean ap': 0.12335753431869072, 'mean p1': 0.15551289083927591}

In [38]:
results = main.run_leave_one_out_experiment(test_cliques_big,
                                            fp_function=fingerprint,
                                            print_every=50)
print('fp_results:', results)


Computing fingerprints...
    Fingerprinting track 50/3646...
    Fingerprinting track 100/3646...
    Fingerprinting track 150/3646...
    Fingerprinting track 200/3646...
    Fingerprinting track 250/3646...
    Fingerprinting track 300/3646...
    Fingerprinting track 350/3646...
    Fingerprinting track 400/3646...
    Fingerprinting track 450/3646...
    Fingerprinting track 500/3646...
    Fingerprinting track 550/3646...
    Fingerprinting track 600/3646...
    Fingerprinting track 650/3646...
    Fingerprinting track 700/3646...
    Fingerprinting track 750/3646...
    Fingerprinting track 800/3646...
    Fingerprinting track 850/3646...
    Fingerprinting track 900/3646...
    Fingerprinting track 950/3646...
    Fingerprinting track 1000/3646...
    Fingerprinting track 1050/3646...
    Fingerprinting track 1100/3646...
    Fingerprinting track 1150/3646...
    Fingerprinting track 1200/3646...
    Fingerprinting track 1250/3646...
    Fingerprinting track 1300/3646...
    Fingerprinting track 1350/3646...
    Fingerprinting track 1400/3646...
    Fingerprinting track 1450/3646...
    Fingerprinting track 1500/3646...
    Fingerprinting track 1550/3646...
    Fingerprinting track 1600/3646...
    Fingerprinting track 1650/3646...
    Fingerprinting track 1700/3646...
    Fingerprinting track 1750/3646...
    Fingerprinting track 1800/3646...
    Fingerprinting track 1850/3646...
    Fingerprinting track 1900/3646...
    Fingerprinting track 1950/3646...
    Fingerprinting track 2000/3646...
    Fingerprinting track 2050/3646...
    Fingerprinting track 2100/3646...
    Fingerprinting track 2150/3646...
    Fingerprinting track 2200/3646...
    Fingerprinting track 2250/3646...
    Fingerprinting track 2300/3646...
    Fingerprinting track 2350/3646...
    Fingerprinting track 2400/3646...
    Fingerprinting track 2450/3646...
    Fingerprinting track 2500/3646...
    Fingerprinting track 2550/3646...
    Fingerprinting track 2600/3646...
    Fingerprinting track 2650/3646...
    Fingerprinting track 2700/3646...
    Fingerprinting track 2750/3646...
    Fingerprinting track 2800/3646...
    Fingerprinting track 2850/3646...
    Fingerprinting track 2900/3646...
    Fingerprinting track 2950/3646...
    Fingerprinting track 3000/3646...
    Fingerprinting track 3050/3646...
    Fingerprinting track 3100/3646...
    Fingerprinting track 3150/3646...
    Fingerprinting track 3200/3646...
    Fingerprinting track 3250/3646...
    Fingerprinting track 3300/3646...
    Fingerprinting track 3350/3646...
    Fingerprinting track 3400/3646...
    Fingerprinting track 3450/3646...
    Fingerprinting track 3500/3646...
    Fingerprinting track 3550/3646...
    Fingerprinting track 3600/3646...
Running queries...
    Running queries for clique 50/1166
    Running queries for clique 100/1166
    Running queries for clique 150/1166
    Running queries for clique 200/1166
    Running queries for clique 250/1166
    Running queries for clique 300/1166
    Running queries for clique 350/1166
    Running queries for clique 400/1166
    Running queries for clique 450/1166
    Running queries for clique 500/1166
    Running queries for clique 550/1166
    Running queries for clique 600/1166
    Running queries for clique 650/1166
    Running queries for clique 700/1166
    Running queries for clique 750/1166
    Running queries for clique 800/1166
    Running queries for clique 850/1166
    Running queries for clique 900/1166
    Running queries for clique 950/1166
    Running queries for clique 1000/1166
    Running queries for clique 1050/1166
    Running queries for clique 1100/1166
    Running queries for clique 1150/1166
fp_results: {'mean r5': 0.13775251746235256, 'mean ap': 0.12335753431869072, 'mean p1': 0.15551289083927591}

In [ ]: