Coursera | Andrew Ng (01-week-2-2.17)—Jupyter _ ipython 笔记本的快速指南

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

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


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

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

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


2.17 Quick tour of Jupyter/ipython notebooks (Jupyter _ ipython 笔记本的快速指南)

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

这里写图片描述

With everything you’ve learned,you’re just about ready to tackle your first programming assignment.Before you do that, let me just give you ,a quick tour of ipython notebooks in Coursera. Here you see, Jupyter iphython notebooks ,that you can get to in Coursera.Let me just quickly show you a few features of this.The instructions are written into text in the ipython notebook,like gray blocks are blocks of code.So occasionally, you see in these blocks ,sometimes looks like this ,this is their start code here and end code here.To do their primary exercise,please make sure to write your code ,between the start code here and end code here.So for example, print Hello World.Right. And, then to execute a code block,,you can hit shift enter and then they execute this code block,which I guess we just wrote print Hello World.

你们已经学会很多了,现在你已经准备好了,解决你的第一个编程任务,在你这样做之前 让我来给你,介绍一下 Coursera 中的 ipython 笔记本,你可以看到 这是 Jupyter iphython 笔记本,你可以在 Coursera 中访问,让我快速向你展示一下它的功能,这指南是用 ipython笔记本文本写的,灰色块是代码段,所以你偶尔会看到这些代码段,有时看起来是这样的,这是写 代码开始 代码结束,要做第一个大作业,请确保你写的代码,在代码开始和代码结束之间,比如 print Hello World,对吧 然后要执行代码段,你可以输入 Shift+Enter 然后执行代码段,我们刚写了print Hello World。

这里写图片描述

So that printed Hello World.To run a cell, you can also,to run one of these code blocks in cell,you can also click cell and then run cell.So to execute this is possible that on your computer the keyboard shortcut for cell runs cell might be different than shift enter but on both my Mac as well as on my PC,a shift enter so might be the same for you as well.Now, when you’re reading the instructions if you know,accidentally double click on it,you might end up with this markdown language.If you end up with this funny looking text,to convert it back to the nice looking text just run the cell.So click on the cell runs cell or I’m going to hit shift enter and that basically executes the markdown and turns it back into this nice looking code.

所以 Hello World 就输出来了,要运行一个单元格 你也可以,在其中一个单元格里跑代码,你可以点单元格菜单 然后运行单元格,你是可以用 键盘快捷方式执行的,要执行单元格程序 可能用的不是 Shift+Enter,但在我的 mac 和 PC 中都行,所以你用 Shift+Enter 可能也行,所以当你阅读说明你就知道,意外双击后,你可能会得到这样的标记语言,如果你得到这种怪怪的文本,要把它们变回格式整齐的文本 只需要执行这个单元格就行了,所以点击单元格 然后运行 我这里要用 shift+enter,这基本上就执行了标记语言,并将它重新转换成漂亮的代码段。

这里写图片描述

Just a couple of more tips,when you execute code like this,it actually runs on a kernel,on a piece of code that runs on the server.If you’re running an excessively large job or if you’re,you leave a computer for a very long time or something goes wrong,your internet connection is off,there is a small chance of the kernel on the back end might die,which is just click kernel.And then restart kernel and hopefully that will reboot the kernel and make it work again.So that shouldn’t happen if you’re just running relatively small jobs and you’re just starting up your ipython notebook.But if you see an error message that the kernel has died or something,you can try kernel restart.Finally, and ipython notebook like this there may be multiple blocks of code.So, even if an earlier block of code doesn’t have any grading code,be sure to execute this block of code because in this example,it imposed numpy as np and so on.

这里还有一些提示,当你执行这样的代码时,它应该是在内核上运行的,那是服务器上的一段代码,如果你跑一段计算量很大的代码,或者你离开电脑很久 出了什么问题,比如你的网断了,那么后端的内核可能会宕机,那么你只需点击内核,然后重启内核 希望,重启内核可以让它重新工作,不过如果你运行的代码,计算量不多 应该不会出这种问题,如果你开始使用 ipython 笔记本,然后你看到错误信息,内核卡死了之类的,你可以尝试重启内核,最后 这样的 iPython 笔记本,可能有很多代码段,所以即使前面一些代码段,没有任何用于作业评分的代码,一定要确保执行这段代码 因为这个例子中,它执行了 import numpy as py 等等

这里写图片描述

And said so some of the variables that you might need in order to execute the lowdown on blocks of code,so be sure to execute the ones on top even if you aren’t asked to write any code in them.And finally, when you’re done implementing your solutions as this blue submit assignment button here on the right and we click that it will submit your solutions for grading.I found out the interactive command shell nature of ipython notebooks to be very useful for letting you quickly implement a few lines of code,see an outcome, learn it very quickly.And so I hope that the approach exercises and Coursera in Jupyter ipython notebooks will help you quickly learn and experiment and see how to implement these learning algorithms.There’s one more video after this. This is an optional video that talks about the cost function for logistic reggression.You can watch that or not,either way is perfectly fine.But either way, best of luck with the week two probing assignments.And I also look forward to seeing you at the start of the next week’s materials.

这样就初始化一些变量,才能执行下面这些代码,所以一定要执行最上面的代码,或者即使没要求你在上面写代码,最后 当你完成代码实现之后,按这个蓝色提交作业按钮,在右边 我们点击一下,就会提交你的答案 然后评分,我发现这些交互命令很像 shell,这样的 ipython笔记本是非常有用的,可以让你快速实现几行代码,马上看到结果 迅速学习,我希望这个练习方法,还有和 Coursera Jupyter ipython 可以帮你迅速,学习和实验 看结果,学会如何实现这些学习算法,之后还有一个视频,那是一个可选的视频,会讨论成本函数的logistic回归,你们可以看 也可以不看,都行,总之 祝你们在,完成第二周作业中有好运气,我希望在下周材料,开始时再见到你。


重点总结:

Windows jupyter install (Python) 本地搭建

pip3 install jupyter

启动 jupyter notebook 命令 cmd

jupyter notebook

mac

jupyter-notebook


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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Coursera-ml-andrewng-notes-master.zip是一个包含Andrew Ng的机器学习课程笔记和代码的压缩包。这门课程是由斯坦福大学提供的计算机科学和人工智能实验室(CSAIL)的教授Andrew Ng教授开设的,旨在通过深入浅出的方式介绍机器学习的基础概念,包括监督学习、无监督学习、逻辑回归、神经网络等等。 这个压缩包中的笔记和代码可以帮助机器学习初学者更好地理解和应用所学的知识。笔记中包含了课程中涉及到的各种公式、算法和概念的详细解释,同时也包括了编程作业的指导和解答。而代码部分包含了课程中使用的MATLAB代码,以及Python代码的实现。 这个压缩包对机器学习爱好者和学生来说是一个非常有用的资源,能够让他们深入了解机器学习的基础,并掌握如何运用这些知识去解决实际问题。此外,这个压缩包还可以作为教师和讲师的教学资源,帮助他们更好地传授机器学习的知识和技能。 ### 回答2: coursera-ml-andrewng-notes-master.zip 是一个 Coursera Machine Learning 课程的笔记和教材的压缩包,由学生或者讲师编写。这个压缩包中包括了 Andrew Ng 教授在 Coursera 上发布的 Machine Learning 课程的全部讲义、练习题和答案等相关学习材料。 Machine Learning 课程是一个介绍机器学习的课程,它包括了许多重要的机器学习算法和理论,例如线性回归、神经网络、决策树、支持向量机等。这个课程的目标是让学生了解机器学习的方法,学习如何使用机器学习来解决实际问题,并最终构建自己的机器学习系统。 这个压缩包中包含的所有学习材料都是免费的,每个人都可以从 Coursera 的网站上免费获取。通过学习这个课程,你将学习到机器学习的基础知识和核心算法,掌握机器学习的实际应用技巧,以及学会如何处理不同种类的数据和问题。 总之,coursera-ml-andrewng-notes-master.zip 是一个非常有用的学习资源,它可以帮助人们更好地学习、理解和掌握机器学习的知识和技能。无论你是机器学习初学者还是资深的机器学习专家,它都将是一个重要的参考工具。 ### 回答3: coursera-ml-andrewng-notes-master.zip是一份具有高价值的文件,其中包含了Andrew NgCoursera上开授的机器学习课程的笔记。这份课程笔记可以帮助学习者更好地理解掌握机器学习技术和方法,提高在机器学习领域的实践能力。通过这份文件,学习者可以学习到机器学习的算法、原理和应用,其中包括线性回归、逻辑回归、神经网络、支持向量机、聚类、降维等多个内容。同时,这份笔记还提供了很多代码实现和模板,学习者可以通过这些实例来理解、运用和进一步深入研究机器学习技术。 总的来说,coursera-ml-andrewng-notes-master.zip对于想要深入学习和掌握机器学习技术和方法的学习者来说是一份不可多得的资料,对于企业中从事机器学习相关工作的从业人员来说也是进行技能提升或者知识更新的重要资料。因此,对于机器学习领域的学习者和从业人员来说,学习并掌握coursera-ml-andrewng-notes-master.zip所提供的知识和技能是非常有价值的。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值