该系列仅在原课程基础上部分知识点添加个人学习笔记,或相关推导补充等。如有错误,还请批评指教。在学习了 Andrew Ng 课程的基础上,为了更方便的查阅复习,将其整理成文字。因本人一直在学习英语,所以该系列以英文为主,同时也建议读者以英文为主,中文辅助,以便后期进阶时,为学习相关领域的学术论文做铺垫。- ZJ
转载请注明作者和出处:ZJ 微信公众号-「SelfImprovementLab」
知乎:https://zhuanlan.zhihu.com/c_147249273
CSDN:http://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
的平方,来看看
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
这里想表达的是当
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
取不同值的时候,它的斜率是不同的 这和上个视频中的例子不一样,现在换个点来看,如果
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
的平方,
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的平方的导数 等于
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
,如果你稍微将
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
的平方,按照微积分课本上的写法,这个函数的导数应该为
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 那么
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 的三次方,如果我们又将
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
为底数的对数函数 有些人,可能会写作
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
事实上借助计算器的话,你会发现当
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,
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」!专注「深度学习」,「机器学习」,「人工智能」。以及 「早起」,「阅读」,「运动」,「英语 」「其他」不定期建群 打卡互助活动。