Introduction to Convex Optimization

10-425 + 10-625, Fall 2023
School of Computer Science
Carnegie Mellon University


Syllabus

Course Info

1. Course Description

As machine learning grows in prominence, so also has optimization become a mainstay for machine learning, particularly techniques for convex optimization. Most learning problems are formulated as optimization of some objective function, sometimes subject to constraints. This course explores the optimization algorithms used to solve these machine learning problems. We characterize the properties of the optimization problems that enable these techniques to be efficient (e.g. convexity, smoothness, linearity, separability) as well as properties that inhibit efficient optimization (e.g. nonconvexity). Core topics include first order methods (gradient descent, subgradient methods, proximal and stochastic gradient descent), duality and linear programming, and second-order/quasi-Newton methods. We also consider advanced techniques ranging from those that have spurred the growth of deep learning (e.g. adaptive gradient methods, momentum) and those that enable large-scale distributed optimization. The course will focus both on theory and practical applications, frequently drawing motivation from examples in machine learning. The course is designed so that a machine learning (ML) course could be taken after or before this one; ML is not a prerequisite. Students will gain the tools to both implement and analyze modern optimization techniques.

Learning Outcomes:

Upon completion of the course, students should be able to…

  • Identify key properties of functions, including convexity, smoothness, sparsity, etc.
  • Recast optimization problems in canonical forms.
  • Select an appropriate optimization algorithm for a given problem.
  • Implement optimization algorithms for first-order unconstrained optimization, such as gradient descent, stochastic gradient descent, proximal gradient, subgradient descent, mirror descent.
  • Leverage duality to efficiently solve optimization problems with special structure.
  • Implement advanced optimization techniques, such as adaptive gradient methods, momentum, quasi-newton methods.
  • Deploy parallel / distributed optimization algorithms on large scale problems.
  • Use optimization software packages to efficiently compute solutions.
  • Explain the relevance of optimization techniques to machine learning problems.
  • Analyze the theoretical properties of optimization algorithms under assumptions about problem structure.

For more details about topics covered, see the Schedule page.

2. Prerequisites

Students entering the class are expected to have a pre-existing working knowledge of the following:

  1. Linear algebra: (21241 or 21240 or 21242 or 21341)
  2. Probability: (36217 or 36218 or 36219 or 15259 or 15359 or 21325 or 36225 or 36235)
  3. Calc in 3D / Gradients: (21254 or 21256 or 21259 or 21268 or 10301 or 10315 or 11485)
  4. Proof techniques: (21127 or 21128 or 15151)
  5. Intermediate programming: (15122)

(Note: We hit the registrar’s maximum character limit for prereqs. They were asked last year to increase this limit, but still have not. So at present we have left out 21128 as a possible path to entry in the registrar’s system.)

You must strictly adhere to these pre-requisites! Even if CMU’s registration system does not prevent you from registering for this course, it is still your responsibility to make sure you have all of these prerequisites before you register.

The core content of this course does not exactly follow this textbook, but it’s a great resource and available for free online.

Other good textbooks (free online through CMU libraries):

4. Course Components

Grading

The requirements of this course consist of participating in lectures, quizzes, exams, homework assignments, and a project. The grading breakdown differs for 10-425 and 10-625. The courses are identical in their content, except that students in 10-625 will also do HW625.

10-425:

  • 40% Homework Assignments (4 total)
  • 10% In-class Quizzes (5 total, but we drop your lowest)
  • 20% In-class Exam (1 total)
  • 25% Project
  • 5% Participation
  • On Piazza, the Top Student “Endorsed Answer” Answerers can earn bonus points

10-625:

  • 40% Homework Assignments (5 total)
  • 10% In-class Quizzes (5 total, but we drop your lowest)
  • 20% In-class Exam (1 total)
  • 25% Project
  • 5% Participation
  • On Piazza, the Top Student “Endorsed Answer” Answerers can earn bonus points

In addition to HW1 - HW4, students registered for 10-625 are required to complete HW625, for which they will read a recent optimization paper and create a (short) presentation explaining the technique and contrasting it with other methods explored in this course.

Grade cutoffs:

  • ≥ 97% A+
  • ≥ 93% A
  • ≥ 90% A-
  • ≥ 87% B+
  • ≥ 83% B
  • ≥ 80% B-
  • ≥ 77% C+
  • ≥ 73% C
  • ≥ 70% C-
  • ≥ 67% D+
  • ≥ 63% D
  • otherwise R

Each individual component (e.g. an exam) may be curved upwards at the end. As well, the cutoffs above are merely an upper bound, at the end they may be adjusted down. We expect that the number of students that receive A’s (including A+, A, A-) is at least half the number of students that take the midterm exam(s). The number of B’s (including B+, B, B-) will be at least two-thirds the number of A’s.

Quizzes

Unless otherwise noted, all quizzes are closed-book.

You are required to attend all quizzes. All quizzes will take place in-class on either Monday, Wednesday, or Friday. The exact dates are announced on the course schedule.

The quizzes are intended to be a low-stakes assessment, as compared to the exam. As such, when computing your final average quiz grade, we will drop your lowest quiz.

Exams

Unless otherwise noted, all exams are closed-book.

You are required to attend the exam. The exam will be given in class and the exact date announced on the course schedule.

If you have an unavoidable conflict with an exam (e.g. an exam in another course), notify us by filling out “exam conflict” form. These Exam Conflict Forms are announced on Piazza before each exam.

If your conflict is with an exam in another course, please promptly email the following people to let them know of the exam conflict:

  • the instructor(s) for this course
  • the education associate(s) for this course
  • the instructor(s) for the other course

In the case of exam conflicts, we will discuss with the other course and suggest a resolution. One possible resolution is that we will accommodate you and will ask you to fill out the exam conflict form above. Please note that email should ONLY be used to address conflicts with an exam in another course. The definition of a final exam conflict and the standard procedures are described here: https://www.cmu.edu/hub/registrar/exams-and-grading/conflict-guidelines.html

Homework

There will be several assignments for 10-425 (and one additional assignments for 10-625 only). The assignments focus on both the theory and application of the covered optimization techniques. They contain both written questions and programming. Written portions ask students to analyze why the algorithms work as they do. The programming portions will both (a) ask students to implement basic algorithms from scratch and (b) apply convex optimization libraries to real world problems in machine learning.

Your solutions to the programming questions must be written in Python.

More details are listed on the Coursework page.

Project

The course project affords an opportunity to apply optimization to a large scale machine learning problem in your domain of interest. The work will be completed in the last 4 weeks of the course, written up in a report, and presented at the poster session, which will be held during finals week.

The project may be completed individually or in a team of two. More details are listed on the Coursework page.

Participation

Your participation grade in the course will come from activities related to the project and occassional surveys/polls.

Lectures

Attendance at lectures is expected. Lectures will be livestreamed and recorded for later viewing, but (because we don’t have a professional videographer) the recording may be of poor quality or technical difficulties could result in no video recording at all.

Recitations

Reciations will be on Fridays.

Attedance at recitations is required whenever there is a quiz scheduled for that day; otherwise attendance is not required, but strongly encouraged.

These sessions will be interactive and focus on problem solving. The recitations will be recorded for later viewing, but we strongly encourage you to actively participate. A problem sheet will usually be released prior to the recitation. If you are unable to attend one or you missed an important detail, feel free to stop by office hours to ask the TAs about the content that was covered. Of course, we also encourage you to exchange notes with your peers.

Office Hours

The schedule for Office Hours will always appear on the Google Calendar on the Office Hours page.

5. Technologies

We use a variety of technologies:

Piazza

We will use Piazza for all course discussion. Questions about homeworks, course content, logistics, etc. should all be directed to Piazza. If you have a question, chances are several others had the same question. By posting your question publicly on Piazza, the course staff can answer once and everyone benefits. If you have a private question, you should also use Piazza as it will likely receive a faster response.

Gradescope

We use Gradescope to collect PDF submissions of open-ended questions on the homework (e.g. mathematical derivations, plots, short answers). The course staff will manually grade your submission, and you’ll receive personalized feedback explaining your final marks.

You will also submit your code for programming questions on the homework to Gradescope. In general, your code will not be evaluated by an autograder, but you are still required to submit it.

In some cases, upon uploading your PDF, Gradescope will ask you to identify which page(s) contains your solution for each problem – this is a great way to double check that you haven’t left anything out.

Regrade Requests: If you believe an error was made during manual grading, you’ll be able to submit a regrade request on Gradescope. For each homework, regrade requests will be open for only 1 week after the grades have been published. This is to encourage you to check the feedback you’ve received early!

Zoom

Lectures and recitations will be livestreamed via Zoom.

Panopto

Lecture and recitation video recordings will be available on Panopto.

Cloud Storage

According to SquareTrade, one in three laptops fail over three years. That means your laptop is about to malfunction, perhaps catastrophically. As such, all of your work for this class must be backed up in the cloud. For example, everyone at CMU has unlimited storage on Google Drive and so your code can be backed up there. If you do your writeups in Overleaf, you’re already set. But, if you use a tablet, make sure your app is backing up your inked PDF. If you do your work on physical paper, snap an occasional (cloud stored) photo of it.

6. General Policies

Late homework policy

Late homework submissions are only eligible for 75% of the points the first day (24-hour period) after the deadline, 50% the second, and 25% the third.

You receive 6 total grace days for use on any homework assignment. We will automatically keep a tally of these grace days for you; they will be applied greedily. No assignment will be accepted more than 3 days after the deadline. This has two important implications: (1) you may not use more than 3 graces days on any single assignment (2) you may not combine grace days with the late policy above to submit more than 3 days late.

All homework submissions are electronic (see Technologies section below). As such, lateness will be determined by the latest timestamp of any part of your submission. For example, suppose the homework requires two submission uploads – if you submit the first upload on time but the second upload 1 minute late, you entire homework will be penalized for the full 24-hour period.

Late Policy for Project Deliverables

Project deliverables submitted late will still receive partial credit as follows:

  • 1 day late: 90% credit
  • 2 days late: 75% credit
  • 3 days late: 55% credit
  • 4 days late: 30% credit
  • 5 days late: 0% credit

You may not use grace days for project deliverables.

Extensions

In general, we do not grant extensions on assignments. There are several exceptions:

  • Medical Emergencies: If you are sick and unable to complete an assignment or attend class, please go to University Health Services. For minor illnesses, we expect grace days or our late penalties to provide sufficient accommodation. For medical emergencies (e.g. prolonged hospitalization), students may request an extension afterwards.
  • Family/Personal Emergencies: If you have a family emergency (e.g. death in the family) or a personal emergency (e.g. mental health crisis), please contact your academic adviser and/or Counseling and Psychological Services (CaPS).
  • University-Approved Travel: If you are traveling out-of-town to a university approved event or an academic conference, you may request an extension for any time lost due to traveling. For university approved absences, you must provide confirmation of attendance, usually from a faculty or staff organizer of the event or via travel/conference receipts.

For any of the above situations, you may request an extension by emailing the Education Associate(s) at TBD – do not email the instructor or TAs. Please be specific about which assessment(s) you are requesting an extension for and the number of hours requested. The email should be sent as soon as you are aware of the conflict and at least 5 days prior to the deadline. In the case of an emergency, no notice is needed.

If this is a medical emergency or mental health crisis, you must also CC your CMU College Liaison and your academic advisor. Do not submit any medical documentation to the course staff. If necessary, your College Liaison and The Division of Student Affairs (DoSA) will request such documentation and they will view the health documentation and conclude whether a retroactive extension is appropriate. (If you haven’t interacted with your college liaison before, they are experienced Student Affairs staff who work in partnership with students, housefellows, advisors, faculty, and associate deans in each college to assure support for students regarding their overall Carnegie Mellon experience.)

Audit Policy

Formal auditing of this course is permitted. However, we give priority to students taking the course for a letter grade.

You must follow the official procedures for a Course Audit as outlined by the HUB / registrar. Please do not email the instructor requesting permission to audit. Instead, you should first register for the appropriate section. Next fill out the Course Audit Approval form.

Auditors are required to:

  1. Attend or watch all of the lectures.
  2. Submit at least 2 of the 5 homework assignments.

Auditors are encouraged to sit for the quizzes and exams, but should only do so if they plan to put forth actual effort in solving them.

Pass/Fail Policy

We allow you take the course as Pass/Fail. Instructor permission is not required. What letter grade is the cutoff for a Pass will depend on your specific program; we do not specify whether or not you Pass but rather we compute your letter grade the same as everyone else in the class (i.e. using the cutoffs listed above) and your program converts that letter grade to a Pass or Fail depending on their cutoff. Be sure to check with your program / department as to whether you can count a Pass/Fail course towards your degree requirements.

Accommodations for Students with Disabilities:

If you have a disability and have an accommodations letter from the Disability Resources office, please email the Education Associate(s) at TBD requesting to set up a meeting with them to discuss your accommodations and needs as early in the semester as possible. The EAs will work with you to ensure that accommodations are provided as appropriate. If you suspect that you may have a disability and would benefit from accommodations but are not yet registered with the Office of Disability Resources, I encourage you to contact them at access@andrew.cmu.edu.

7. Collaboration and Academic Integrity Policies

Read this carefully!

Collaboration among Students

The purpose of student collaboration is to facilitate learning, not to circumvent it. Towards that end, we strongly encourage collaboration. All collaboration must adhere to the following requirements.

When collaborating on a written problem from the homework:

  1. You are not permitted to show a paper copy or electronic version of your final or partial solution to another student taking the course (e.g. handwritten solution on paper, PDF of your homework, Overleaf).
  2. Instead, you must discuss the problem at a whiteboard or chalkboard. If your discussion leads to a solution, that is fine so long as an effort has been made to ensure everyone in the discussion understands the solution. If you need to consult your notes during the discussion, you should step away from the whiteboard to do so.
  3. You may take notes (handwritten or typed) after you complete your discussion at the whiteboard, but you should not share those notes with each other (since it would violate rule 1 above).

When collaborating on a programming problem from the homework:

  1. You should never have two laptops open side-by-side. You are not permitted to copy someone’s code directly.
  2. You are welcome to have a discussion around one person’s code (your own, or your collaborators) so long as only one laptop is open during your discussion. In this way, we encourage you to help each other find bugs, provide high-level suggestions on code structure, or even discuss fine-grained aspects of one person’s implementation.
  3. You are welcome to take notes after you complete your discussion. But you should not be taking notes while looking at someone else’s code since you risk violating rule 1 above.

When collaborating on any type of problem for the homework:

  1. You must exchange names with your collaborator, so that you can note that you worked together on a specific problem in the “Collaboration Questions” at the end of each homework assignment. If you collaborated with someone at office hours, but missed their name note this in the “Collaboration Questions”.
  2. If you gave help after turning in your own assignment and/or after answering the questions above, you must update your “Collaboration Question” answers by sending a private note on Piazza to the instructors.
  3. Collaboration without full disclosure will be handled severely, in compliance with CMU’s Policy on Academic Integrity.

Previously Used Assignments

Some of the homework assignments used in this class may have been used in prior versions of this class, or in classes at other institutions, or elsewhere. Solutions to them may be, or may have been, available online, or from other people or sources. It is explicitly forbidden to use any such sources, or to consult people who have solved these problems before. It is explicitly forbidden to search for these problems or their solutions on the internet.

(Collaboration with other students who are currently taking the class is allowed, but only under the conditions stated above.)

AI Assistance

To best support your own learning, you should complete all graded assignments in this course yourself, without any use of generative artificial intelligence (AI), such as ChatGPT. Please refrain from using AI tools to generate any content (text, video, audio, images, code, etc.) for an assessment. Passing off any AI generated content as your own (e.g., cutting and pasting content into written assignments, or paraphrasing AI content) constitutes a violation of CMU’s academic integrity policy.

(Instead of regurgitating the output of a machine, we encourage you to collaborate with your peers as stated above.)

Policy Regarding “Found Code”:

You are encouraged to read books and other instructional materials, both online and offline, to help you understand the concepts and algorithms taught in class. These materials may contain example code or pseudo code, which may help you better understand an algorithm or an implementation detail. However, when you implement your own solution to an assignment, you must put all materials aside, and write your code completely on your own, starting “from scratch”. Specifically, you may not use any code you found or came across. If you find or come across code that implements any part of your assignment, you must disclose this fact in your collaboration statement.

Duty to Protect One’s Work

To protect current and future students, do not post your solutions publicly, neither during the course nor afterwards.

Penalties for Violations of Course Policies

All violations (even first one) of course policies will always be reported to the university authorities (your Department Head, Associate Dean, Dean of Student Affairs, etc.) as an official Academic Integrity Violation and will carry severe penalties.

  1. The penalty for the first violation is a negative 100% on the assignment (i.e. it would have been better to submit nothing and receive a 0%).

  2. The penalty for the second violation is failure in the course, and can even lead to dismissal from the university.

(The above policies are adapted from Roni Rosenfeld’s 10-601 Spring 2016 Course Policies.)

8. Support

Take care of yourself. Do your best to maintain a healthy lifestyle this semester by eating well, exercising, avoiding drugs and alcohol, getting enough sleep and taking some time to relax. This will help you achieve your goals and cope with stress.

All of us benefit from support during times of struggle. You are not alone. There are many helpful resources available on campus and an important part of the college experience is learning how to ask for help. Asking for support sooner rather than later is often helpful.

If you or anyone you know experiences any academic stress, difficult life events, or feelings like anxiety or depression, we strongly encourage you to seek support. Counseling and Psychological Services (CaPS) is here to help: call 412-268-2922 and visit their website at http://www.cmu.edu/counseling/. Consider reaching out to a friend, faculty or family member you trust for help getting connected to the support that can help.

If you or someone you know is feeling suicidal or in danger of self-harm, call someone immediately, day or night:

  • CaPS: 412-268-2922
  • Re:solve Crisis Network: 888-796-8226
  • If the situation is life threatening, call the police:
    • On campus: CMU Police: 412-268-2323
    • Off campus: 911.

If you have questions about this or your coursework, please let the instructors know.

9. Diversity

We must treat every individual with respect. We are diverse in many ways, and this diversity is fundamental to building and maintaining an equitable and inclusive campus community. Diversity can refer to multiple ways that we identify ourselves, including but not limited to race, color, national origin, language, sex, disability, age, sexual orientation, gender identity, religion, creed, ancestry, belief, veteran status, or genetic information. Each of these diverse identities, along with many others not mentioned here, shape the perspectives our students, faculty, and staff bring to our campus. We, at CMU, will work to promote diversity, equity and inclusion not only because diversity fuels excellence and innovation, but because we want to pursue justice. We acknowledge our imperfections while we also fully commit to the work, inside and outside of our classrooms, of building and sustaining a campus community that increasingly embraces these core values.

Each of us is responsible for creating a safer, more inclusive environment.

Unfortunately, incidents of bias or discrimination do occur, whether intentional or unintentional. They contribute to creating an unwelcoming environment for individuals and groups at the university. Therefore, the university encourages anyone who experiences or observes unfair or hostile treatment on the basis of identity to speak out for justice and support, within the moment of the incident or after the incident has passed. Anyone can share these experiences using the following resources:

  • Center for Student Diversity and Inclusion: csdi@andrew.cmu.edu, (412) 268-2150
  • Report-It online anonymous reporting platform: reportit.net username: tartans password: plaid

All reports will be documented and deliberated to determine if there should be any following actions. Regardless of incident type, the university will use all shared experiences to transform our campus climate to be more equitable and just.