ADM-201 dump PMP dumps pdf SSCP exam materials CBAP exam sample questions

《了解深度学习》#1 怎样预测 – 译学馆
未登陆,请登陆后再发表信息
最新评论 (0)
播放视频

《了解深度学习》#1 怎样预测

How to Make a Prediction - Intro to Deep Learning #1

大家好 我是西拉杰
Hello world, it’s Siraj,
欢迎收看深度学习的介绍
and welcome to Intro to Deep Learning.
作为第一课
In this first episode,
我们将在只知道动物脑重量的条件下
we’ll predict an animal’s body weight
预测该动物的体重
given only the weight of its brain.
本门课将持续四个月
This course will be four months long
所有的内容都会在我的频道发布
and it’ll all be released on my channel.
太平洋时间每周三上午10点我会现场直播
I’ll have a live session every Wednesday at 10 AM PST
深度解析每周的话题
that explains every weeks’s topic in depth.
我会和Udacity合作
And I’m collaborating with UDACITY
成功完成本课程 我们将提供微学位
to offer a nano-degree to those that successfully complete this course.
本课程针对想学习如何驾驭
This course is for anyone who wants to learn
神经网络惊人能量的所有人
how to harness the incredible power of neural networks
从而成为深度学习工程师
and become a deep learning engineer.
你不用非得是一位有经验的开发者或者数学家
You don’t have to be an experienced developer or mathematician.
本课程需要的唯一先决条件
The only prerequisite for this course
是了解量子力学
is knowing quantum mechanics.
开玩笑啦 只是基础的Python语法
Just kidding, only basic Python syntax.
我们将学习如何打造无所不能的AI
We’ll learn what we need to along the way by building an AI
来预测特斯拉股票价格
that can do everything from predicting the price of Tesla stock
以及绘制超现实的画作
to painting surrealist masterpieces.
传统意义上 编程一直是
Traditionally, programming has been about
通过定义程序的每一步 来决定输出
defining every single step for a program to reach an outcome.
机器也只接受这种方式
The machine only flips that approach.
有了机器学习后
With machine learning,
我们定义输出
we define the outcome
然后程序会学习如何完成任务
and the program learns the steps to get there.
因此 如果我想创建一个
So, if I want to build an app
能够识别加州车牌的应用
that can recognise California license plates,
我们不用写一个能够识别
instead of writing out code to recognise
车牌号无数种特征比如
the hundreds of different features of a license plate
字母形状和颜色的代码
like the shape of certain letters and the colours.
而只需要对机器说
We just say,
这里是加州车牌的一些例子
here are some examples of a California license plate,
你去学会理解它们的步骤 直到认出它们
learn the steps you need, so that you can recognise it.
或者如果我想做一个机器人能通关超级马里奥
Or if I wanted to make a bot that could beat Super Mario,
我不用为每一个游戏场景编写代码
instead of writing code for every possible scenario
比如看见朝你跑来的库巴
like jumping if you see a kuba
你就跳
and it’s running towards you.
我们会说 目标是活着到达终点
We’d say, the goal is to get to the end point without dying,
去学会能完成任务的方法吧
learn the steps to get there.
甚至有时我们都不知道
And sometimes, we don’t even have an idea
怎样的步骤能做到
what steps could possibly be.
比如我们是一家银行
Like if we’re a bank
我们怀疑有某种诈骗活动发生
and we suspect there’s some kind of fraudulent activity happening,
但是我们不确定怎样精准探查
but we’re not sure exactly how to detect that
甚至不知道要查什么
or even know what to look for,
我们可以说
we can say,
这里有一份所有用户活动的日志
here’s a log of all user activity.
找到那个与众不同的用户
Find the users that are unlike the rest
它就能自己按步骤学习去探测异常
and it will learn the steps to detect the anomalies by itself.
机器学习在网上已经广为流传
Machine learning is already everywhere on the internet.
大平台们都在某种程度的应用它
Every major service uses it in some way.
事实上 YouTube现在已经在用它
In fact, YouTube is using it right now
通过你看的视频判定
to decide which other videos you might like
你可能喜欢的其他视频
as you watch this.
而且它的使用会越来越普及
And its uses will only grow over time
它会被嵌入在我们所有的联网设备里
It’ll be embedded in all of our internet connected devices.
从冰箱到汽车
Everything from fridges to cars,
到个人语音助手
to personal assistance,
通过重复学习来适应我们的需求
re-learning and adapting to our needs.
你知道掌握一项技能需要一万小时的说法吗?
And you know that rule that says you need ten thousand hours to master any skill?
现在不需要那么长时间啦 把任务交给机器
Well, we’ll just be able to off load that training time to our machines
它会立刻赋予我们超能力
and it’ll give us super powers instantly.
任何人都将能作曲
Anyone will be able to compose a symphony.
Hi Alexa 我感到有点忧郁
Hah, Alexia, I feel melancholic,
给我写一首应景的钢琴曲吧
make me a piano piece for this.
再加点节拍 哟
And add a beat to it. Yo!
任何人都将能导演电影
Anyone will be able to direct the movie.
OK Google 重新创作星际大战 把我加进去
Okay, Hugo, recreate Star Wars but put me in it.
现在我把我的大部分数据转移进去
I dockerize most of my code now.
你让我心碎
You’re breaking my heart.
对极了
Damn right.
随着机器学习的进步 只有你想不到
With machine learning, if you can dream it,
没有它做不到
it can exist.
随着研究人员的成果可以互相促进
And the field is currently advancing very fast,
该领域正以极快的速度进步
as researchers build on each other’s work.
啊哈 我糟糕的神经网络
Ugh, my NeuroNet sucks.
继续更深度的学习
Go deeper!
哇哦 我刚刚达到了最新水平
Wow, I just achieved state of the art.
机器学习模型有很多种
There’re a lot of machine learning models out there.
其中之一叫神经网络
And one of them is called a Neural Network.
当我们使用神经网络时 如果使用不止一两层
When we use a neural network that’s not just one or two,
而是很多层 去深度预测
but many layers deep to make a prediction,
我们称之为深度学习
we call that Deep Learning.
深度学习是机器学习的子集
It’s a subset of machine learning
在做大量的任务测试时
that has outperformed almost every other type of model,
深度学习几乎每次都能胜过其他模型
almost every time on a huge range of tasks.
下一个视频我们会深挖深度学习
We’ll dive into deep learning more in the next episode,
但是这个视频主要是机器学习的概述
but this video will just focus on machining learning in general.
机器学习一般分为三种风格
We usually class learning into three different styles.
第一种叫监督式学习
The first style is called supervised learning.
它指的是我们给模型的是有标签数据 如汽车图片
It’s where we give a model a labelled data set like car pictures,
它会给予正误的反馈
so it gets feedback on what’s correct and what’s not.
它只需要学习标签和数据之间的对映关系
It just has to learn the mapping between the labels and the data,
然后它们就可以解决某些指定任务
and then they can solve some given tasks
比如对图片中车做归类
like classifying the type of car in an image.
非常简单明了
It’s all relatively straightforward
这种方法有着很高质量的结果
and we’ve gotten incredible results from it.
第二种学习风格是无监督学习
The second learning style is called Unsupervised Learning.
指的是当我们给模型一个没有标签的数据集
This is when we give a model, a data set without labels,
它并不反馈对错
it gets no feedback on what’s correct or not.
当数据结构是
It has to learn by itself
解决给出的任务时
what the structure of the data is
它必须得自学才行
to solve some given task.
这更难做到 但是非常方便
This is harder to do, but more convenient,
因为不是每个人有完美的有标签数据集
since not everyone has a perfectly labelled data set sitting around.
大多数数据都是无标签的
Most data is unlabelled.
混乱 复杂
It’s messy and complex.
第三种是强化学习
And the third type is Reinforcement Learning.
这种方式不会马上得到反馈
This is where a model isn’t given feedback right off the bat,
而只会在目标达成时得到反馈
it only gets it if it achieves its goal.
因此 如果我们打算实现一个
So, if we’re trying to create an reinforcement learning bot
能够击败人类的象棋机器人
that can learn to beat humans at chess,
它只有在赢了比赛时 才会收到反馈
it would only receive feedback if it won the game,
而监督式学习 每一步都会收到反馈
whereas in the supervised approach we get feedback every move,
非监督式学习
and in the unsupervised approach,
赢了都不会收到反馈
we’d never get feedback, even if it won.
强化学习与这两种不同
Unlike the other two learning styles,
通过尝试和犯错
reinforcement learning is linked
达到与外界环境互动的效果
to the idea of interacting with an environment through trial and error.
好 我已经拿到了不同动物的
So, I’ve got a data set of measurements of different animals
脑重量数据 我们打算通过该数据来预测其体重
and we want to predict an animal’s body weight, given its brain weight.
因为我们的数据是有标签的
Since our data is labelled,
这将是一个监督式学习
this will be a supervised approach
机器学习将执行的任务
And the type of machine learning task will perform
叫做回归
is called Regression.
我们将写一个10行的Python脚本去实现它
We’ll right out a ten line Python script to do this
我将会在过程中一步步解释
and I’ll explain things as we go.
首先我们将导入三个依赖
We’ll start up by importing our three dependencies.
第一个是让我们读取数据集的pandas
The first one is pandas which will let us read our data set.
第二个是scikit-learn
The second one is scikit learn
它是一个机器学习库
which is the machine learning library
我们将用于本例
we’re using for this example.
第三个是matplotlib
And the third is matplotlib
它让我们的模型和数据可视化
which will let us visualise our model and data.
现在我们已经导入了依赖包
Now we’ve imported our dependencies,
可以用pandas来读取数据集
we can read our data set using pandas.
我们将用read_fwf函数来读取动物数据集
We’ll use the read fwf function to read our animal data set.
这是一个定宽表格 会被转换为pandas的datafram对象
A table of fixed width formatted line into a pandas data frame object,
它是一个二维的行列数据结构
which is a 2D data structure of rows and columns.
我们的数据集包括多个动物种类的
Our data set contains the average brain and body weight
脑重量和体重平均值
for a number of animal species.
当数据储存到datafram变量中
Once our data is in our data frame variables
就可以将其解析和读取出这两个指标 并存放到不同的变量中
we can easily parse and read both measurements into two separate variables.
我们把脑测量值存入x变量
We’ll store our brain measurements in the x-values variable,
把体重测量值存进y变量
and the body measurements in the y values variable.
那么 如果往标准的2D平面上
So, if we were to plot this data right now,
绘制这些数据
on a standard 2D graph,
看起来会像这样
It will look like this:
我们的目标是通过一个新的动物体重数据
And our goal is that given a new animal’s body weight
来预测出它的脑容量
we’ll be able to predict what its brain size is.
那么 该怎样实现?
So, how are we gonna do that?
耶 啊哈 你懂的
Yeah, uh ah, you know what it is,
自变量和因变量
Independent and Dependent.
自变量和因变量
Independent and Dependent.
我的数据包含 脑重和体重
My data’s got the value for the brain and the body weight.
我要搞清楚 怎样找出两者间的关系
And I am wondering what to use to find if they relate.
线性回归
Linear Regression.
它能帮上忙
Helps find the relationship.
要通过测量找出来 最合适的唯一线
We’re going to measure it and find the only line of best fit.
公式y等于m乘以x加b
The equation Y equals mx Plus b
这就是全部
is all we need
b是y的截距 m是它的斜率
b is the y intercept and m measures how steep
在图像上找到它
Find it on the graph
让我们预测脑重量和体重
Let’s predict the body with the brain
低空 打开香槟
Low air, pop champagne
当你用scikit learn模型对象去初始化线性回归
When you scikit learn linear model object to initialise our linear regression
并且储存体重回归变量
and store it in the body regression variable,
然后我们能够用一对对x和y值去匹配模型
then we can fit our model on our x-y value pairs.
现在我们得到了最贴合的线
Now that we have the line that best fit,
我们可以绘制我们的x和y值
we can plot our x y value pairs
得到一个matplotlib散点图
on a matplotlib scatter plot,
然后得到我们线性回归的线
then plot our regression line by saying
从而使得每一个x值都能得到一个对应的y值
for every x value we have predict the associated y value
通过连接每一个点成一条线
and draw lines that intersects all those points.
然后我们可以用show功能画出它
We can then display it using the show function.
让我们继续 在终端运行这段代码
Let’s go ahead and come plot this code in terminal
每一个数据点绘制成了一个散点图
Our scattered plot will appear with all our data points mapped out.
x轴代表脑重量
The x axis represents brain weights,
y轴代表体重
and the y axis represents body weights.
大部分数据都能与线性回归线重合
Our regression lines seem to fit most of the data pretty well,
这说明大脑和体重
and there seems to be a very strong correlation here
有很强的相关性
between brain weight and body weight.
当我们沿着线移动
And as we move along the line,
通过脑重量我们也能预测体重
given any brain weight we can also predict the associated body weight.
所以 将它分解来说
So, to break it down,
当传统的程序通过定义步骤来得到结果
while traditional programming is about defining the steps to reach an outcome,
机器学习则是定义结果
machine learning is about defining the outcome,
而程序用来学习得到结果的步骤
and our program learn the steps to get there.
有三种学习方式
There’re three different learning styles.
监督式 非监督式和强化学习
Supervised, Unsupervised and Reinforcement Learning.
线性回归模拟了自变量和因变量
And linear regression models the relationship between
之间的关系 以创造最适合
Independent and Dependent variable,
我们用来预测的直线
to create the line of best fit which we can then use to make predictions.
上周的编程挑战胜者是米克·万·赫尔斯特
The winner of last week’s coding challenge is Mick Van Hulst.
他将游戏世界优化的更复杂了
He modified the game world to be more complex.
他的队列学习机器人比我
And his queue learning bot was much more efficient
的演示机器人更高效完成目标
at reaching the goal than my Demo bot.
本周的男巫
Wizard of the week.
亚军是Vishal Batchu
The runner up is Vishal Batchu.
他用细胞自动机生成地图
He generated map using cellular automata.
本视频的挑战是
The challenge for this video
用scikit-learn创建一条回归线
is to use scikit learn to create a regression line,
我会提供一组不同的数据集
for a different data set that I’ll provide,
然后打印出你的预测与实际值之间的误差
and print out the error between your prediction and the actual value.
详情在Readme文件里
Detail is in the Readme.
在评论里发出你的GitHub链接
Post your GitHub link in the Comments,
一周内我会公布一个胜者
and I’ll announce a winner in one week.
请点击订阅按钮
Please hit that Subscribe button.
现在 我想去学习了
And for now, I’ve got a feel to learn.
感谢观看
So, thanks for watching.

发表评论

译制信息
视频概述

本文是了解深度学习的第一课,用机器学习的方法通过体重来预测大脑的尺寸

听录译者

昵伊荙

翻译译者

。蓝

审核员

审核员YX

视频来源

https://www.youtube.com/watch?v=vOppzHpvTiQ&t=43s

相关推荐