Coder Social home page Coder Social logo

fastai / numerical-linear-algebra Goto Github PK

View Code? Open in Web Editor NEW
10.0K 367.0 2.6K 62.53 MB

Free online textbook of Jupyter notebooks for fast.ai Computational Linear Algebra course

Home Page: http://www.fast.ai/2017/07/17/num-lin-alg/

Jupyter Notebook 100.00%
numpy python linear-algebra data-science machine-learning algorithms deep-learning

numerical-linear-algebra's Introduction

Computational Linear Algebra for Coders

This course is focused on the question: How do we do matrix computations with acceptable speed and acceptable accuracy?

This course was taught in the University of San Francisco's Masters of Science in Analytics program, summer 2017 (for graduate students studying to become data scientists). The course is taught in Python with Jupyter Notebooks, using libraries such as Scikit-Learn and Numpy for most lessons, as well as Numba (a library that compiles Python to C for faster performance) and PyTorch (an alternative to Numpy for the GPU) in a few lessons.

Accompanying the notebooks is a playlist of lecture videos, available on YouTube. If you are ever confused by a lecture or it goes too quickly, check out the beginning of the next video, where I review concepts from the previous lecture, often explaining things from a new perspective or with different illustrations, and answer questions.

Getting Help

You can ask questions or share your thoughts and resources using the Computational Linear Algebra category on our fast.ai discussion forums.

Table of Contents

The following listing links to the notebooks in this repository, rendered through the nbviewer service. Topics Covered:

We start with a high level overview of some foundational concepts in numerical linear algebra.

We will use the newsgroups dataset to try to identify the topics of different posts. We use a term-document matrix that represents the frequency of the vocabulary in the documents. We factor it using NMF, and then with SVD.

Another application of SVD is to identify the people and remove the background of a surveillance video. We will cover robust PCA, which uses randomized SVD. And Randomized SVD uses the LU factorization.

Compressed sensing is critical to allowing CT scans with lower radiation-- the image can be reconstructed with less data. Here we will learn the technique and apply it to CT images.

We have applied SVD to topic modeling, background removal, and linear regression. SVD is intimately connected to the eigen decomposition, so we will now learn how to calculate eigenvalues for a large matrix. We will use DBpedia data, a large dataset of Wikipedia links, because here the principal eigenvector gives the relative importance of different Wikipedia pages (this is the basic idea of Google's PageRank algorithm). We will look at 3 different methods for calculating eigenvectors, of increasing complexity (and increasing usefulness!).


Why is this course taught in such a weird order?

This course is structured with a top-down teaching method, which is different from how most math courses operate. Typically, in a bottom-up approach, you first learn all the separate components you will be using, and then you gradually build them up into more complex structures. The problems with this are that students often lose motivation, don't have a sense of the "big picture", and don't know what they'll need.

Harvard Professor David Perkins has a book, Making Learning Whole in which he uses baseball as an analogy. We don't require kids to memorize all the rules of baseball and understand all the technical details before we let them play the game. Rather, they start playing with a just general sense of it, and then gradually learn more rules/details as time goes on.

If you took the fast.ai deep learning course, that is what we used. You can hear more about my teaching philosophy in this blog post or this talk I gave at the San Francisco Machine Learning meetup.

All that to say, don't worry if you don't understand everything at first! You're not supposed to. We will start using some "black boxes" or matrix decompositions that haven't yet been explained, and then we'll dig into the lower level details later.

To start, focus on what things DO, not what they ARE.

numerical-linear-algebra's People

Contributors

anshbansal avatar jph00 avatar killthekitten avatar racheltho avatar thomasif98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

numerical-linear-algebra's Issues

Link 403 Forbidden

In 2. Topic Modeling with NMF and SVD.ipynb document, reference to Chris Manning's book chapter on matrix factorization and LSI returns 403 .

A mistake in Video 3 on Topic Modeling + in Readme.MD

Hi Rachel,

first of all thank you for the amazing content! <3

I noticed that in the video(s) on topic modeling with SVD and NMF you talk about
Topic Frequency-Inverse Document Frequency (TF-IDF)

To my best knowledge TF-IDF stands for Term instead of Topic Frequency-Inverse Document Frequency. I thought it might be confusing for some people, so I decided to raise an issue here.

Thanks!

Best,
Aleksander

[NB-3] Empty figure and S not defined

Hi,

I noticed on Notebook 3 under SVD - Rank 1 Approximation the following:

  1. Line plt.imshow(np.reshape(M[:,140] - low_rank[:,140], dims)[50:150,100:270], cmap='gray'); will output an empty figure (likely because the dimensions are set for the full resolution images.

  2. Line plt.imshow(np.reshape(S[:,140], dims)[50:150,100:270], cmap='gray') will fail because S is undefined (likely it should be M). If using M it will also output an empty figure, probably for the same reason above.

missing /data folder in notebooks

First of all, thank you very much @racheltho for making this course publicly available. The materials are fantastic and everything is beautifully explained. I like it very much.

I'm currently going thorugh the "Background removal with Robust PCA" notebook and I've realised the video file under data is not available in the repo: data/Video_003.avi

If anyone knows about an alternative location to find this video I'm happy to make a pull request to bring that into this repo.

Client used for viewing Jupyternotebook?

What type of client are you using in your videos to view your jupyter notebooks? Is that a new version of Jupyter Labs? I have not seen that before, and it looks much cleaner than prior jupyter notebooks I have used. Thanks.

missing requirements.txt file

Hi Team,

Since most of the developers still use pip, should we add a requirements file present to install all the required libraries at once. sometimes when I am in the middle of the lectures on youtube, I have to pause the lecture and get the libraries installed. This disturbs the flow of learning.

Will be willing to do a commit for this.

Thanks,
Harshul

where is `pool8`?

For nbs/convolution-intro.ipynb there is no prior definition to the usage of pool8?

Question mark in notebook name causing issues on Windows.

When attempting to clone the repository in Windows 10, I get an error:

$ git clone https://github.com/fastai/numerical-linear-algebra.git
Cloning into 'numerical-linear-algebra'...
remote: Counting objects: 300, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 300 (delta 0), reused 2 (delta 0), pack-reused 295
Receiving objects: 100% (300/300), 62.56 MiB | 5.06 MiB/s, done.
Resolving deltas: 100% (97/97), done.
**error: unable to create file nbs/1. Why are we here?.ipynb: Invalid argument**
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

When attempting to download the repository as a zip file using the "clone or download" button in github, the Windows Exporer built-in zip browser does not show notebook one. This appears to be caused by the '?' in the file name.

The work around for this issue it to use a command line zip tool to extract the notebook and rename it.

$ unzip -p "numerical-linear-algebra-master/nbs/1. Why are we here?.ipynb" > "1. why are we here.ipynb"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.