CS221: Artificial Intelligence: Principles and Techniques

Logistics
Communication: We will use Piazza for all communications, and will send out an access code through Canvas. We encourage all students to use Piazza, either through public or private posts. However, if you have an issue that you would like to discuss privately, you can also email us at cs221-aut2021-staff-private@lists.stanford.edu, which is read by only the faculty, head CA, and student liaison.
Academic accommodations: If you need an academic accommodation, you should initiate the request with the Office of Accessible Education (OAE). The OAE will evaluate the request, recommend accommodations, and prepare a letter for faculty. Students should contact the OAE as soon as possible and at any rate in advance of assignment deadlines, since timely notice is needed to coordinate accommodations. It is the student's responsibility to reach out to the teaching staff regarding the OAE letter. Please send your letters to cs221-aut2021-staff-private@lists.stanford.edu by Friday, October 2 (week 3).
COVID-19 update: CS221 will be offered online in Autumn 2020. This quarter will be difficult, with the shift to remote learning, the COVID-19 pandemic, and other events in the US and around the globe. We expect and understand that students will face challenges beyond what a normal in-person quarter would entail. To better support students, we are adapting the course format and introducing several new class activities this year. These are experimental, so please let us know if you have any feedback or suggestions on how we can better support you and make the best out of the quarter.

We are also making two changes to the course structure:

Platforms: Besides Piazza, we will use a combination of Zoom and Nooks to hold class activities and office hours. All quizzes, homework, and project submissions will be handled through Gradescope, where you will also find your grades. We will send out links and access codes to enrolled students through Canvas.
Time/Location: All class activities and office hours are in our class calendar. All following times are in Pacific Time (PT):
Instructors:
Course Assistants:
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.
Video access disclaimer: A portion of class activities will be given and recorded in Zoom. For your convenience, you can access these recordings by logging into the course Canvas site. These recordings might be reused in other Stanford courses, viewed by other Stanford students, faculty, or staff, or used for other education and research purposes. If you have questions, please contact a member of the teaching team.
Coursework

Grading

Homeworks

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. Written homework must be typeset using LaTeX, Microsoft Word, Pages for Mac, or an equivalent program, and submitted as a PDF. We strongly encourage you to use LaTeX: there are user-friendly web interfaces like Overleaf. See this getting started guide. Figures may be hand-drawn, so long as they are included in a typeset PDF. If you're not sure where to start with formatting your written solutions, we recommend using this template as a starting point. You can copy and paste its contents into an Overleaf project or upload it directly.
Programming assignments: The grader runs on Python 3.7+, which is not guaranteed to work with older versions (e.g., Python 2.7). Please use Python 3.7+ to develop your code.

The programming assignments are designed to be run in GNU/Linux environments. Most or all of the grading code may incidentally work on other systems such as MacOS or Windows, and students may optionally choose to do most of their development in one of these alternative environments. However, no technical support will be provided for issues that only arise on an alternative environment. Moreover, no matter what environment is used during development, students must confirm that their code (specifically, the student's submission.py) runs on Gradescope,.

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

  • The original grader.py script (operating on the submitted submission.py) may not exit normally if you use calls such as quit(), exit(), sys.exit(), and os._exit(). Also note that Python packages outside the standard library are not guaranteed to work. Therefore, do not use packages like numpy, scikit-learn, and pandas.
  • 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, and you must acknowledge in your submission all the students you discussed with. 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 the instructor or the head CA; the consequences will be much less severe than if we approach you.

Submission

Electronic Submission: All assignments are due at 11pm (23:00, not 23:59) Pacific time on the due date. Assignments are submitted through Gradescope. Do not submit your assignment via email. If anything goes wrong, please ask a question on Piazza or contact a course assistant. If you need to sign up for a Gradescope account, please use your @stanford.edu email address. You can submit as many times as you'd like until the deadline: we will only grade the last submission. Submit early to make sure your submission runs properly on the Gradescope servers. Gradescope will run grader.py on the programming questions and give you feedback on non-hidden test cases. You are responsible for checking that your program runs properly on these cases. You will not get credit otherwise. 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.

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, hidden 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. Upload the former to Gradescope under the "Programming" section, and the latter under the "Written" section.

For the project milestones, make sure the all members of your group submits. The submission should include a group.txt file which should contain the SUNetIDs of the entire group, one per line.
Late days: A homework is $\lceil d \rceil$ days late if it is turned in $d$ days past the due date (note that this means if you are $1$ second late, $d = 1$ and it is 1 day late). You have seven (7) late days in total that can be distributed among the homeworks without penalty. After that, the maximum possible grade is decreased by 25% each day (so the best you can do with $d = 1$ is 75%). As an example, if you are out of late days and submit one day late, a 90 will be capped at a 75, but a 72 will not be changed. Note that we will only allow a max of $d = 2$ late days per homework, though, so if $d > 2$ then we will not accept your submission. Gradescope is set up to accept written and programming submissions separately. Late days are calculated per-assignment, with the number of late days used depending on the later submission. So, if the programming part is $1$ day late and the written part is $2$ days late, then that will count as using $2$ late days.

No late days can be taken for quizzes; you can start the timed quiz any time during the one-week window. We will drop the lowest quiz score at the end of the course and take the average of the remaining quiz scores.

Regrades: If you believe that the course staff made an objective error in grading, then you may submit a regrade request for the written part of your homework or quiz. 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. It is also helpful to cross-check your answer against the released solutions. If you still choose to submit a regrade request, click the corresponding question on Gradescope, then click the "Request Regrade" button at the bottom. Any requests submitted over email or in person will be ignored. Regrade requests for a particular assignment are due by Sunday 11:59pm, one week after the grades are returned. Note that we may regrade your entire submission, so that depending on your submission you may actually lose more points than you gain.
Schedule

Nooks links included in the schedule below assume you have already signed into our Nooks space following our class specific link shared on Canvas and Piazza.

MondayTuesdayWednesdayThursdayFridaySaturdaySunday
Week 1 Sept 14 Sept 15 Sept 16 Sept 17 Sept 18 Sept 19 Sept 20
Modules
Introduction
Prerequisites
Machine Learning

Homework
[Foundations]

Quiz
[Quiz 1]
[Solutions]
Live Lecture:
Introduction (Percy)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Study Hall
5:00-7:00pm
Problem Workout
1:00-2:20pm
[Problems]
[Solutions]
[Recording]

Homework Party
5:00-7:00pm
Study Hall
7:00-8:00pm
Study Hall
9:00-10:00am
Homework Party
10:00am-12:00pm
Quiz 1 due
Week 2 Sept 21
Sept 22
Sept 23 Sept 24 Sept 25 Sept 26 Sept 27
Modules
Machine Learning II

Homework
[Sentiment]

Quiz
[Quiz 2]
Fireside Talk:
State of Robotics (Dorsa)
1:00-2:20pm
[Recording]

Percy's Open OH
2:30-3:00pm
Foundations HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm
[Problems]
[Solutions]
[Recording]
Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Quiz 2 due
Week 3 Sept 28
Sept 29
Sept 30 Oct 1 Oct 2 Oct 3 Oct 4
Modules
Search

Homework
[Reconstruct]

Quiz
[Quiz 3]
Fireside Talk:
AI and Law
(Mariano-Florentino Cuéllar)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Sentiment HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm

Final Study List Deadline
Homework Party
10:00am-12:00pm
Quiz 3 due
Week 4 Oct 5
Oct 6
Oct 7 Oct 8 Oct 9 Oct 10 Oct 11
Modules
MDPs I

Homework
[Blackjack]

Quiz
[Quiz 4]
Fireside Talk:
Robustness in ML (Tatsunori Hashimoto)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Reconstruct HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00-11:00am
Quiz 4 due
Week 5 Oct 12
Oct 13
Oct 14 Oct 15 Oct 16 Oct 17 Oct 18
Modules
MDP IIs
Games

Homework
[Pacman]

Quiz
[Quiz 5]
Fireside Talk:
State of NLP (Percy)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Blackjack HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm

Homework Party
5:00-7:00pm
Project Proposal due Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Quiz 5 due
Week 6 Oct 19
Oct 20
Oct 21 Oct 22 Oct 23 Oct 24 Oct 25
Modules
Factor Graphs

Homework
[Scheduling]

Quiz
[Quiz 6]
Fireside Talk:
(Emma Pierson)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Pacman HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Quiz 6 due
Week 7 Oct 26
Oct 27
Oct 28 Oct 29 Oct 30 Oct 31 Nov 1
Modules
Bayesian Networks

Homework
[Car]

Quiz
[Quiz 7]
Fireside Talk:
Grad School, Classes etc. (Dorsa+Percy)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Scheduling HW due Dorsa's Open OH
11:00-11:30am

Problem Workout
1:00-2:20pm

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Quiz 7 due
Week 8 Nov 2
Nov 3
Nov 4 Nov 5 Nov 6 Nov 7 Nov 8
Modules
N/A

Fireside Talk:
(Yoav Shoham)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Dorsa's Open OH
11:00-11:30am

Homework Party
5:00-7:00pm
Project Progress Report due Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Week 9 Nov 9
Nov 10
Nov 11 Nov 12 Nov 13 Nov 14 Nov 15
Modules
Logic

Homework
[Logic]

Quiz
[Quiz 8]
Fireside Talk:
(Dragomir Anguelov)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm
Car HW due Dorsa's Open OH
11:00-11:30am

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm
Quiz 8 due
Week 10 Nov 16
Nov 17
Nov 18 Nov 19 Nov 20 Nov 21 Nov 22
Modules
Conclusion

Live Lecture:
Conclusion (Dorsa)
1:00-2:20pm

Percy's Open OH
2:30-3:00pm

Project Final Report due
Logic HW due Dorsa's Open OH
11:00-11:30am

Homework Party
5:00-7:00pm
Homework Party
4:00-6:00pm
Homework Party
10:00am-12:00pm