Coursera | Andrew Ng (01-week-2-2.6)—更多导数的例子

该系列仅在原课程基础上部分知识点添加个人学习笔记,或相关推导补充等。如有错误,还请批评指教。在学习了 Andrew Ng 课程的基础上,为了更方便的查阅复习,将其整理成文字。因本人一直在学习英语,所以该系列以英文为主,同时也建议读者以英文为主,中文辅助,以便后期进阶时,为学习相关领域的学术论文做铺垫。- ZJ

Coursera 课程 |deeplearning.ai |网易云课堂


转载请注明作者和出处:ZJ 微信公众号-「SelfImprovementLab」

知乎https://zhuanlan.zhihu.com/c_147249273

CSDNhttp://blog.csdn.net/JUNJUN_ZHAO/article/details/78895412


More derivatives examples(更多导数的例子)

(字幕来源:网易云课堂)

这里写图片描述

In this video and show you a slightly more complex example,where the slope of the function can be different at different points in the function.let’s start with an example,here I plot to a function f of a equals a squared.let’s take a look at the point in equals two,so a squared or F of a is equal to four.let’s nudge a slightly to the right ,so,now a is equal to two point zero zero one,f of a which is a squared is going to be approximately four point zero zero four,it turns out that the exact value,if you call the calculator and figure this out is actually four point zero zero four zero zero one,now I’m just to say a 4.04 is close enough.

在这个视频中,我将给出一个更加复杂的例子。在这个例子中,函数在不同点处的斜率是不一样的。先来举个例子,我在这里画一个函数 f(a) 等于 a 的平方,来看看 a 等于 2 的点,在这个点上 a 的平方等于 4,让我们稍稍往右推进一点点,现在 a 等于 2.001,而 f(a) a 的平方,约为 4.004,但是 如果你用计算器算的话,这个准确的值应该为,4.004001,为了简便起见 省略了后面的部分。

这里写图片描述

so what this means is that when a is equal to two.let’s draw this on the plot,so what we’re saying is that,if a is equal to 2 then F of a is equal to 4,and here at the x and y axes are not drawn to scale,technically this vertical height,should be much higher than this horizontal height.so the x and y axes are not on the same scale,but if I now nudge a to 2.001 then F of a becomes roughly 4.004. so if you draw this little triangle again what this means is that if I nudge a to the right by 0.001,f of a goes up four times as much by 0.004.so in the language of calculus we say that the slope that is the derivative from F of a at a equals 2 is 4

这里想表达的是当a=2时,我们重新在图上画一下,如果 a=2 的话,那么 f(a)=4 ,这里 x 轴和 y 轴的比例还是不太准确,实际上这个点的高度,要比这里纵轴的 x 值,还要大那么一点点 x 轴和 y 轴不成比例的,如果让 a=2.001 ,则 f(a) 约为 4.004 如果你在这儿画,一个小三角形,你就会发现,如果把 a 往右移动 0.001,那么f(a)将增大四倍 即增大 0.004,在微积分中我们把这个,此三角形斜边的斜率, f(a) 在点 a=2 处的导数等于 4。

or to write this out with calculus notation,we say that d/da of f of a is equal to 4,when a is equal to 2 now one thing about,this function f of a equals a square is that the slope is different for different values of a,this is different and the example we saw on the previous slide.so let’s look at a different point,if a is equal to 5 so except equals 2,now you have a equals 5 then a squared is equal to 25,so that’s f of a if I nudge a to the right again.it’s tiny little nudge of a so now a is 5.001,then F of a will be approximately 25.010.so what we see is that by nudging a up by 0.001,F of a goes up 10 times as much.so we have that d da f of a is equal to 10 when a is equal to 5,because F of a goes up 10 times as much as a does,when I make a tiny little nudge to a so one way to see.

或者写成微积分的形式,当 a=2 的时候, ddaf(a)=4 由此可知,函数 f(a)=a2 a 取不同值的时候,它的斜率是不同的 这和上个视频中的例子不一样,现在换个点来看,如果a=5 不再等于 2, a=5 , a 的平方为 25,这是f(a)的值,如果再一次把 a 往右移一点点,只是移动非常小的一段距离 让a=5.001,而 f(a) 的值大约为 25.010,当我们只往右移动了 0.001 时, f(a) 却增大了10倍,即可以写作 ddaf(a)=10 ,此时 a 的值为 5 这里只是小小地移动了a f(a) 的值增大了 10 倍 有种直观的方法可以解释。

why the derivative is different at different points, is that if you draw that here a little triangle right at different locations on this,you see that the ratio of the height of the triangle,over the width of the triangle is very different,at different points on the curve.so here the slope is equal to 4,when a is equal to 2 but is equal to 10,when a is equal to 5 now if you pull up,a calculus textbook a calculus textbook will tell you that d/da of f of a so f of a is equal to a square.so that d/da of a squared,one of the formulas you find that the calculus textbook is that,this thing the slope of the function a squared is equal to 2a.

为什么一个点的斜率,在不同位置会不同?如果你在曲线上的,不同位置画一些小小的三角形,你就会发现 三角形高和宽的比值,在曲线上不同的地方,它们是不同的,所以当 a=2 时,这里的斜率为 4 而当 a=5 时,这里的斜率为 10 如果你翻看,微积分的课本,课本会告诉你, ddaf(a) 这里 f(a) 等于 a 的平方,ddaf(a)的值,由课本上的公式可知,函数 f(a)=a2 的斜率 应该等于 2a

这里写图片描述

I’m not going to prove this,but the way you find yours out is that,you open up a calculus textbooks to the table formulas,and it’ll tell you the derivative of two of a squared,is equal to 2a and indeed,this is consistent with what we’ve worked out mainly,when a is equal to 2,the slopes of function to a is 2 times 2,is therefore equal to 4,and when a is equal to 5,then the slope of the function 2 times a is 2 times 5,is equal to 10,so if you ever pull up a calculus textbook,and you see this formula that,the derivative of a squared is equal to 2a,

这里不证明这个公式,但你可以打开微积分课本,找到上面的公式表,它会告诉你 f(a)=a2 的导数,确实为 2a ,事实上这也和我们 手工算的结果一样,当 a=2 时,函数的斜率为 2 乘以 2,即等于 4,当 a=5 时 函数的斜率为,2 乘以 a 即 2 乘以 5 等于 10,如果你翻看微积分课本,你会看到这个公式,即a的平方的导数 等于2a

all that means is that for any given value of a,if you nudge it up with by 0.001,already your tiny little value.you would expect f of a to go up by 2a,that is the slope or the derivative times,however much you had an urge to the right,the value of a now one tiny little detail.you know I have used these approximate symbols here,and this wasn’t exactly 4.04,there’s an extra point 001.you know there it turns out that,this extra pont 001 this little thing here is,because we were nudging a to the right,by 0.001 if we’re instead nudging it to the right,by this new infinitesimally /infini’tesiməli/ 极小地 small value,then this extra ever term,will go away and you find that the amount,that f of a goes up is exactly equal to,the derivative times the amount that you nudged to the right,

这意味着任意给定一点 a ,如果你稍微将a,增大 0.001,那么你会看到 f(a) 将增大 2a ,即增大的值为点在 a 处斜率或导数,乘以你向右移动的距离,现在 有个小细节需要注意,之前我在这里使用了一些不精确的值,这里的值不应该为 4.04,你知道这里,应该还有额外 001 这里有额外的 001 是因为,我们把a向右移动了 0.001,然而如果我们把 a 向右移动,像这样一个非常非常小的值,那么这个额外的项,将可以被忽略 这样的话,你会发现f(a)增大的值,刚好等于导数乘以 你向右边移动的距离,

and the reason why is not 4.004 exactly is,because derivatives are defined using,this infinitesimally small not just to a rather than you know 0.001,which is well and while 0.001 is small is not infinitesimally small,so that’s why the amount that effort,where it went up isn’t exactly given by the formula,but is only kind of approximately,given by the derivative to wrap up this video,let’s just go through a few more quick examples,the example you’ve already seen is that,if f of a equals a squared then,in calculus textbooks formula table,will tell you that the derivative is equal to 2a.

至于为什么不是刚好等于 4.004,是因为导数就是根据,这个无穷小值来定义的。而这里的 0.001虽然比较小,但是它还不足以小到,可以被忽略。这就是为什么导数增大的值 不是恰好等于公式算出来的,而只是根据导数算出来的一个近似值,出于总结本课的目的,我们再来看看几个例子,之前你已经知道的是, f(a) 等于 a 的平方,按照微积分课本上的写法,这个函数的导数应该为 2a

这里写图片描述

and so the example we went through was that if a is equal to 2 f of a,equals 4 and if we nudge a,so it’s a little bit bigger then f of a is about 4.004,and so f of a went up four times as much,and indeed when a is equal to 2 the derivative,is equal to 4 let’s look at some other examples.let’s say instead f of a is equal to a cubed.if you go to a calculus textbook,and look up the table of formulas.you see that the slope of the function again,the derivative of this function is equal to 3a squared.so you can get this formula out of a calculus textbook.

和之前的例子一样,如果 a 等于 2 那么f(a)等于 4,把 a 向右边移动一点,那么f(a)将增大一点 大约为 4.004,所以 f(a) 增大了向右移动距离的四倍,事实上 当 a=2 时,导数的值为 4 来看看其他例子,假设 f(a) 等于 a 的三次方,如果你,翻看微积分课本上的导数公式表,你会发现这个函数的斜率,即这个函数的导数,等于 3 乘以 a 的平方 3a2,你可以在微积分课本上 查到这个公式。

so what this means?so the way to interpret this is as follows.let’s take a equals 2 as an example again,so f of a or a cubed /kjuːb/ 三次方 is equal to 8 does 2 to power 3, so if we give a tiny little nudge,you find that f of a is about eight point zero one two and feel free to check this,take two point zero zero one two three you find that is very close to eight point zero one two and indeed when a is equal to 2,that’s 3. times 2 squared that’s equal to 3 times 4 is equal to 12 so the derivative formula predicts that,if you now nudge a to the right by a tiny little bit f of a should go up 12 times as much,and indeed this is true when a went up by point 001,f of a went up 12 times as much by point 012,

什么意思呢?,同样地举一个例子,我们再次令 a=2 a 的三次方等于 8,即 2 的三次方,如果我们又将 a增大一点点,你会发现 f(a) 的值,大约为 8.012 你可以自己检查一遍,如果我们取 8.012 你会发现 2.001 的三次方,和 8.012 很接近,事实上,当 a=2 时,导数值为 3 乘以 2 的平方,即 3乘以 4 等于 12,导数公式表明,如果你将 a 向右移动 很小的一段距离,那么f(a)将会增大向右移动距离的 12 倍,所以当 a 增加 0.001时,f(a)增大了四倍 即 0.012,

just one last example,and then we’ll wrap up let’s say the f of a is equal to the log function right.so I’m going to write log of a,and I’m going to use a umm base e logarithm.so some people write that as ln of a.so if you go to calculus textbooks you find that,when you take the derivative of log of a,and so this is a function that just looks like that,the slope of this function is given by 1 over a,so the way to interpret this is that if a is any value again let’s just keep using equals 2 as an example
,and you nudge a to the right by 0.001.you would expect f of a,to go up by 1 over a,that is by the derivative times the amounts that

最后一个例子,假设 f(a) 是一个 log 函数,即 f(a)=log(a) ,写作 log(a) 然后我将使用,一个以 e 为底数的对数函数 有些人,可能会写作ln(a),所以如果你去看微积分课本,那么 log(a) 的导数,注意函数 log(a) 的图像 是这样的,函数 log(a) 的斜率 应该为 a 分之1 1a,所以我们可以解释如下,如果 a 取任何值,比如再一次取a=2,然后又把 a 向右边移动 0.001,那么f(a)将增大 a 分之 1,即函数f(a)的导数,乘以你增大 a 的值 (0.001)

you increase a so in fact um,if you pull up a calculator you find that as a is equal to 2,f of a is about 0.6931,and if you increase f and if you increase a to 2 point 0015,and if you increase f and if you increase a to 2 point 001,then f of a is about 0.69365,so it’s gone up by 0.0005,indeed if you look at the formula for the derivative

事实上借助计算器的话,你会发现当a=2时, f(a) 约为 0.69315,如果你增加 f 如果你将 a 增大到 2.001,那么f(a)约为 0.69365,所以 f(a) 增大了 0.0005,事实上如果你查看导数公式

when a is equal to 2 d/da f of a,is equal to 1/2 so this derivative formula,predicts that if you pump up a by 0.001,you will expect f of a to go up,by only one half as much and one half 0.0001 is 0.0005which is exactly what we got right then when a goes up by 0.001going from a close to two equals two point 001,f of a goes up by half as much as this,are going up by approximately 0.0005,so if you draw that little triangle if you will is that,if on the horizontal axis goes up by 0.001,under vertical axis log of a goes up by half of that,so point 0005 and so that one over a 1/2 in this case,when a is equal to 2,that’s just the slope of this line when a is equal to 2.

a=2 的时候 导数值 ddaf(a) ,等于二分之一,导数公式表明 如果把 a 增大 0.001,f(a)将只会增大,0.001 的二分之一 即 0.0005,这正是我们所得到的值 当 a 增大 0.001 时,从a等于 2 增大到非常近的 2.001, f(a) 增大了这个的二分之一,增大了大约 0.0005,所以如果你在这儿画个小三角形,你就会发现,如果 x 轴增加了 0.001,那么 y 轴上的函数 log(a) 将增大 0.001 的一半,即 0.0005 所以是 a 分之 1,当 a=2 时 是 1/2,这个1/2 就是 当 a=2 时 这条线的斜率,这些就是导数的知识了。

there’s just two take-home messages from this video,first is that, the derivative of the function just means,the slope of a function and the slope of a function,can be different at different points on the function,in our first example where f of a equals 3a,this is a straight line the derivative was the same everywhere,it was 3 everywhere,but for other functions like f of a equals a squared,or f(a) equals log of a,the slope of the line varys,so the slope or the derivative can be different at different points on the curve,so does the first take away derivative just means slope of a line,

在这个视频中,你只需要记住两点,第一点是 函数的导数,就是函数的斜率,而函数的斜率在不同的点是不同的, 在第一个例子中 f(a)=3a ,这是一条直线 在任何点 它的斜率都是相同的,都是 3,但是对于函数 f(a)=a2 ,或者 f(a)=log(a) ,它们的斜率是变化的,它们的导数或者斜率 在曲线上不同的点处,是不同的,这是第一个你需要记住的 即导数就是斜率,

second takeaway is that,if you want to look up the derivative of a function,you can flip open 翻开 your calculus textbook or look at Wikipedia,and often get a formula,for the slope of these functions at different points,so that I hope you have an intuitive understanding of derivatives or slopes of lines,let’s go into the next video,we’ll start to talk about the computation graph,and how to use that to compute derivatives of more complex functions

第二点是,如果你想知道 一个函数的导数,你可参考微积分课本或者维基百科,然后你应该就能,找到这些函数的导数公式,最后我希望 你对导数和斜率,有了一个直观的理解,接下来看下一个视频,下一课 我们将讲解流程图,以及如何用它来求更加复杂的函数的导数


PS: 欢迎扫码关注公众号:「SelfImprovementLab」!专注「深度学习」,「机器学习」,「人工智能」。以及 「早起」,「阅读」,「运动」,「英语 」「其他」不定期建群 打卡互助活动。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值