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] ...