神经网络记忆
深度学习(DEEP LEARNING)
We always heard that Neural Networks (NNs)are inspired by biological neural networks. This huge representation was done in a fantastic way.
我们总是听到神经网络( NNs )受生物神经网络的启发。 这种巨大的表现是一种奇妙的方式。
Figure 1 shows the anatomy of a single neuron. The central part is called the cell body where the nucleus resides. There are various wires which pass the stimulus to the cell body and few wires which send the output to the other neurons. The thickness of the dendrites implies the weight/bias/power of the stimulus. Many neurons with various cell bodies are stacked up which forms the biological neural network.
图1显示了单个神经元的解剖结构。 中心部分称为细胞核所在的细胞体。 有各种各样的导线将刺激传递到细胞体,很少有导线将输出传递到其他神经元。 树突的厚度暗示了刺激的重量/偏见/力量。 具有各种细胞体的许多神经元被堆叠起来,形成了生物神经网络。

This same structure is implemented in Neural Networks. The input is passed through an activation function with weighted edges. The output is generated which can be passed to another activation function. Many activation functions can be stacked up, each of these is called a layer. And in a layer, we can have multiple neurons.
在神经网络中实现了相同的结构。 输入通过带有加权边的激活函数传递。 生成的输出可以传递给另一个激活功能。 可以堆叠许多激活功能,每个激活功能都称为一个层。 并且在一层中,我们可以有多个神经元。

These activation functions can be as simple as a sigmoid function
这些激活函数可以像S形函数一样简单
神经网络相对于传统机器学习算法的优势(Advantages of neural networks over traditional machine learning algorithms)
- Various types and sizes of data can be handled可以处理各种类型和大小的数据
- Multiple functions can be easily configured可以轻松配置多种功能
- Non-linear data can be efficiently handled非线性数据可以得到有效处理
带记忆的神经网络(Neural Networks with memory)
The main difference between the functioning of neural networks and the biological neural network is memory. While both the human brain and neural networks have the ability to read and write from the memory available, the brain can create/store the memory as well. Researchers identified that this key difference is the major roadblock for today’s AI systems to reach human-level intelligence.
神经网络和生物神经网络的功能之间的主要区别是记忆。 人脑和神经网络都具有从可用内存中进行读写的能力,而大脑也可以创建/存储内存。 研究人员发现,这一主要差异是当今AI系统达到人类水平智能的主要障碍。
Researchers at DeepMind aimed to build a differentiable computer, by putting together a neural network and linking it to external memory. The neural network would act as a CPU with a memory attached. Such differentiable computers aim to learn programs (algorithms) from input and output data.
DeepMind的研究人员旨在通过组合神经网络并将其链接到外部存储器来构建可区分的计算机。 神经网络将充当具有存储器的CPU。 这种可区分的计算机旨在从输入和输出数据中学习程序(算法)。
The neural networks are used when the amount of data is huge. For example, text data has an enormous amount of dimensions or the image data which is split into a huge number of pixels.
当数据量巨大时,将使用神经网络。 例如,文本数据具有大量尺寸,或者图像数据被拆分为大量像素。
递归神经网络 (Recurrent Neural Network)
A movie consists of a sequence of scenes. When we watch a particular scene, we don’t try to understand it in isolation, but rather in connection with previous scenes. In a similar fashion, a machine learning model has to understand the text by utilizing already-learned text, just like in a human neural network.
电影由一系列场景组成。 当我们观看一个特定的场景时,我们并不是试图孤立地理解它,而是与先前的场景联系起来。 就像在人类神经网络中一样,机器学习模型也必须通过利用已经学习的文本来理解文本。
In traditional machine learning models, we cannot store a model’s previous stages. However, Recurrent Neural Networks (commonly called RNN) can do this for us. Let’s take a closer look at RNNs below.
在传统的机器学习模型中,我们无法存储模型的先前阶段。 但是,递归神经网络(通常称为RNN)可以为我们做到这一点。 让我们仔细看看下面的RNN。

An RNN has a repeating module that takes input from the previous stage and gives its output as input to the next stage. However, in RNNs we can only retain information from the most recent stage. That’s where LSTM comes to the picture.
RNN具有一个重复模块,该模块接收来自上一级的输入,并将其输出作为输入提供给下一级。 但是,在RNN中,我们只能保留最近阶段的信息。 这就是LSTM的用武之地。
长期短期记忆网络 (Long Short Term Memory Networks)
To learn long-term dependencies, our network needs memorization power. LSTMs are a special case of RNNs which can do that. They have the same chain-like structure as RNNs, but with a different repeating module structure.
要了解长期依赖性,我们的网络需要记忆能力。 LSTM是RNN的一种特殊情况,可以做到这一点。 它们具有与RNN相同的链状结构,但具有不同的重复模块结构。

LSTM has a wide range of applications in Sequence-to-Sequence modeling tasks like Speech Recognition, Text Summarization, Video Classification, and so on.
LSTM在序列到序列建模任务中具有广泛的应用,例如语音识别,文本摘要,视频分类等。
To understand how these networks can be adopted in real-life applications in a quick glance, do check the article below.
要快速了解如何在实际应用中采用这些网络,请查看以下文章。
A spam detection model can be achieved by converting text data into vectors, creating an LSTM model, and fitting the model with the vectors.
垃圾邮件检测模型可以通过将文本数据转换为向量,创建LSTM模型并使用向量对模型进行拟合来实现。
实作 (Implementation)
To implement these complete neural networks, Keras and TensorFlow made it simple.
为了实现这些完整的神经网络,Keras和TensorFlow使其变得简单。
We are implementing a Bidirectional LSTM with the ReLU activation function.
我们正在实现具有ReLU激活功能的双向LSTM。
#Importing necessary librariesimport tensorflow as tffrom keras.layers import LSTM, Activation, Bidirectional#Addding Bi-directional LSTMmodel.add(Bidirectional(tf.keras.layers.LSTM(64)))#Relu allows converging quickly and allows backpropagationmodel.add(Dense(16, activation='relu'))model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
Creating each layer is just a single line of code.
创建每一层只是一行代码。
概要 (Summary)
In this article, we learned how neural networks are linked to biological neural networks and the working of neural networks with memory (namely, RNN, LSTM).
在本文中,我们学习了神经网络如何链接到生物神经网络以及具有记忆的神经网络(即RNN,LSTM)的工作方式。
Thanks for the read. I am going to write more beginner-friendly posts in the future too. Follow me up on Medium to be informed about them. I welcome feedback and can be reached out on Twitter ramya_vidiyala and LinkedIn RamyaVidiyala. Happy learning!
感谢您的阅读。 我将来也会写更多对初学者友好的文章。 跟我上Medium ,以了解有关它们的信息。 我欢迎您提供反馈,可以在Twitter ramya_vidiyala和LinkedIn RamyaVidiyala上与他们联系。 学习愉快!
翻译自: https://towardsdatascience.com/neural-networks-with-memory-27528a242b78
神经网络记忆
所有评论(0)