CS221: Artificial Intelligence: Principles and Techniques

Logistics
Time/location:
• Lectures: Mon/Wed 1:30-2:50pm in NVIDIA auditorium (watch online)
• Sections: Thurs 4:30-5:20pm in NVIDIA auditorium; see calendar for schedule.
• Office hours: CA office hours are in the Huang basement; see calendar for times; see [Office Hour Logistics] for logistics.
Instructors: Percy Liang and Stefano Ermon
Course assistants:
• Darren Baker
• Zach Barnes
• Bardia Beigi
• Zhi Bie
• Heather Blundell
• Rickard Brüel Gabrielsson
• Orion Despo
• Tony Duan
• David Eng
• Bryan He
• Mark Holmstrom
• Helen Jiang
• Nish Khandwala
• Hansohl Kim
• Andrey Kurenkov
• Sydney Li
• Dylan Liu
• Michelle Mei
• Reid Pryzant
• Alisha Rege
• Vig Sachidananda
• Mohana Sathya Moorthy
• Christopher Sauer
• Michael Xing
• Anna Wang
• Feiran Wang
• Yang Yuan
How to contact us: Please use Piazza for all questions related to lectures, homeworks, and projects. For SCPD students, email scpdsupport@stanford.edu or call 650-741-1542.
Announcements: see Piazza. NOTE: If you enrolled in this class on Axess, you should be added to the Piazza group automatically, within a few hours. You can also register independently; there is no access code required to join the group.
Calendar: look here for dates/times of all lectures, sections, office hours, due dates.
Content
What is this course about? What do web search, speech recognition, face recognition, machine translation, autonomous driving, and automatic scheduling have in common? These are all complex real-world problems, and the goal of artificial intelligence (AI) is to tackle these with rigorous mathematical tools. In this course, you will learn the foundational principles that drive these applications and practice implementing some of these systems. Specific topics include machine learning, search, game playing, Markov decision processes, constraint satisfaction, graphical models, and logic. The main goal of the course is to equip you with the tools to tackle new AI problems you might encounter in life.
Prerequisites: This course is fast-paced and covers a lot of ground, so it is important that you have a solid foundation on both the theoretical and empirical fronts. You should have taken the following classes (or their equivalents):
Reading: There is no required textbook for this class, and you should be able to learn everything from the lecture notes and homeworks. However, if you would like to pursue more advanced topics or get another perspective on the same material, here are some books:
Bear in mind that some of these books can be quite dense and use different notation terminology, so it might take some effort to connect up with the material from class.
Office Hour Logistics
CA office hours are either in the Huang basement or online See calendar for times. In both in-person and online office hours, you will need to register an account on QueueStatus. When you wish to join the queue, click "Sign Up" at the CS221 queue. Be sure to enter your email when you "Sign Up"; this is a way for the CA to contact you. Look for announcements on the left panel for more information. For online office hours, you will need to install Zoom to video call with the CA. See instructions below.

Installing Zoom

• Linux:
• Open package (e.g. with 'Ubuntu Software Center' or other appropriate application) and install.
• Windows:
• Go to Stanford Zoom and click 'Launch Zoom'.
• Click 'host meeting'; nothing will launch but there will a link to 'download & run Zoom'.
• Run 'Zoom_launcher.exe' to install.
Coursework

• Homeworks (60%): There will be weekly homeworks with both written and programming parts. Each homework is centered around an application and will also deepen your understanding of the theoretical concepts. Some homeworks will have a competition component; winners will receive extra credit. Here are all the homework deadlines:

• Exam (20%): The exam is a three-hour written exam that will test your knowledge and problem-solving skills on all preceding lectures and homeworks. You cannot use any external aids except one double-sided page of notes. If you have a major conflict (e.g., an academic conference), submit a request to take it at another (earlier) time. Your request must be submitted by Tue Oct 31.
Date: Tue Nov 28 from 6pm to 9pm
Location:
• Last names A-B: 200-002
• Last names C-H: CUBAUD
• Last names I-P: HEWLETT 200
• Last names Q-U: STLC 111
• Last names V-X: 420-041
• Last names Y-Z: 260-113

For SCPD students, your exams will be distributed through the SCPD office once you have set up an exam monitor.

• Project (20%): The final project provides an opportunity for you to use the tools from class to build something interesting of your choice. Projects should be done in groups of up to three. The project will be something that you work on throughout the course and we have set up some milestones to help you along the way:

See the project page for more details.

Regardless of the group size, all groups must submit the same basic amount of work as detailed in each milestone. Of course, the experiments may not always be successful, so we will cut the smaller groups more slack, while larger groups are expected to be more thorough in their experiments.

For inspiration, we have made previous CS221 projects available for viewing.

• Piazza: You will be awarded with up to 2% extra credit if you answer other students' questions in a substantial and helpful way.

Assignments

Written assignments: Homeworks should be written up clearly and succinctly; you may lose points if your answers are unclear or unnecessarily complicated. Here is an example of what we are looking for. You are encouraged to use LaTeX to writeup your homeworks (here's a template), but this is not a requirement. You will receive one (1) bonus point for submitting a typed written assignment (e.g. LaTeX, Microsoft Word). We will accept scanned handwritten assignments but they will not receive the bonus point.
Programming assignments: The grader runs on Python 2.7, which is not guaranteed to work with newer versions (Python 3) or older versions (below 2.7). Please use Python 2.7 to develop your code.

Although we recommend that you use a UNIX environment (e.g., Linux or OS X), the sanity check script grader.py should work on Windows as well. Note that no matter what OS you use, you will need to submit the assignments on corn machines. The final grading will be run on Linux servers.

The submitted code will not be graded if it has one of the following issues:

• The code does not run on corn.stanford.edu. In particular, Python packages outside the standard library are not guaranteed to work.
• The code quits unexpectedly. To prevent this, do not use quit(), exit(), sys.exit(), os._exit().
• The code reads external resources other than the files given in the assignment.
• The code is malicious. This is considered a violation of the honor code. The score of the assignment will be zero (0) and the incident will be reported to the Office of Judicial Affairs.
Collaboration policy and honor code: You are free to form study groups and discuss homeworks and projects. However, you must write up homeworks and code from scratch independently. The following are considered to be honor code violations:
• Looking at the writeup or code of another student.
• Showing your writeup or code to another student.
• Discussing homework problems in such detail that your solution (writeup or code) is almost identical to another student's answer.
• Uploading your writeup or code to a public repository (e.g. github, bitbucket, pastebin) so that it can be accessed by other students.
• Looking at solutions from previous years' homeworks - either official or written up by another student.
When debugging code together, you are only allowed to look at the input-output behavior of each other's programs (so you should write good test cases!). It is important to remember that even if you didn't copy but just gave another student your solution, you are still violating the honor code, so please be careful. We periodically run similarity-detection software over all submitted student programs, including programs from past quarters and any solutions found online on public websites. Anyone violating the honor code will be referred to the Office of Judicial Affairs. If you feel like you made a mistake (it can happen, especially under time pressure!), please reach out to Percy or the head CA; the consequences will be much less severe than if we approach you.

Submission

Electronic Submission: All assignments (homework problems and project milestones) must be submitted using the submit script by 11pm (23:00, not 23:59). Please note that the submission script only works on corn.

To submit:

1. Copy your submission files (usually <assignment ID>.pdf and submission.py) to corn.stanford.edu. You can use a graphical interface (SecureFX, FileZilla, Fugu) or the following command:

scp <your submission file(s)> <your SUNetID>@corn.stanford.edu:
2. Login to corn.stanford.edu:

ssh <your SUNetID>@corn.stanford.edu
For Windows, you can use SecureCRT, PuTTY, or Cygwin. Make sure you use the binary transfer mode, as the ASCII transfer mode will damage PDF files!
3. Make sure the code runs correctly on corn. (Otherwise, the code will not be graded.)

4. Type:

/usr/bin/python /usr/class/cs221/WWW/submit.py <assignment ID> <directory with your submission files>
For example, if the assignment ID is foundations and you are in the same directory as your submission files, type:
/usr/bin/python /usr/class/cs221/WWW/submit.py foundations ./

You are allowed to submit an assignment a maximum of ten (10) times. Each submission will replace the previous.

Since we do not accept the assignments from other submission methods (e.g., email), please make sure you can use the submit script. Do not wait until the deadline. If anything goes wrong, please ask a question on Piazza or contact a course assistant. Do not email us your submission. Partial work is better than not submitting any work.

You can check here for confirmation of your submission. For assignments with a programming component, we will automatically sanity check your code in some basic test cases, but we will grade your code on additional test cases. Important: just because you pass the basic test cases, you are by no means guaranteed to get full credit on the other test cases, so you should test the program more thoroughly yourself!

Unless the assignment instructs otherwise, all of your code modifications should be in submission.py and all of your written answers in <assignment ID>.pdf.

For the project milestones, make sure the same one member of your group submits on behalf of the entire group. The submission should include a group.txt file which should contain the SUNetIDs of the entire group, one per line. Do not include your names!

Late days: An assignment is $\lceil d \rceil$ days late if it is turned in $d$ fractional days late (note that this means if you are $1$ second late, $d = 1/(24 \times 60 \times 60)$ and it is 1 day late). You have eight (8) late days in total that can be distributed among the assignments (except the final project report) without penalty. There is a maximum of two (2) late days that can be used per assignment. If you exceed this limit by $k$ hours, then you will incur a multiplicative penalty factor of $\max(1 - k/5, 0)$. For example, if you get $40$ points and turn in your homework 2 days + 1.5 hours after the deadline, then your effective score is $40(1 - 1.5/5) = 28$. If you exceed $5$ hours, you will receive $0$ points. You get a zero after all your late days run out, but we reserve the right to give partial credit in extenuating circumstances.
Regrades: If you believe that the course staff made an objective error in grading, then you may submit a regrade request. To do this, you must come in person to the owner CA in charge of the given homework or exam problem. Any requests submitted over email or on Piazza will be ignored. Remember that even if the grading seems harsh to you, the same rubric was used for everyone for fairness, so this is not sufficient justification for a regrade. If the regrade request is valid, the CA will add your request to the list, which will get processed.