机器学习是什么时候开始火的

Editor’s Note: Diving into machine learning and AI from scratch can feel daunting, especially for people without a strong background in math. That’s where Laurence Moroney comes in. Laurence is a developer advocate at Google working on artificial intelligence with TensorFlow; he is also an experienced instructor, so dedicated to taking coders from zero to hero in AI that he’s writing a book on it. In the following piece Laurence Moroney considers how ML evolved from traditional programming, with an easy-to-follow, illustrated introduction.

Ëditor注:潜入机器学习和人工智能从头开始能感觉到望而生畏,特别是对人没有在数学强大的背景。 这就是Laurence Moroney进来的地方。Laurence是Google的开发倡导者,与TensorFlow一起致力于人工智能。 他还是一位经验丰富的讲师,致力于将编码人员从零变成AI的英雄,因此他正在写一本书 在下一篇文章中,Laurence Moroney通过简单易懂的插图介绍了ML如何从传统编程中演变而来。

Before looking at the ins and outs of ML, let’s just consider how it evolved from traditional programming. We’ll start by capturing the concept of what traditional programming is, then consider cases where it is limited, and show how ML evolved to handle those cases, and as a result has opened up new opportunities to implement new scenarios, unlocking many of the concepts of artificial intelligence.

在研究ML的来龙去脉之前,我们只需考虑一下它是如何从传统编程中演变而来的。 我们将首先了解传统编程的概念,然后考虑其局限性的情况,并展示ML如何发展来处理这些情况,结果为实现新的情况提供了新的机会,从而解锁了许多人工智能的概念。

Traditional programming involves us writing rules, expressed in a programming language, that act on data, and give us answers. This applies just about everywhere something can be programmed with code.

传统编程需要我们编写以编程语言表达的规则,这些规则作用于数据并给出答案。 这几乎适用于任何可以用代码编程的地方。

For example, consider a game, like the popular ‘breakout’ one. Code determines the movement of the ball, the score, and the various conditions for winning or losing the game. Think about the scenario when the ball bounces off a brick, like in Figure 1.

例如,考虑一种游戏,例如流行的“突破”游戏。 代码确定球的运动,得分和赢得或输掉比赛的各种条件。 想一想当球从砖块反弹时的情形,如图1所示。

Image for post

Figure 1–1. Code in a Breakout Game

图1-1 突破游戏中的代码

Here, the motion of the ball can be determined by its dx and dy properties. When it hits the brick, the brick is removed, and the velocity of the ball will increase as well as changing direction. Your code acts on data about the game situation.

在此,球的运动可由其dx和dy属性确定。 当它撞击砖块时,砖块将被移走,球的速度将增加并且方向也会改变。 您的代码作用于有关游戏情况的数据。

Or, also consider, perhaps in a Financial Services scenario. You have data about a company’s stock, such as its current price, and its current earnings. You’ll calculate a valuable ratio called a P/E (for Price divided by Earnings) with a scenario like Figure 2.

或者,也可以考虑在金融服务方案中。 您具有有关公司股票的数据,例如其当前价格和当前收益。 您将使用图2所示的情况计算一个有价值的比率,称为P / E(价格除以收益)。

Image for post

Figure 1–2. Code in a Financial Services scenario.

图1-2。 金融服务场景中的代码。

Here your code might read the price, read the earnings and return a value that is the former divided by the latter.

在这里,您的代码可能会读取价格,读取收益并返回一个值,该值是前者除以后者。

If I were to try to sum up traditional programming like this into a single diagram, it might look like Figure 3.

如果我试图将这样的传统编程总结为一个图表,则可能如图3所示。

Image for post

Figure 1–3. High Level Concept of Traditional Programming

图1-3。 传统编程的高级概念

As you can see you have rules, expressed in a programming language. These rules act on data, and the result is answers.

如您所见,您有用编程语言表达的规则。 这些规则作用于数据,结果就是答案。

传统编程的局限性 (Limitations of Traditional Programming)

The model from Figure 3 has been the backbone of development since its inception. But it has an inherent limitation — namely that only scenarios for which a programmer can derive the rules can be implemented. What about other scenarios? Usually they are infeasible to develop because the code is too complex. It’s just not possible to write code to handle it.

自创建以来,图3中的模型一直是开发的Struts。 但是它有一个固有的局限性,即只能实现程序员可以为其导出规则的方案。 那其他情况呢? 通常,由于代码太复杂而无法开发它们。 只是不可能编写代码来处理它。

Consider, for example activity detection. Fitness monitors that can detect our activity are a recent innovation, not just because of the availability of cheap and small hardware, but also because the algorithms to handle detection weren’t previously feasible. Let’s explore why.

考虑例如活动检测。 可以检测到我们的活动的健身监测器是最近的一项创新,这不仅是因为廉价和小型硬件的可用性,而且还因为处理检测的算法以前不可行。 让我们探究原因。

Figure 4 shows a naive activity detection algorithm for walking. It can consider her speed. If it’s less than a particular value, we can determine that she’s probably walking.

图4显示了用于步行的幼稚活动检测算法。 它可以考虑她的速度。 如果小于特定值,我们可以确定她可能正在行走。

Image for post

Figure 1–4. Algorithm for activity detection.

图1-4。 活动检测算法。

Given that our data is speed, we could now extend this to detect if she is running like in Figure 5.

鉴于我们的数据是速度,我们现在可以扩展它以检测她是否正在运行,如图5所示。

Image for post

Figure 1–5. Extending the algorithm for running

图1-5。 扩展运行算法

As we can see, going by the speed, we might say if it is less than a particular value (say 4 mph) she is walking, otherwise she is running. It still sort of works.

正如我们所看到的,按照速度前进,我们可以说它是否小于她正在行走的特定值(例如4 mph),否则她正在跑步。 它仍然可以工作。

And again, we now want to extend this because Cycling is a popular fitness activity. The algorithm could look like Figure 6.

再次,我们现在想扩展这一点,因为骑自行车是一种流行的健身活动。 该算法可能类似于图6。

Image for post

Figure 1–6. Extending the algorithm for Biking.

图1-6。 扩展自行车的算法。

It still sort of works. I know it’s naive by just detecting speed — some people run faster than others, and you might run downhill faster than you cycle uphill, for example. But it still sort of works. However, what happens when you want to implement another scenario — for example golfing? See Figure 7.

它仍然可以工作。 我知道仅检测速度是天真的事,例如,有些人跑得比其他人快,而下坡跑的速度可能比上坡骑车的速度快。 但是它仍然可以工作。 但是,当您想实现另一个场景(例如打高尔夫球)时会发生什么? 参见图7。

Image for post

Figure 1–7. How do we write a golfing algorithm

图1–7。 我们如何编写高尔夫算法

We’re now stuck. How do we determine that someone is golfing using this methodology? She might walk for a bit, stop, do some activity, walk for a bit more, stop etc. But how can we tell this is golf.

我们现在陷入困境。 我们如何使用这种方法确定某人正在打高尔夫球? 她可能会走路,停下脚步,做一些运动,再走路多一点,停下脚步。但是我们怎么能说这是高尔夫。

Our ability to detect this activity using traditional rules has hit a wall. But maybe there’s a better way.

我们使用传统规则检测此活动的能力已陷入困境。 但是也许有更好的方法。

Enter Machine learning.

输入机器学习。

从编程到学习 (From Programming to Learning)

Let’s look back at the diagram that we used to demonstrate what traditional programming is. You can see it in Figure 8. Here you have rules that act on data and give you answers. In our activity detection scenario, the data was the speed that our friend was going at, and from that we could write rules to detect her activity, be it walking, biking or running. We hit a wall when it came to golfing, because we couldn’t come up with rules to determine what that activity looks like.

让我们回顾一下用来说明传统编程是什么的图。 您可以在图8中看到它。这里有作用于数据并提供答案的规则。 在我们的活动检测场景中,数据就是我们朋友前进的速度,然后我们可以编写规则来检测她的活动,无论是步行,骑自行车还是跑步。 在打高尔夫球时,我们碰壁了,因为我们无法提出规则来确定这项运动的样子。

Image for post

Figure 1–8. The diagram of traditional programming.

图1–8。 传统编程图。

But what would happen if we flip the axes around on this diagram. So, instead of us coming up with the rules, what if we come up with the answers, and along with the data have a way of figuring out what the rules might be.

但是,如果我们在该图上翻转轴会发生什么。 因此,代替我们提出规则,如果我们提出答案,并且与数据一道,就可以弄清楚规则可能是什么。

In other words, let’s change the diagram of traditional programming to something new. See Figure 9. We can consider this the high level diagram to define Machine Learning.

换句话说,让我们将传统编程的图表更改为新的东西。 参见图9。我们可以认为这是定义机器学习的高级图。

Image for post

Figure 1–9. Changing the Axes to get Machine Learning.

图1–9。 更改轴以进行机器学习。

So what are the implications of this? Well — now, instead of us trying to figure out what the rules are, we get lots of data about our scenario, we label that data, and the computer can figure out what the rules are that make one piece of data match a particular label, and another piece of data match its label.

那么这意味着什么呢? 好吧,现在,我们不再试图弄清楚规则是什么,而是获得了有关场景的大量数据,我们对数据进行了标记,计算机可以找出使一个数据与特定标签匹配的规则是什么。 ,并且另一条数据与其标签匹配。

How would this work for our activity detection scenario? Well, now we can look at all the sensors that give us details about this person. If she has a wearable it could information such as heart rate, location, speed, etc. And if we collect a lot of instances of this data while she’s doing activities, we end up with a scenario of having data that says ‘this is what walking looks like’, ‘this is what running looks like’ etc. See Figure 10.

这对于我们的活动检测方案将如何工作? 好吧,现在我们可以看看所有提供有关此人详细信息的传感器。 如果她有可穿戴设备,则可以获取诸如心率,位置,速度等信息。并且,如果我们在她进行活动时收集了很多此类数据实例,那么最终会出现一个数据情景,说明“这就是看起来像“走路”,“这就是跑步的样子”等。见图10。

Image for post

Figure 1–10. From coding to ML. Gathering and Labelling data.

图1-10。 从编码到ML。 收集和标记数据。

Now, your job as a programmer changes from figuring out the rules to determine the activities to writing the code that matches the data to the label. If you could do this, then you can expand the scenarios that you can implement with code. Machine Learning is a technique that can do this, but in order to code these, you’ll need a framework. And that’s where TensorFlow enters the picture. Let’s first take a look at what it is, and how to install it, and then later in this chapter you’ll write your first code that learns the pattern between two values like the scenario above. It’s a simple ‘hello world’ type scenario, but it has the foundational code pattern that’s used in extremely complex ones.

现在,您作为程序员的工作从确定规则以确定活动开始,变为编写将数据与标签匹配的代码。 如果可以这样做,则可以扩展可以用代码实现的方案。 机器学习是一种可以做到这一点的技术,但是为了对它们进行编码,您需要一个框架。 这就是TensorFlow输入图片的地方。 首先,让我们看一下它的含义以及如何安装它,然后在本章后面,您将编写第一个代码,该代码学习两个值之间的模式,如上面的场景。 这是一个简单的“ hello world”类型的场景,但是它具有在极其复杂的场景中使用的基本代码模式。

学习更快。 深入挖掘。 看得更远。 (Learn faster. Dig deeper. See farther.)

Join the O’Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

加入O'Reilly在线学习平台。 立即获得免费试用版,即时找到答案,或者掌握一些新的有用的知识。

Learn more

学到更多

Laurence Moroney leads AI Advocacy at Google. His goal is to educate the world of software developers in how to build AI systems with machine learning. He’s a frequent contributor to the TensorFlow YouTube channel at youtube.com/tensorflow, a recognized global keynote speaker and author of more books than he can count, including several best-selling science fiction novels, and a produced screenplay. He’s based in Sammamish, Washington where he drinks way too much coffee.

Laurence Moroney领导Google的AI倡导工作。 他的目标是教育软件开发人员如何使用机器学习构建AI系统。 他经常在youtube.com/tensorflow上为TensorFlow YouTube频道做出贡献,他是公认的全球主旨演讲者,并撰写了数不胜数的书籍,其中包括几本最畅销的科幻小说和一部剧本。 他住在华盛顿州的萨马米什,在那里他喝太多的咖啡。

翻译自: https://medium.com/oreillymedia/machine-learning-101-what-it-is-and-how-to-get-started-fd1b8828c8b9

机器学习是什么时候开始火的

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐