日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

矩阵乘法如何去逆矩阵_矩阵乘法和求逆

發(fā)布時(shí)間:2023/12/15 编程问答 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 矩阵乘法如何去逆矩阵_矩阵乘法和求逆 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

矩陣乘法如何去逆矩陣

數(shù)據(jù)科學(xué)與機(jī)器學(xué)習(xí)的線性代數(shù) (LINEAR ALGEBRA FOR DATA SCIENCE AND MACHINE LEARNING)

We are going to treat two of the most used calculations for matrices, multiplications, and inversion, let’s start with multiplication and how to do it in distinct ways.

我們將處理兩個(gè)最常用的矩陣,乘法和求逆計(jì)算,讓我們從乘法以及如何以不同的方式開始。

矩陣乘法 (Matrix Multiplication)

To be able to multiplicate matrices, their sizes have to be compatible, the number of rows of the first matrix has to match the number of columns of the second matrix.

為了能夠相乘矩陣,它們的大小必須兼容,第一矩陣的行數(shù)必須與第二矩陣的列數(shù)匹配。

We will run all the examples on the same two 2 by 2 matrixes:

我們將在相同的兩個(gè)2 x 2矩陣上運(yùn)行所有示例:

Base matrices to run examples, self-generated.運(yùn)行實(shí)例的基本矩陣,是自生成的。

點(diǎn)積 (Dot product)

The first way to multiplicate them is by using the dot product, that is, multiplicate every row per every column and the index that matches between the two vectors is the position of the result, let’s calculate C = A B.

將它們相乘的第一種方法是使用點(diǎn)積,即將每列的每一行相乘,并且兩個(gè)向量之間匹配的索引是結(jié)果的位置,讓我們計(jì)算C = AB

Let’s explain how to calculate c11 and c12,

讓我們解釋一下如何計(jì)算c11和c12

Dot product example, self-generated.點(diǎn)產(chǎn)品示例,自行生成。

After calculating all the dot products, using the next mathematical expression, we get the C matrix.

在計(jì)算所有點(diǎn)積之后,使用下一個(gè)數(shù)學(xué)表達(dá)式,我們得到C矩陣。

Dot product formula, self-generated.點(diǎn)積配方,自行生成。 C result, self-generated.C結(jié)果,自我生成。

向量乘法 (Vector multiplication)

As we’ve seen in the dot product, we are multiplying rows per columns, the dot product can be upgraded by using vector products, that have fastest computing times, so let’s think about matrix multiplications as vectors, where:

正如我們?cè)邳c(diǎn)積中所看到的,我們?cè)诿苛兄性黾有?#xff0c;可以使用具有最快計(jì)算時(shí)間的矢量積來(lái)升級(jí)點(diǎn)積,因此讓我們考慮將矩陣乘法作為矢量,其中:

The formula of vector product, self-generated.矢量積的公式,是自生成的。 Vector product examples, self-generated.矢量產(chǎn)品示例,自行生成。

塊乘法 (Block multiplication)

This last strategy for multiplication is not intuitive, but it ends up doing the same multiplications and getting the same results, the strategy here is to divide the matrixes into compatible submatrices for the multiplication, for example, if you have two 10 by 10 matrix, you can divide it as 4 5 by 5 matrices and do the following:

最后一種乘法策略不直觀,但最終會(huì)進(jìn)行相同的乘法并獲得相同的結(jié)果,此處的策略是將矩陣劃分為兼容的子矩陣進(jìn)行乘法運(yùn)算,例如,如果您有兩個(gè)10 x 10矩陣,您可以將其除以4 5除以5矩陣,然后執(zhí)行以下操作:

Block multiplication, self-generated.塊乘法,自生成。

矩陣求逆 (Matrix inversion)

To be reversible, a matrix has to have the same number of rows and columns and there should be no linear combination in their rows or columns.

為了可逆,矩陣必須具有相同數(shù)量的行和列,并且其行或列中不應(yīng)有線性組合。

To invert a matrix we use the following condition, which says that a matrix by the inverse of it we get the identity matrix. The identity matrix is the one that’s composed of 1 at the diagonal.

為了使矩陣求逆,我們使用以下條件,即通過(guò)逆矩陣可以得到單位矩陣。 單位矩陣是由對(duì)角線1組成的矩陣。

The easiest way to check if a matrix has no linear combinations and is invertible is calculate her determinant, if it’s 0, it’s not invertible.

檢查矩陣是否沒有線性組合并且是可逆的,最簡(jiǎn)單的方法是計(jì)算其行列式,如果為0,則表示不可逆。

To calculate the inverse, the first idea becomes use the property:

要計(jì)算逆,首先要使用屬性:

A matrix by their inverse gives the identity, self-generated.通過(guò)它們的逆矩陣可以自我生成身份。

So, we can obtain the inverse solving the equation system that we get when we multiplicate the matrices:

因此,當(dāng)矩陣相乘時(shí),我們可以獲得方程組的逆求解:

A matrix by their inverse gives the identity example, self-generated.由它們的逆矩陣給出了自我生成的身份示例。

Instead of using this method, we can get the inverse using a better strategy, following the next steps:

代替使用此方法,我們可以按照以下步驟使用更好的策略獲得逆函數(shù):

  • Create an augmented matrix adding the identity matrix a the right of A:

    創(chuàng)建一個(gè)增強(qiáng)矩陣,在A的右邊添加單位矩陣:
Augmented matrix, self-generated.增強(qiáng)矩陣,自生成。
  • Use linear combinations to get the identity matrix at the left and the resulting right matrix will be the inverse of A:

    使用線性組合在左側(cè)獲得恒等矩陣,而所得的右矩陣將為A的逆:
Getting the inverse matrix, self-generated.獲取逆矩陣,自生成。

So, the inverse is:

因此,相反是:

Inverse matrix, self-generated.逆矩陣,自生。

摘要 (Summary)

We learned how to multiplicate and invert matrices. This is the real basis of lineal algebra methods used in data science, on top of that, we will build the methods that all deep learning models use.

我們學(xué)習(xí)了如何對(duì)矩陣進(jìn)行乘法和求逆。 這是數(shù)據(jù)科學(xué)中線性代數(shù)方法的真正基礎(chǔ),最重要的是,我們將構(gòu)建所??有深度學(xué)習(xí)模型都使用的方法。

This is the fifteenth post of my particular #100daysofML, I will be publishing the advances of this challenge at GitHub, Twitter, and Medium (Adrià Serra).

這是我特別#第十五后100daysofML,我會(huì)發(fā)布在GitHub上,Twitter和中型企業(yè)(這一挑戰(zhàn)的進(jìn)步阿德里亞塞拉 )。

https://twitter.com/CrunchyML

https://twitter.com/CrunchyML

https://github.com/CrunchyPistacho/100DaysOfML

https://github.com/CrunchyPistacho/100DaysOfML

翻譯自: https://medium.com/ai-in-plain-english/matrix-multiplication-and-inversion-43f3922e74da

矩陣乘法如何去逆矩陣

總結(jié)

以上是生活随笔為你收集整理的矩阵乘法如何去逆矩阵_矩阵乘法和求逆的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。