Objectives
- Use a Jupyter notebook to run Python code
- Start to uncover how an image classifier works.
Step 0: Log in to your Google account
You can use either your personal account (if you have one) or your Calvin account.
Note: I don’t recommend trying to run this on your own computer at this point; even if you have a compatible GPU, getting Python to work with it can be a project.
Step 1: Jupyter Notebooks
In this section, we’ll practice working with Jupyter notebooks. You may find these references helpful:
- Colab overview
- some parts of the Jupyter Notebooks docs
A number will appear next to each of the code cells when they have run successfully.
Note carefully the difference between Command mode and Edit mode.
I highly encourage you to get comfortable with keyboard shortcuts for the following operations:
- Switch between edit and command mode. (Enter/Return and Esc)
- Insert a cell above or below (
aandb) - Change a cell to code / Markdown (
moryin Command mode) - Run the current cell (with or without selecting the cell below) (
Ctrl-EnterorShift-Enter)
For more keyboard shortcuts click the Command Palette button on the bottom toolbar on Kaggle (it may be hidden by a cookie consent bar!) or use a search engine.
When you’re done, save your notebook and submit it on Moodle.
Step 2: Image Classifier
In the next section, you’ll work with a basic image classifier.
In this section (and most future Labs), the tasks to do are inside the notebook itself. You’ll find cells labeled Task and blank code chunks usually labeled # your code here. Follow the instructions top-to-bottom, then download and submit when done.
Checklist:
- Did we fill in the table with the accuracy and loss numbers?
- Did we think about whether the predictions are a probability distribution?
- Did we try out using
argmax? Can we get it to show the name of the predicted class, not just its number? - Did we try changing something to see what effect it has on the accuracy?