GithubHelp home page GithubHelp logo

ilmoi / mml-book Goto Github PK

View Code? Open in Web Editor NEW
883.0 27.0 155.0 17.71 MB

Code / solutions for Mathematics for Machine Learning (MML Book)

Python 7.94% Jupyter Notebook 92.06%
mml-book machine-learning self-study math-for-machine-learning

mml-book's Introduction

Mathematics for Machine Learning (MML Book) - my Self Study

By folder:

Python code

Just play code I used to better understand various concepts. Mix of Gaussians was tricky in particular.

Chapter exercises solutions

Solutions to exercises for each chapter. Notebooks might take a bit of time to render all the LaTeX.

Misc

Misc:)

Knowledge is power. Share it.

mml-book's People

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

mml-book's Issues

Chapter 3 Question 5

Rank of B (made from columns of U) is 4 and not 3.

Verified using online matrix reduction calculator.

EDIT: Made a grave error, it turns out that the matrix has actually rank 3.

Chapter 5, Ex. 7, part b

The derivative df/dx is not an E x D matrix but a (D x 1)-dimensional vector.
z = Ax + b and therefore Ax is a (E x D) * (D x 1) product -> E x 1 (also after adding up vector b and take the cos() of each component).
We transpose it in a (1 x E)-dimensional vector indeed (this is the gradient of f respect to z vector).
Later, we multiply it with matrix A (dz/dx gradient) -> (1 x E) * (E x D) -> 1 x D and take the transpose -> D x 1.
Now the dimension of the gradient df/dx mathes with the dimension of the input vector x (D x 1).

Exercise 6.2 part c

In my opinion there is one too many conditions regarding the search for the local maximum of the bivariate Guassian p(x, y). In fact it would not be enough to impose the Hessian determinant of p (x, y) to be > 0, and, using Sylvester's criterion, to impose the top left entry (of the Hessian) to be < 0 too to have the guarantee that both eigenvalues ​​of 'Hessian are negative (ie local maximum condition).
Therefore the condition for which the second derivative of p with respect to y is < 0 is too many.

For more info:
https://math.stackexchange.com/questions/1985889/why-how-does-the-determinant-of-the-hessian-matrix-combined-with-the-2nd-deriva

Chapter 5 Question 6

First of all, thanks for your solution sheet!

For 5.6, I believe d(g)/d(X) =ATBT. Because A is DxE, and B is FxD. ATBT is valid, while BTAT is not.

chapter 2,Q9

Q: A = {(λ, λ + µ3, λ − µ3) | λ, µ ∈ R}
A: This has a basis of {(1,1,1)T,(0,1,−1)T}, so it is a subspace of R3.

Hi, could you explain this or give me some reference? Why we can say V has a basis of xxx, so it is a subspace of R3?

Chapter 2 Question 3

Thanks for the solutions,
I believe that your matrices are have the variables defined in the wrong order.

You have them defined as

1 x y
0 1 z
0 0 0

Whereas the book has them defined as

1 x z
0 1 y
0 0 0

Problem 5.6

Going by property 5.100, shouldn't the answer be

Btw, thank you for making these solutions available.

Chapter 2 Question 12 / Help

For my understanding:
The Intersection of U1 and U2 has only one independent column. Let's call the combination of the matrices V.
Therefore av1+...av6 can be reduced by a singel linear combination a*v?

I understand that because dim(U1)=2 and dim(U2) we can set 0=a1v1+a2v2-a4v4-a5v5

Then the solution says v1,v2,v4 are linearly independent and we can set a5 to any number e.g. 9.

How does the augmented matrix look like to solve for v?

                                         | a1
                           ?            | a2
                                         | a4
                                         | 9

Chapter 2 question 17

I believe the 2nd to last line should be....= {(3x1 + 2x2 + x3 The x3 you have as x1

Exercise 6.13

While the solution is correct, I feel a more concise solution can be provided:

Thus, Y is uniformly distributed.

Problem 2.5 a

Perhaps you can help me with my confusion about this problem. It appears in the r2-2r1 step, your solution accidentally performed -A24-2A14 to get a value of -3 for A24 instead of A24-2A14 to get a 7 for A24. I don't think the correct solution is not an empty solution set. There are four equations and four unknowns and the solution is [x1 x2 x3 x4]T = [26/15 -13/30 2/5 -1/10]T. Am I thinking about this the wrong way?

Exercise 6.5 part b

I think that in each part (1,2,3) of this exercise the conditional component is not considered.
For example in the first, you considered p(x(t+1)) = p(x(t+1) | y1, ... , yt), but the knowledge of y1, ... , yt influences the density of x(t+1) since x(t+1) depends on y(t) (y(t) influences x(t) which in turn influences x(t+1)) and so on...
I think that you should use the formula of conditional Gaussian to compute p(x(t+1) | y1, ... , yt) since both x(t+1) and y1, ... , yt are Gaussian multivariate densities.

Chapter 2 - Question 3 Inverse Element

I'm not 100% sure but I believe the value for y_2 is incorrect.
It should be: y_2 = x_1*z_2 - y_1

Note: Thanks for making this repo! it's a great help.

Chapter 5, Ex. 9

Hi,

For problem #9 in chapter 5, I think there is currently a missing partial with respect to v when computing dq/dv. Essentially, I believe this should be

dq/dv = aq/az * az/av + aq/av * dv/dv = aq/az * az/av + aq/av

the solution currently does not include this last term aq/av. (Note that "a" was used throughout to denote partial derivative.)

Chapter 6 Excercise 10

Hi @ilmoi, firstly, thanks for this incredible work. It as helped me so much. While solving Question 10 in Chapter 6. I came across an abnormality in your calculations for its solution.

Capture d’écran 2021-05-27 011330

I think that in places where I put an exclamation mark, there is supposed to be a power to -1 if we expand the bracket correctly. Furthermore, I maybe wrong, or missing the point somewhere. This is why, it would be really helpful for me if anybody could help me solve this issue.

Thanks.

Chapter 5, question 5 part c

Hi, thank you for the solutions. This is super minor, but I thought I'd point it out anyway. I was wondering if for question 5 part c in Chapter 5 it should say "It's first column consists of" instead of "it's first row consists of" when talking about the Jacobian since we've already established the dimension would be n^2 * n and so it could only be every column that has n^2 entries.

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.