Quick Tour of Jupyter/iPython Notebooks (C1W2L17)

An instructor walks through Jupyter notebooks: running code and markdown cells with Shift+Enter, restarting kernels when they freeze, and why you need to run setup cells first. Includes how to submit the Week 2 programming assignment.
Chapters
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's the jupyter ipython notebook that you can get to on Coursera. Let me just quickly show you a few features of this. The instructions are written right here in the text in the IPython notebook. And these long light gray blocks are blocks of code. So occasionally you see in these blocks something that looks like this is there start code here and end code here. To do the programming exercise, please make sure to write your code between the start code here and end code here. So for example, print hello world. And then to execute a code block you can hit shift enter. And then to execute this code block, which I guess we just wrote print hello world. So that printed hello world. To run a cell, you can also. To run one of these code blocks of cell, you can also click cell and then run cell so that executes this. It's possible that on your computer, the keyboard shortcut for cell run cell might be different than shift enter. But on both my Mac as well as on my PC, shift enter. So it might be the same for you as well. Now when you're reading the instructions, if you, 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 this cell. So either go to Cell run cell or I'm going to hit shift enter and that basically executes the markdown and turns it back into this nice looking code. Just a couple more tips. When you execute code like this, it actually runs on a kernel, on a piece of code that runs on a server. If you're running an excessively large job, or if you leave a computer for a very long time or something goes wrong with your Internet connection or something, there is a small chance that the kernel on the backend might die, in which case 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 can just starts it up to IPython notebook. But if you see an error message that the kernel has died or something, you can try kernel restart. Finally, in an IPython notebook like this, there may be multiple blocks of code. So even if an earlier block of code doesn't have any graded code, be sure to execute this block of code because in this example it imports numpy as np and so on, and sets up some of the variables that you might need to in order to execute the low, lower down 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, there's this blue Submit assignment button here on the upper right and we click that it will submit your solutions. For grading I found that 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 and iterate quickly. So I hope that the programming exercises in The Coursera 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. There's an optional video that talks about the cost function for logistic regression. You can watch that or not, either way is perfectly fine. But either way, best of luck with the Week 2 programming assignment, and I also look forward to seeing you at the start of the weekly materials.










