After completing the assignment on trigger word detection in Andrew ng s course. I made some training examples and tried the same model but eventhough the accuracy is .88(which is not great considering the skewness of the data) the model is doing terribly while predicting. Background audio is giving a probability of 0.44 and any other voice is giving less than that.
shape(trainx)=(100,5511,101)
shape(trainy)=(100,1375,1)
Model:
def model(input_shape):
X_input = Input(shape = input_shape)
X = Conv1D(filters=196,kernel_size=15,strides=4)(X_input)
X = BatchNormalization()(X)
X = Activation("relu")(X)
X = Dropout(rate=0.8)(X)
if tf.test.is_gpu_available():
X=tf.keras.layers.CuDNNGRU(units=128, return_sequences=True)(X)
else:
X=GRU(units=128,return_sequences=True)(X)
X = Dropout(rate=0.8)(X)
X = BatchNormalization()(X)
if tf.test.is_gpu_available():
X=tf.keras.layers.CuDNNGRU(units=128, return_sequences=True)(X)
else:
X=GRU(units=128,return_sequences=True)(X)
X = Dropout(rate=0.8)(X) # dropout (use 0.8)
X = BatchNormalization()(X)
X = Dropout(rate=0.8)(X)
X =TimeDistributed(Dense(1, activation = "sigmoid"))(X)
model = Model(inputs = X_input, outputs = X)
return model
Did the training by
history=model.fit(trainx,trainy, validation_split=0.30, epochs=500, batch_size=5,callbacks=
[cp_callback])
I have checked the training labels which does not seem to have any mistakes. While training my validation accuracy increases very fastly than training accuracy which is also confusing. Anybody, please explain what is happening so wrong about this. Thanks in advance :)