Göm meny

TATA53 Course Materials


Assignments

Information on deadlines and how to hand in the assignments are found in the respective document. After each deadline you need to attend one of the two associated seminars, and you should be ready to present your solutions in front of the class.

Grading: To pass the course you need a score of at least 60% on each of the four assignment. An assignment total of 60%/75%/85% corresponds to grade 3/4/5. For grade 5 some presentations of the harder problems are also required. If your total score exceeds 85% at the end of the course and you aim for grade 5, but you haven't had enough opportunity to make presentations, we will arrange som additional opportunity for this. If you hand in an assignment late or get less than 60% on an assignment, there will be some opportunity for making complements, but only for reaching the 60% score.

Slides

  • Slides from Lecture 1
    Basic course information and overview of the course contents.

  • Slides from Lecture 13
    About data-analysis with SVD, an example of movie ratings and an example about facial recognition of math-department faces. The section on total least squares at the end will be covered in lecture 14. See the lecture notes for more details on the same material.

Code

  • LU.py
    The example from lecture 2 on LU-decomposition, comparing the speed of solving AX=b compared to solving two triangular systems L(UX)=b.
  • lights.py and lights_2d.py
    Interactive version of the light-puzzle, and for fun, a corresponding 2d-version.
  • matrix_mult.py
    Short script to compute SJS^{-1}, good for verifying answers related to Jordan forms.
  • jordan.py
    Uses sympy to find a Jordan decomposition A=SJS^{-1}. Remember that a complete solution is required on the assignments, so just writing an answer typically gives 0p. Also note that there are many options for the matrix S, it is not unique.
  • voronoi.py
    Visualizes how different p-norms affect how distances are measured in the plane by drawing an interactive Voronoi-diagrams.
  • perron.py
    Illustrates Perron's theorem by finding eigenvalues and eigenvectors of a randomly generated positive matrix.
  • page_rank.py
    Illustrates how PageRank works in an interactive graph. Add nodes by right clicking and add arrows by left-dragging between node centers. The program shows how the PageRank of the nodes depends on the graphs structure.
  • markov_sim.py
    Simulates the weather-Markov process from the lecture, transitions between the the three states according to the probabilities of the transition-matrix, and prints the total number of visits to each state.
  • power_method.py
    Uses the power method to find the Perron-vector of a matrix, modify the number of iterations to see how quick it converges.
  • SVD.py
    Uses numpy to find a singular value decomposition (SVD) and compact SVD of a matrix. Note that this is done numerically, so the output is an approximation. Noise in the matrix or rounding errors can change the rank of the matrix which changes the sizes of matrices in the compact SVD.
  • low_rank_image.py and low_rank_image_col.py
    Image compression example. Takes an image, converts it to grayscale, applies SVD, and produces low rank approximation. In the second file this is done for each color channel separately. In the lecture I used this image, put it in the same directory as the .py files (or use your own image by changing the filename to load in the script).
  • low_rank_webcam.py
    Interactive image compression of your webcam feed using low rank approximation via SVD, you can toggle color-mode and change the rank with the c/+/- keys, see the text in the top of the file.



Sidansvarig: jonathan.nilsson@liu.se
Senast uppdaterad: 2024-04-22