Hi all,
I think there is a possible data leakage in quantum data tutorial in
|
"S_pqk, V_pqk = get_spectrum(\n", |
|
" tf.reshape(tf.concat([x_train_pqk, x_test_pqk], 0), [-1, len(qubits) * 3]))\n", |
|
"\n", |
|
"S_original, V_original = get_spectrum(\n", |
|
" tf.cast(tf.concat([x_train, x_test], 0), tf.float32), gamma=0.005)\n", |
|
"\n", |
|
"print('Eigenvectors of pqk kernel matrix:', V_pqk)\n", |
|
"print('Eigenvectors of original kernel matrix:', V_original)" |
when calculating
|
" S, V = tf.linalg.eigh(KC_qs)\n", |
train and test data are concatenated in these calculations. I think it is wrong, and those should be separately calculated for each.