问题
I want to preprocess the input of my Keras model with certain signal processing functions as below. I want these to be part of my model because I will (hopefully) convert these to tf-lite or coreml. So I dont have to re-write these functionality on mobile app again. Although I couldn't figure out how and where I should add these to my model so inputs are preprocessed?
#method to preprocess the model input, when called
def getMfcss();
stfts = tf.contrib.signal.stft(signals, frame_length=frame_length, frame_step=frame_step, fft_length=fft_length)
....
mfccs = tf.contrib.signal.mfccs_from_log_mel_spectrograms(log_mel_spectrograms)[..., :num_mfccs]
And Model goes something like :
model = Sequential()
model.add(Dense(12, input_dim=16000, activation='relu'))
来源:https://stackoverflow.com/questions/54658336/keras-how-to-preprocess-input-signal