Let’s start off by demonstrating how an application of Deep Learning catches the eye:
让我们从演示深度学习应用如何吸引眼球开始:
Given the left image as a reference, an application of Deep Learning, GAN (Generative Adversarial Network) was able to imitate and produce an image similar to our reference image.
以左侧图像为参考,深度学习的应用程序GAN( 生成对抗网络 )能够模仿并产生与我们的参考图像相似的图像。
Another example is putting Robert Downey Jr and Tom Holland in the 1985 movie “Back To The Future”. Tom Holland hasn’t aged since, pun intended of course.
另一个例子是将小罗伯特·唐尼(Robert Downey)和汤姆·霍兰(Tom Holland)纳入1985年的电影《回到未来》。 汤姆·霍兰德(Tom Holland)从那以后还没有变老,当然是双关语。
演示地址
回到我们的观点,什么是深度学习? (Coming back to our point, What is Deep Learning?)
Deep learning is an artificial intelligence function that imitates the workings of the human brain in processing data and creating patterns for use in decision making. Deep learning is a subset of machine learning in artificial intelligence (AI) that has networks capable of learning unsupervised from data that is unstructured or unlabeled. Also known as deep neural learning or deep neural network.
深度学习是一种人工智能功能,它模仿人脑在处理数据和创建用于决策的模式方面的工作。 深度学习是人工智能(AI)中机器学习的一个子集,它具有能够从未结构化或未标记的数据中不受监督地学习的网络。 也称为深度神经学习或深度神经网络。
In layman terms:
用外行的话来说:
- It is considered as an evolution of Machine Learning. 它被认为是机器学习的发展。
- It uses a programmable neural network that enables machines to make accurate decisions without help from humans. 它使用可编程的神经网络,使机器无需人工帮助即可做出准确的决策。
Umm, that’s not exactly in layman terms is it.
嗯,这不完全是门外汉。
..We’ll try and break things down later in this read.
..我们将在本阅读稿的后面尝试分解内容。
为什么突然大肆宣传? (Why the sudden hype?)
Artificial neural networks have been around since 1950’s, the reason a lot of theoretical concepts haven’t been into practice is the lack of computational power at that time, as well as the availability of data.
人工神经网络自1950年代开始出现,当时许多理论概念尚未付诸实践的原因是当时缺乏计算能力以及数据的可用性。
Looking back at the past 5 years, with the current digitized age, we see how huge datasets are available online and with the technological advancements in hardware, we now have the computational power to not only create Deep Learning Models but to improve and advance our researches.
回顾过去的5年,在当前的数字化时代,我们看到了如何在线获取巨大的数据集以及硬件技术的进步,我们现在不仅拥有创建深度学习模型的计算能力,而且还可以改善和推进我们的研究。
但是..我们什么时候应该使用深度学习而不是机器学习? (But.. When should we use Deep Learning instead of Machine Learning?)
Deep Learning out performs other techniques if the data size is large. But with small data size, traditional Machine Learning algorithms are preferable.
如果数据量很大,则深度学习可以执行其他技术。 但是,由于数据量较小,传统的机器学习算法更为可取。
Deep Learning techniques need to have high end infrastructure to train in reasonable time.
深度学习技术需要具有高端基础架构才能在合理的时间内进行培训 。
When there is lack of domain understanding for feature introspection, Deep Learning techniques outshines others as you have to worry less about feature engineering.
当缺乏对功能自省的领域了解时,深度学习技术会比其他技术出色,因为您不必担心 功能工程 。
- Deep Learning really shines when it comes to complex problems such as image classification, natural language processing, and speech recognition. 在涉及图像分类,自然语言处理和语音识别等复杂问题时,深度学习确实令人眼前一亮。
我们一直在听神经网络一词。但是什么是神经网络呢? (We keep hearing the term Neural Network.. But What Exactly Is A Neural Network?)
In simple words, a neural network is a computer simulation of the way biological neurons work within a human brain. The amazing thing about a neural network is that you don’t have to program it to learn it learns all by itself, just like a human brain!
简而言之, 神经网络是对生物神经元在人脑内工作方式的计算机模拟。 神经网络的神奇之处在于,您无需对其进行编程即可学习它像人的大脑一样自行学习!
好吧..但是主要成分是什么? (Okay.. But what are it’s main components?)
- The first building block of a neural network is, well, neurons. A neuron is like a function, it takes a few inputs and returns an output and their general goal is to perform a given task achieving the least possible error. 神经网络的第一个基础是神经元。 神经元就像一个函数,它需要几个输入并返回一个输出,它们的总体目标是执行给定的任务,以尽可能减少错误。
- Neural networks are typically organized in layers. Layers are made up of a number of interconnected ‘nodes’ (connection points). 神经网络通常是分层组织的。 层由多个相互连接的“节点”(连接点)组成。
A basic neural network consists of 3 layers:
基本的神经网络包括3层:
Input Layer: This layer accepts input in the form of an array of numbers.
输入层 :此层接受数字数组形式的输入。
Hidden Layers: Hidden layers are intermediary processing units. They are added just to increase the accuracy of the predictions.
隐藏层 :隐藏层是中间处理单元。 添加它们只是为了提高预测的准确性。
Output Layer: Results of the hidden layer are then fed to the output layer, which produces the final prediction.
输出层 :将隐藏层的结果输入到输出层,生成最终预测。
深入研究:让我们了解它与一个示例一起工作 (Digging Deeper: Let’s understand it’s working with an example)
- There is a student whose name is Perceptron, He wants to predict his test score, based on how many hours he sleeps and how many hours he studies the night before the exam. 有一个叫Perceptron的学生,他想根据他睡了多少个小时以及考试前一天晚上学习了多少个小时来预测自己的考试成绩。
Perceptron’s friend Dave has some student’s information (like how many hours they sleep and how many hours they study the night before the exam and their test score). Perceptron asks his friend to give that information. with the help of this information, he wants to predict the score and give that score to Dave. Dave will tell Perceptron how near his prediction is. This is feed-forward.
Perceptron的朋友Dave掌握了一些学生的信息(例如,他们睡了几个小时,在考试前一天晚上学习了几个小时,以及他们的考试成绩)。 Perceptron要求他的朋友提供该信息。 在这些信息的帮助下,他希望预测分数并将该分数提供给Dave。 Dave会告诉Perceptron他的预测有多近。 这是前馈。
- So he started making a mathematical formula for calculating test score using Dave’s dataset. He takes first data .i.e. 5 hours of study and 3 hours of sleep. With this data he got to know that some students scored 75 marks in the exam, so somehow he wants to convert this 5 hours and 3 hours to 75 marks, so he comes up with this solution that what if he multiply sleep hours and study hours with such a number so that he can get his test score. 因此,他开始使用Dave的数据集制作用于计算考试成绩的数学公式。 他需要第一个数据,即5个小时的学习时间和3个小时的睡眠时间。 有了这些数据,他知道有些学生在考试中获得了75分,因此他想以某种方式将这5小时和3小时转换为75分,因此他想出了一种解决方案,如果他将睡眠时间和学习时间相乘会怎样?用这样的数字,以便他可以得到他的测试成绩。
Hour * W1 + Sleep* W2
小时* W1 +睡眠* W2
But there is one problem, Which number? So he started multiplying 5 and 3 with some random number. This is called weight.
但是有一个问题,哪个数字? 因此,他开始将5和3与某个随机数相乘。 这称为重量 。
- So first he put w1=7 and w2=3 randomly 所以首先他随机把w1 = 7和w2 = 3
5*7 + 3 * 3 = 44
5 * 7 + 3 * 3 = 44
He got output 44, Dave told him that it is lower than the target result so he knows he needs to increase the value of w1 and w2. Now If the end result is bad, he has gone back through the whole process trying to correct it, This process is called back-propagation.
他得到了输出44,Dave告诉他输出低于目标结果,因此他知道他需要增加w1和w2的值。 现在,如果最终结果不好,则他将尝试校正整个过程,并回过头进行。此过程称为反向传播。
We can back-propagate the error through the network and adjust the weights to minimize the error. This error is calculated with the help of a cost function and his friend Dave is Cost Function because he tells him every time how wrong his prediction is.
我们可以通过网络反向传播错误,并调整权重以使错误最小化。 该误差是在成本函数的帮助下计算的,他的朋友戴夫是成本函数,因为他每次都会告诉他预测的错误。
5*10 + 3 * 10 = 80
5 * 10 + 3 * 10 = 80
- this time he got 80 …again he changes the value of w1 and w2 这次他得到80…再次,他改变了w1和w2的值
5*9 + 3 * 10 = 75
5 * 9 + 3 * 10 = 75
- This time he got perfect output …now he knows that if he multiplies his number of study hours with 9 and number of sleep hours with 10 he will get his test score. 这次,他得到了完美的输出……现在,他知道,如果他将学习时间乘以9,将睡眠时间乘以10,他将获得考试成绩。
But suddenly he remembers, he got 5 marks because of cheating so he can’t count that 5 marks from his number of hours of study he has to add that value separately this is called Bias.
但是突然他想起了,他因作弊而获得了5分,所以他无法从学习时间中算出这5分,他不得不单独添加该值 这就是所谓的偏见 。
Note that, Bias is a constant value which we add to prevent overfitting.
请注意, 偏置是一个恒定值,我们添加了该值以防止过拟合 。
- Now again he creates that equation again and with few with adjustment: 现在,他再次创建该方程式,几乎没有经过调整:
5*8+3*10+5 = 75
5 * 8 + 3 * 10 + 5 = 75
Finally, he got the correct result!
终于,他得到了正确的结果!
某些类型的神经网络架构 (Some types of Neural Network Architectures)
Perceptron
感知器
The above example demonstrates the working of Perceptron, how the weight, bias and an activation function work to produce an output.
上面的示例演示了Perceptron的工作原理, 权重 , 偏差和激活函数如何产生输出。
Convolutional Neural Network
卷积神经网络
- Mostly used for extracting information from Images and videos. 主要用于从图像和视频中提取信息。
- CNN learns the filters automatically without mentioning it explicitly. These filters help in extracting the right and relevant features from the input data. CNN会自动学习过滤器,而无需明确提及。 这些过滤器有助于从输入数据中提取正确的相关特征。
Convolution Layer : Convert Image into a matrix, gets multiplied to a feature detector array, revealing a “feature map”.
卷积层:将图像转换为矩阵,然后乘以特征检测器阵列,以显示“特征图”。
- This feature map is a matrix that contain only the significant features of an image. There area many feature maps that make up a convolutional layer. 该特征图是仅包含图像重要特征的矩阵。 那里有许多构成卷积层的特征图。
Then an activation function “Rectified Linear Unit” is applied which removes the negative values which helps in computation.
然后应用激活函数“ 整流线性单位 ”,该函数消除了有助于计算的负值。
Pooling Layer : Used to distinguish the features even when the image is tilted, the subject changes its initial position.
汇聚层 :即使图像倾斜,被摄对象也会改变其初始位置,以区分特征。
- Pooling usually gets rid of 75% insignificant information, reducing the size and preventing overfitting. 合并通常会消除75%的无关紧要的信息,从而减小了大小并防止了过度拟合。
Flattening Layer : Pooled feature map gets converted from the matrix to an array for input for the neural network.
展平层 :合并的特征图从矩阵转换为数组,以供神经网络输入。
Detailed working and understanding on Convolutional Neural Network can be found at:
有关卷积神经网络的详细工作和理解,请访问:
Recurrent Neural Network
递归神经网络
- Recurrent Neural Network has a recurrent connection on the hidden state. This looping constraint ensures that sequential information is captured in the input data. 循环神经网络在隐藏状态上具有循环连接。 此循环约束确保在输入数据中捕获顺序信息。
- RNN captures the sequential information present in the input data i.e. dependency between the words in the text while making predictions. RNN捕获输入数据中存在的顺序信息,即在进行预测时文本中单词之间的相关性。
- As you can see here, the output (o1, o2, o3, o4) at each time step depends not only on the current word but also on the previous words. 如您所见,每个时间步长的输出(o1,o2,o3,o4)不仅取决于当前单词,还取决于先前单词。
- Mostly used in Natural Language Processing applications, since the word produced not only depends on the previous one but instead depends on each word of the sentence. 由于产生的单词不仅取决于前一个单词,还取决于句子中的每个单词,因此通常用于自然语言处理应用程序。
For a more in-depth Understanding on RNN and LSTM, Check this article:
有关RNN和LSTM的更深入了解,请查看以下文章:
Generative Adversarial Network
生成对抗网络
A generative adversarial network (GAN) has two parts:
生成对抗网络(GAN)有两个部分:
The generator learns to generate plausible data. The generated instances become negative training examples for the discriminator.
生成器学习生成合理的数据。 生成的实例成为鉴别器的否定训练实例。
The discriminator learns to distinguish the generator’s fake data from real data. The discriminator penalizes the generator for producing implausible results.
鉴别者学会将生成者的假数据与真实数据区分开。 判别器会因产生令人难以置信的结果而惩罚生成器。
When training begins, the generator produces obviously fake data, and the discriminator quickly learns to tell that it’s fake:
训练开始时,生成器会产生明显的伪造数据,鉴别器很快就会学会辨别它是伪造的:
As training progresses, the generator gets closer to producing output that can fool the discriminator:
随着训练的进行,生成器越来越接近产生可欺骗鉴别器的输出:
Finally, if generator training goes well, the discriminator gets worse at telling the difference between real and fake. It starts to classify fake data as real, and its accuracy decreases.
最后,如果生成器训练顺利进行,则辨别器在分辨真假之间的区别时会变得更糟。 它开始将假数据分类为真实数据,其准确性降低。
If we look at the entire Architecture, it would be something like this:
如果我们看整个体系结构,将是这样的:
Both the generator and the discriminator are neural networks. The generator output is connected directly to the discriminator input. Through back-propagation, the discriminator’s classification provides a signal that the generator uses to update its weights.
生成器和鉴别器都是神经网络。 发生器输出直接连接到鉴别器输入。 通过反向传播,鉴别器的分类提供了信号,供生成器用来更新其权重。
To understand GAN in depth, there’s a whole series of articles on its Working
要深入了解GAN,有一系列有关其工作的文章
摘要 (Summary)
This article revisits the basics of Deep Learning, how the neural network works and what are some of its most used Architectures.
本文回顾了深度学习的基础知识,神经网络的工作原理以及最常用的一些架构。
Hope it was a fine read.
希望这是一本好书。
翻译自: https://medium.com/@dawoodzaidi/given-the-introduction-of-gpt-3-lets-revisit-the-basics-of-deep-learning-22c751221673