Assignment Details

All assignments will be released via our github repository

There will be a weekly homework assignments in this class. These assignments will mainly involve building out prototypes for applications that we will discuss in class. For example, you will learn to create your own instagram-like filters or snapchat-like masks or smart-car lane detectors.

Each assignment will contain a hw*.ipynb ipython notebook file that will guide you through the homework. This file will ask you to code up functions in other *.py files and may even ask you to fill in short answers or equations in the ipython notebook. All the instructions necessary for the homework are contained in these hw*.ipynb files.

When to hand in?

The assignments are due each week on Monday at 11:59pm. You can double check the due dates on the syllabus page.

Late Policy

GitHub Beginner Guide

1. Installing Git

Follow the instructions here:

2. Checkout Repository

In terminal, run the following to copy the released homework directory to your desktop.

git clone 

Run the following to copy the lecture notes directory.

git clone

3. Get Updates

To update your local repository to the newest commit, execute
git pull 

This will fetch the changes that TAs made in the remote directory, so your local directory will be up-to-date with the remote one. Be careful that sometimes if the TAs and you are changing the same lines, there will be a conflict, and you may have to fix the conflicts mannually.

In case you did something wrong and want to give up local changes, which hopefully never happens ;), execute

git checkout -- <filename>

4. Commit Your Changes

Note that for the assignments in this course, you don't need to commit your local changes. You will only need to commit your lecture notes to the lecture notes directory.

4.1 Create your own branch by running the following, where for example, branchname could be "lecture1", and then switch to the new branch.

git branch lecture1 
git checkout lecture1

4.2 Add your locally changed files, commit the changes and push to your branch by running the followings.

git add <filename> 
git commit -m "your commit message"
git push

4.3 Then you need to merge your branch back to master.

git merge master(first resolve any merge conflicts if there are any) 
git checkout master (switch to master branch)
git merge lecture1 (there won't be any conflicts now)


Before working on each homework, you need to setup a few things:

Installing Python 3.5+: To use python3, make sure to install version 3.5 or 3.6 on your local machine. If you are on Mac OS X, you can do this using Homebrew with brew install python3. You can find instructions for Ubuntu here.

Setting up a virtual environment: we strongly recommend working using a virtual environment for each homework. This will allow you to have a working environment with all the package dependencies within the repository of your homework, without messing up your work environment in other repositories.

To set up a virtual environment with name .env, run the following inside your homework directory (ex: inside cs131/hw1):

  sudo pip install virtualenv        # You will need to do this only once
  virtualenv -p python3 .env         # Creates a virtual environment with python3
  source .env/bin/activate           # Activate the virtual environment
  pip install -r requirements.txt    # Install all the dependencies
  # Work on the assignement for a while...
  deactivate                         # Exit the virtual environment when you're done

Note that every time you want to work on the assignment, you should run source .env/bin/activate (from within your assignment folder) to re-activate the virtual environment, and deactivate again whenever you are done.

Working with Jupyter notebooks: in your assignment repository, start the notebook with the jupyter notebook command. You might have issues if you are in a virtual environment, as the notebook might not recognize your virtual environment and might not find the kernel located in .env to execute code. In this case, refer to this page and do the following within your virtual environment:

python -m ipykernel install --user --name=my-virtualenv-name

If you are unfamiliar with Jupyter notebooks, you can also refer to the CS231n IPython tutorial.

When working with a Jupyter notebook, you can edit the *.py files either in the Jupyter interface (in your browser) or with your favorite editor (vim, Atom...). Whenever you save a *.py file, the notebook will reload their content directly.


After you have completed each assignment, you need to submit the following deliverables:

Collaboration Policy