This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |