tensorflow - Keras如何预处理输入信号
问题描述
我想使用以下某些信号处理功能预处理我的 Keras 模型的输入。我希望这些成为我模型的一部分,因为我将(希望)将它们转换为 tf-lite 或 coreml。所以我不必再次在移动应用程序上重新编写这些功能。虽然我不知道应该如何以及在何处将这些添加到我的模型中,以便对输入进行预处理?
#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]
模型类似于:
model = Sequential()
model.add(Dense(12, input_dim=16000, activation='relu'))
解决方案
推荐阅读
- excel - 在不使用数组的情况下查找最大值/最小值
- ios - 快速使用数据库中的动态内容更新静态数组
- python - 如何在一个或多个变量之后命名一个对象
- c++ - 从函数返回向量给出“向量下标超出范围”错误
- validation - 聊天机器人:如何验证来自谷歌环聊的传入请求
- pandas - 将多列上的数据框连接到一列公差?
- python - 在 INPUT 语句中包含变量
- c++ - 在给定处理器缓存的情况下,Windows 中的页面写入跟踪有多可靠
- android - Android:添加 Firebase 要求时出现 build.gradle 错误
- javascript - JavaScript Axios GET 数据= null