<jupyter_start><jupyter_text>Load some test files<jupyter_code>reset_tf()
X_data_values, X_filenames = load_test_batch(cfg.DATA_DIR, idx=10, batch_size=2, samples=cfg.SAMRATE)
X_data = tf.placeholder(tf.float32, [None, cfg.SAMRATE], name='X_data')
x_mfcc, x_mel, x_zcr, x_rmse = signalProcessBatch(X_data,
                                                  noise_factor=0.0,
                                                  noise_frac=0.0,
                                                  window=512,
                                                  maxamps=cfg.MAXAMPS, sr=cfg.SAMRATE,
                                                  num_mel_bins=64,
                                                  num_mfccs=20)
x_mfcc_val, x_mel_val, x_zcr_val, x_rmse_val = sess.run(
    [x_mfcc, x_mel, x_zcr, x_rmse],
    feed_dict={X_data: X_data_values})
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.pcolormesh(x_mfcc_val[0].T)
plt.subplot(122)
plt.pcolormesh(x_mfcc_val[1].T);
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.pcolormesh(x_mel_val[0].T)
plt.subplot(122)
plt.pcolormesh(x_mel_val[1].T);
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.plot(x_zcr_val[0])
plt.subplot(122)
plt.plot(x_zcr_val[1]);
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.plot(x_rmse_val[0])
plt.subplot(122)
plt.plot(x_rmse_val[1]);
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.plot(x_mfcc_val[0].T[0])
plt.subplot(122)
plt.plot(x_mfcc_val[1].T[0]);
# Deltas
paddings = tf.constant([[0, 0], [0, 1]])
zcr_delta = sess.run(tf.pad(tf_diff_axis(x_zcr_val), paddings, 'CONSTANT'))
rmse_delta = sess.run(tf.pad(tf_diff_axis(x_rmse_val), paddings, 'CONSTANT'))
print zcr_delta.shape
print x_zcr_val.shape
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.plot(zcr_delta[0])
plt.subplot(122)
plt.plot(zcr_delta[1]);
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.plot(rmse_delta[0])
plt.subplot(122)
plt.plot(rmse_delta[1]);
# Reshape to [audio file number, time size, 1]
x_zcr_val_rs = tf.reshape(x_zcr_val, [-1, 122, 1])
zcr_delta_rs = tf.reshape(zcr_delta, [-1, 122, 1])
x_rmse_val_rs = tf.reshape(x_rmse_val, [-1, 122, 1])
rmse_delta_rs = tf.reshape(rmse_delta, [-1, 122, 1])

# Stack together zcr and rmse features using tf.concat
zr_stack = tf.concat([x_zcr_val_rs, zcr_delta_rs, x_rmse_val_rs, rmse_delta_rs], 2)

# Stack with the mfccs using tf.concat
fingerprint = tf.concat([zr_stack, x_mfcc_val], 2)
# Normalize
fingerprint_norm = sess.run(tf.nn.l2_normalize(fingerprint, 1, epsilon=1e-8))
plt.figure(figsize=(12, 4))
plt.subplot(121)
plt.pcolormesh(fingerprint_norm[0].T)
plt.subplot(122)
plt.pcolormesh(fingerprint_norm[1].T);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15242754986827248, 'fraction_numerical': 0.051561911930748966, 'mean_word_length': 3.6549912434325744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '512562', 'license': 'MIT', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1106, 'n_words': 161, 'path': 'exploratory_notebooks/tf_full_test_on_audio.ipynb', 'repo_name': 'jzmnd/tf-speech-rec', 'size': '2657'}