Foundations of artificial intelligence

ME-390

Media

This file is part of the content downloaded from Foundations of artificial intelligence.

Course information

Course format

In-person lectures, in-person exercise hours. 

Assessment

2 in-person quizzes, during exercise hour 10% each, one programming assignment 10%, one end of semester written final exam (70%). The quiz and assignment grades are counted if they help your final grade. So, your final grade is calculated as follows:

final grade = max(70% final + 10% q1 + 10% q2 + 10% a1, 80% final + 10% q1 + 10% q2, ..., 100% final)

Above, q1,q2, refer to quizzes 1, 2, and and a1 refers to assignment 1. It follows that your final grade is the maximum among 8 possible combination of quiz grades, assignment grade and the final exam grade. 

Quizzes are on 15.10, 26.11 during the exercise hour. They are 20 minutes and no aid is allowed (no books/notes, no electronics). The assignment should be handed in by 17.12. 

The final exam is closed-book. You are allowed one printed cheatsheet, where you can use a double-sided page to write any material from the course.

Teaching assistants

  • Anna Maddux (anna.maddux@epfl.ch)
  • Tingting Ni (tingting.ni@epfl.ch)
  • Philip Jordan (philip.jordan@epfl.ch)
  • Kai Ren (kai.ren@epfl.ch)
  • Giulio Salizzoni (giulio.salizzoni@epfl.ch)
  • Gabriel Vallat (gabriel.vallat@epfl.ch)
  • Saurabh Dilip Vaishampayan (saurabh.vaishampayan@epfl.ch)
You have questions?  We answer your questions during lecture, lecture breaks, exercise hours or on Ed Discussion.  

Recommended but not required references

There are many resources online on artificial intelligence and machine learning. While these sources might provide a good intuition, not all have the same depth and rigour. I recommend the following. 

1. Book: on machine learning with engineering applications: Machine Learning for Engineers, Using Data to Solve Problems for Physical Systems by Ryan G. McClarren. We refer to it as ML4Engineers in the course

2. Book: with relevant linear algebra background for the course, referred here as LinAlgebra book: Introduction to Applied Linear Algebra – Vectors, Matrices, and Least Squares

3. Online book: with a good overview of probability

4. Book: with a deep mathematical treatment of the subject: Understanding Machine Learning

5. Book: neural networks: Deep Learning

6. Online course: The machine learning course at Stanford, referred here as MLStanford: EE 104, Stanford 

7. Online course: The machine learning and data mining course at UBC: CPSC 340, UBC

8. Online videos: StatQuest!!!: This website has several very easy to follow youtube videos on most of the concepts we cover in the course.

Note: While some books, lectures and videos are on the same topic we have discussed, the notations and terminology can be different. The difference in terminology is sometimes due to the fact that same concepts are discussed in statistics, mathematics, engineering and machine learning. Each of these communities might have chosen their set of terms and notations. 

Acknowledgement

The lecture notes are inspired by the EPFL Course, CIVIL-226 created by the Vita lab



Summary: We introduced the course and the administrative matters of the course. We introduced artificial intelligence (AI) and the machine learning (ML) approach to AI. We defined supervised learning and unsupervised learning, and introduced linear regression as a supervised learning approach. 

Exercise hour: For python exercises, we will go through 00, 01 and 02 from Preparation-exercises. For course notes, you can ask questions about the "Background and notations" file. 

Optional: For a thorough introduction to learning you can read Sections 1.1-1.3 of the UnderstandingML book. 


Summary: We defined the loss function for linear regression and reviewed concepts from unconstrained optimization: convexity, gradient and Hessian of a scalar-valued function, positive semi-definiteness of a matrix, and gradient-descent algorithm. We also discussed overfitting/underfitting and went over the rational for regularized loss function to address overfitting. Lastly, we discussed train, validate, test sets in machine learning for training and setting the hyper-parameters of the mode. 

Review of gradient and Hessian: for deriving gradient and Hessian of affine and quadratic functions, please see the here

Python: For looking up some python commands and comparison of the commands with matlab, you may use the following cheat sheet.



We had no lecture (due to holiday). You have a problem set for Wednesday on the theory covered so far in the book. The problem sets help you prepare for quizzes and final exam. During the exercise hour, you may ask questions about the problem set or about the linear regression python exercise from last week. 

We presented logistic regression for classification, and discussed the logistic loss function both in binary classification and multinomial classification. We provided interpretation in terms of the cross-entropy. Lastly, we discussed the performance metrics in terms of the confusion matrix.

Additional resources: Sections 2.3 and 2.4 up to 2.4.2 of the ML4Engineers book and pages 45,46 (norms) and 48, 49, 50 of the LinAlgebra book



We discussed data processing before doing the machine learning approach including approaches to understand the features of data using summary statistics, as well as normalization, scaling, and nonlinear feature engineering. We also introduced neural networks. 

Additional resources: Chapter 5, Sections 5.1, 5.2 from ML4Engineers book, Chapter 20, Sections 20.1, 20.2, 20.3 from Understanding Machine Learning book. 


We discussed training of neural networks using gradient descent (and stochastic, mini-batch gradient descent). We introduced convolutional neural networks for image processing. 

Additional reading: Chapters 5, and 6 ofML4Engineers book. For transfer learning, see the case study in 6.5 of ML4Engineers book

Note: there was a problem with projection and lecture recording in the first hour, so hour 1 has only 12 minutes of lecture recording. 

Typo: on sldie 22, the first index of x should be i-1.


EPFL fall break. We had a break from lecture and exercise hour. If you have not done python exercises on neural networks and convolutional neural networks, you are welcome to do them this week. 


We had an interactive hour on Conditions for AI to benefit humanity. To moderate this hour, we had a guest lecturer Professor Sascha Nick. In the second hour, we introduced discrete-time dynamical systems as a background for our lecture on reinforcement learning. 

Additional resources: Utop'IA graphic novel for our discussion on conditions for AI to benefit humanity.


We defined a Markov decision process and the reward maximization problem considered in reinforcement learning. We introduced policy parameterization and policy gradient approach to reinforcement learning. 


We completed our discussion on policy gradient in reinforcement learning, and went through a small example where you could compute the gradients by hand. We introduced recurrent neural networks for time-series prediction, and discuss their training. We saw an example of their application in auto-complete. 

Additional resources: Chapter 7 up to Section 7.2 of ML4Engineers book on recurrent neural networks.


We discussed recurrent neural network training and saw the issue with gradient vanishing/explosion through a simple example. 
We presented Naive Bayes probabilistic classification approach. 

We reviewed reinforcement learning (estimating policy gradient from trajectory samples) and recurrent neural networks for time-series prediction. 

Next, we discussed k-nearest neighbor approach for classification and regression. 

Note: this week during the exercise hour you will have a quiz (optional - see grading on the front page of Moodle). You will do the k-nearest neighbor python exercise next week during the exercise hour. 


We started the topic of unsupervised learning. We discussed dimensionality reduction, and the principal component analysis approach to learning a lower dimensional subspace on which the data approximately lies. We discussed its application to text processing. Furthermore, we discussed autoencoders as a nonlinear approach to dimensionality reduction. 

Exercises this week: python codes on kNN and PCA. 


We continued our discussion on dimensionality reduction and presented an overview of autoencoders as an approach to reduce dimension to a possibility nonlinear subspace of the original data space. We then presented the topic of clustering and discussed the K-means approach to clustering. We ended by giving an overview of kernelized k-means in case the decision boundaries between clusters is nonlinear. 


16 December - 22 December


Practice final exams

Last year exam and another sample final, both with solutions, are posted. Recommendation: first try to solve the problems without looking at the solutions. Then, check your work in detail by looking at the solutions.