信号处理深度学习机器学习
机器学习性能与两种关键信号处理算法(快速傅里叶变换和最小均方预测)的有趣对比。 (A fun comparison of machine learning performance with two key signal processing algorithms — the Fast Fourier Transform and the Least Mean Squares prediction.)
Signal processing has given us a bag of tools that have been refined and put to very good use in the last fifty years. There is autocorrelation, convolution, Fourier and wavelet transforms, adaptive filtering via Least Mean Squares (LMS) or Recursive Least Squares (RLS), linear estimators, compressed sensing and gradient descent, to mention a few. Different tools are used to solve different problems, and sometimes, we use a combination of these tools to build a system to process signals.
信号处理为我们提供了一整套工具,这些工具在过去的五十年中已经完善并得到了很好的使用。 有自相关,卷积,傅立叶和小波变换,通过最小均方(LMS)或递归最小二乘(RLS)进行自适应滤波,线性估计器,压缩感测和梯度下降等。 使用不同的工具来解决不同的问题,有时,我们结合使用这些工具来构建用于处理信号的系统。
Machine Learning, or the deep neural networks, is much simpler to get used to because the underlying mathematics is fairly straightforward regardless of what network architecture we use. The complexity and the mystery of neural networks lie in the amount of data they process to get the fascinating results we currently have.
机器学习(即深度神经网络)要习惯得多,因为无论我们使用哪种网络架构,基础数学都非常简单明了。 神经网络的复杂性和奥秘在于它们处理的数据量,以获得我们目前拥有的迷人结果。
时间序列预测 (Time Series Prediction)
This article is an effort to compare the performance of a neural network for a few key signal processing algorithms. Let us look at time series prediction as the first example. We will implement a three layer sequential deep neural network to predict the next sample of a signal. We will also do it the traditional way by using a tap delay filter and adapting the weights based on the mean square error — this is the LMS filtering, an iterative approach to the optimal Weiner filter for estimating signal from noisy measurement. We will then compare the prediction error between the two methods. So, let us get started with writing the code!
本文旨在比较几种关键信号处理算法的神经网络性能。 让我们将时间序列预测作为第一个示例。 我们将实现一个三层顺序的深度神经网络,以预测信号的下一个样本。 我们还将通过使用抽头延迟滤波器并根据均方误差调整权重来实现传统方法-这是LMS滤波 ,这是一种针对最优Weiner滤波器的迭代方法,用于从噪声测量中估计信号。 然后,我们将比较两种方法之间的预测误差。 因此,让我们开始编写代码!
Let us first import all the usual python libraries we need. Since we are going to be using the TensorFlow and Keras framework, we will import them too.
让我们首先导入我们需要的所有常用python库。 由于我们将使用TensorFlow和Keras框架,因此我们也将其导入。
神经网络预测 (Prediction with Neural Networks)
Let us start building our 3 layer Neural network now. The input layer takes 64 samples and produces 32 samples. The hidden layer maps these 32 outputs from the first layer to 8 samples. The final layer maps these 8 samples in to 1 predicted output. Remember that the input size is provided with the input_shape parameter in the first layer.
现在让我们开始构建3层神经网络。 输入层获取64个样本,并产生32个样本。 隐藏层将这32个输出从第一层映射到8个样本。 最后一层将这8个样本映射为1个预测输出。 请记住,输入大小随第一层的input_shape参数提供。
We will use the Adam optimizer without bothering about what it is. That is the benefit of TensorFlow, we don’t need to know every detail about all the processing required for neural network to build one using this amazing framework. If we find out that the Adam optimizer doesn’t work as well, we will simply try another optimizer — RMSprop for example.
我们将使用Adam优化器而不用担心它是什么。 这就是TensorFlow的好处,我们不需要了解神经网络使用此惊人框架构建一个神经网络所需的所有处理的每个细节。 如果发现Adam优化器不能正常工作,我们将简单地尝试