Skip to content

Python & Matlab code for the figures from the book "Learning Theory from First Principles" by Francis Bach

Notifications You must be signed in to change notification settings

khiem2105/Learning_Theory_from_First_Principles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning Theory from First Principles

Python & Matlab code for the figures from the book "Learning Theory from First Principles" by Francis Bach (in preparation)

See available draft of the book here.

Contributors :

  • Matlab Figures : Francis Bach
  • Reproduction in Python : Maria Bastiani, Gabriel Fiastre, Shane Hoeberichts, Camille Leempoels, Berné Nortier

Table of Contents

To Do | Contribution guidelines | Python code | Matlab code

To Do

Figures still to be done in python :

  • Figure 5.3
  • Figure 7.3
  • Figure 8.2
  • Figures 9.1, 9.2

Contribution Guidelines

You can edit the python notebooks to reproduce missing figures (they are all done in Matlab, but a couple of them are not reproduced in python yet, see To Do)

Make sure you have a Github account and git installed on your local machine.

0. Contact Me

Contact me before so we can discuss any potential contribution, what is needed etc.

1. Fork the repository & clone it

Go to the repository page & click on the "Fork" button in the top-right corner of the page. This creates a personal copy of the repository under your GitHub account.

After creating your personnal copy, you can clone the repository :

git clone https://github.com/your-username/Learning_Theory_from_First_Principles/
cd Learning_Theory_from_First_Principles/

Replace your-username with your Github username.

2. Make changes, commit & push

When you are satisfied with your changes, you can commit and push them. Please use a descriptive commit message.

git add . && git commit -am "<Your commit description>" && git push

3. Create a pull request

Once you are done with all your changes and would like to submit your contribution to the main repository, you can open a Pull Request

  • Visit your fork on GitHub.
  • Click on the "Compare & pull request" button.
  • Provide a meaningful title and description for your pull request (e.g. "Adding missing figure fig-3-2")
  • Click on the "Create pull request" button.

Python Code

The Python code is organized into individual notebooks for each chapter :


Matlab code

Generic helper functions

Chapter 1: Mathematical preliminaries

  • Figure 1.1 (expectation of maximum of Gaussian random variables)

Chapter 2: Introduction to supervised learning

  • Figure 2.1 (polynomial regression with increasing orders - predictions)
  • Figure 2.2 (polynomial regression with increasing orders - errors)

Chapter 3: Linear least-squares regression

  • Figure 3.1 (polynomial regression with varying number of observations)
  • Figure 3.2 (convergence rate for polynomial regression)
  • Figure 3.3 (polynomial ridge regression)

Chapter 4: Empirical risk minimization

  • Figure 4.1 (convex surrogates)
  • Figure 4.2 (optimal score functions for Gaussian class-conditional densities)

Chapter 5: Optimization

  • Figure 5.1 (gradient descent on two least-squares problems)
  • Figure 5.2 (comparison of step-sizes for SGD for the support vector machine)
  • Figure 5.3 (comparison of step-sizes for SGD for logistic regression)

Chapter 6: Local averaging methods

Chapter 7: Kernel methods

Chapter 8: Sparse methods

Chapter 9: Neural networks

About

Python & Matlab code for the figures from the book "Learning Theory from First Principles" by Francis Bach

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 98.8%
  • MATLAB 1.2%