Music classification using Tensorflow

Can we use our features to feed into TensorFlow? Of course! But let's try to use this opportunity to achieve two other goals:

  • We will make the TensforFlow classifier behave like a sklearn one to be reused in all the compatible functions.
  • Even if neural networks can extract any feature, they still need to be designed and trained to extract them. In this example, starting from the original sound file, we will show you that it is not enough to get better results than the cepstral coefficients.

But let's cut to the chase and set our hyperparameters:

import tensorflow as tfimport numpy as npn_epochs = 50learning_rate = 0.01batch_size = 128step = 32dropout_rate = 0.2signal_size = 1000signal_shape = [signal_size,1] ...

Get Building Machine Learning Systems with Python - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.