MIRANDA: Oh, wonder! How many goodly creatures are there here! How beauteous mankind is! O brave new world, That has such software packages in it! – William Shakespeare, The Tempest

AI seems to run on python and linux, so we’re going to use these systems extensively. A good workstation will save you a lot of time. Like any set of tools, it’s something you add to (and subtract from) over time, but this lab will help you get to the 80% solution.

Goals for this lab

  1. Become familiar with Colab.
  2. Set up your python environment.
  3. Install and play with numpy and matplotlib.
  4. Install and play with pytorch.
  5. (stretch goal) If you’ve got all of that done, find an interesting pretained model on HuggingFace, and show me what you made it do.

Your Machine

Please bring a laptop for this lab.

Having a full installation of Ubuntu will be very helpful in the later stages of this course, especially as you begin to use the Robot Operating System (ROS). If you can manage it, install Ubuntu natively on your laptop. Robotics packages seem to be stuck in time, so Ubuntu 18 might be your best bet.

If you’re on a mac, you won’t be able to install Ubuntu natively, but that’s okay – you can still use your mac for pytorch. Here’s a good step-by-step on making it useful (installing CLI tools, homebrew, etc).

Running windows is not recommended, but you can experiment with wsl. Eventually you’ll want to just dual-boot Ubuntu.

Environments

Some of our assignments will run in Google Colab, which is like a jupyter notebook with a big heart. Colab is really handy, but it’s worthwhile to learn how to manage your own python environment. cs231 has a good write-up on the finer points of Colab, conda, and venv.

Please read through their instructions and play around on your own for a little while.

python, numpy, matplotlib

These are great tools, so we’ll spend a lot of time using them.

I’m about to link you to a good tutorial, but first, a suggestion about how to read it: The first time, just skim through and learn what the software can do so that you can look it up later. Then start typing in the notebook and doing some examples. Play with it like a child. This will help you remember the features and syntax. Very few people use numpy without referring to the documentation, especially for something counter-intuitive like ‘broadcasting’, so don’t worry if you can’t remember it perfectly the first time through. Just move on and come back to it later. It’ll become natural with time.

Here’s the tutorial! https://cs231n.github.io/python-numpy-tutorial/#numpy

pytorch

Pytorch is love, pytorch is life, pytorch is a library that implements neural networks. We use it all the time. It’s built around numpy syntax, mostly.

Here’s a 60-minute dive into pytorch.