Skip to content

Instantly share code, notes, and snippets.

@padoremu
padoremu / playground.py
Created January 23, 2020 14:33
Tensorflow and Tensorflow Lite code in the context of audio processing (MFCC, RNN)
# This file contains a collection of workarounds for missing TFLite support from:
# https://github.com/tensorflow/magenta/tree/master/magenta/music
# as posted in https://github.com/tensorflow/tensorflow/issues/27303
# Thanks a lot to github.com/rryan for his support!
# The function for testing MFCC computation given PCM input is:
# - test_mfcc_tflite
# Please not that the output has not yet been compared to the one produced by the respective TF functions.
# This file also contains test code for other problems in the context of audio processing with TF and TFLite:
@padoremu
padoremu / interleave.py
Last active January 19, 2021 13:43
interleave test
import tensorflow as tf
import time
def benchmark(dataset, num_epochs=2):
start_time = time.perf_counter()
for epoch_num in range(num_epochs):
for sample in dataset:
# Performing a training step
time.sleep(0.01)
tf.print("Execution time:", time.perf_counter() - start_time)