矩阵乘法如何去逆矩阵

数据科学与机器学习的线性代数 (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.

我们将处理两个最常用的矩阵,乘法和求逆计算,让我们从乘法以及如何以不同的方式开始。

矩阵乘法 (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.

为了能够相乘矩阵,它们的大小必须兼容,第一矩阵的行数必须与第二矩阵的列数匹配。

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

我们将在相同的两个2 x 2矩阵上运行所有示例:

Base matrices to run examples, self-generated.
运行实例的基本矩阵,是自生成的。

点积 (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.

将它们相乘的第一种方法是使用点积,即将每列的每一行相乘,并且两个向量之间匹配的索引是结果的位置,让我们计算C = AB

Let’s explain how to calculate c11 and c12,

让我们解释一下如何计算c11和c12

Dot product example, self-generated.
点产品示例,自行生成。

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

在计算所有点积之后,使用下一个数学表达式,我们得到C矩阵。

Dot product formula, self-generated.
点积配方,自行生成。
C result, self-generated.
C结果,自我生成。

向量乘法 (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:

正如我们在点积中所看到的,我们在每列中增加行,可以使用具有最快计算时间的矢量积来升级点积,因此让我们考虑将矩阵乘法作为矢量,其中:

The formula of vector product, self-generated.
矢量积的公式,是自生成的。
Vector product examples, self-generated.
矢量产品示例,自行生成。

块乘法 (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:

最后一种乘法策略不直观,但最终会进行相同的乘法并获得相同的结果,此处的策略是将矩阵划分为兼容的子矩阵进行乘法运算,例如,如果您有两个10 x 10矩阵,您可以将其除以4 5除以5矩阵,然后执行以下操作:

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.

为了可逆,矩阵必须具有相同数量的行和列,并且其行或列中不应有线性组合。

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.

为了使矩阵求逆,我们使用以下条件,即通过逆矩阵可以得到单位矩阵。 单位矩阵是由对角线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.

检查矩阵是否没有线性组合并且是可逆的,最简单的方法是计算其行列式,如果为0,则表示不可逆。

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

要计算逆,首先要使用属性:

A matrix by their inverse gives the identity, self-generated.
通过它们的逆矩阵可以自我生成身份。

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

因此,当矩阵相乘时,我们可以获得方程组的逆求解:

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:

代替使用此方法,我们可以按照以下步骤使用更好的策略获得逆函数:

  • Create an augmented matrix adding the identity matrix a the right of A:创建一个增强矩阵,在A的右边添加单位矩阵:
Augmented matrix, self-generated.
增强矩阵,自生成。
  • Use linear combinations to get the identity matrix at the left and the resulting right matrix will be the inverse of A:使用线性组合在左侧获得恒等矩阵,而所得的右矩阵将为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.

我们学习了如何对矩阵进行乘法和求逆。 这是数据科学中线性代数方法的真正基础,最重要的是,我们将构建所​​有深度学习模型都使用的方法。

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,我会发布在GitHub上,Twitter和中型企业(这一挑战的进步阿德里亚塞拉 )。

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

矩阵乘法如何去逆矩阵


http://www.taodudu.cc/news/show-863439.html

相关文章:

  • 机器学习数据倾斜的解决方法_机器学习并不总是解决数据问题的方法
  • gan简介_GAN简介
  • 使用TensorFlow训练神经网络进行价格预测
  • 您应该如何改变数据科学教育
  • r语言解释回归模型的假设_模型假设-解释
  • 参考文献_参考文献:
  • 深度学习用于视频检测_视频如何用于检测您的个性?
  • 角距离恒星_恒星问卷调查的10倍机器学习生产率
  • apache beam_Apache Beam ML模型部署
  • 转正老板让你谈谈你的看法_让我们谈谈逻辑回归
  • openai-gpt_GPT-3报告存在的问题
  • 机器学习 凝聚态物理_机器学习遇到了凝聚的问题
  • 量子计算 qiskit_将Tensorflow和Qiskit集成到量子机器学习中
  • throw 烦人_烦人的简单句子聚类
  • 使用NumPy优于Python列表的优势
  • 迷你5和迷你4区别_可变大小的视频迷你批处理
  • power bi可视化表_如何使用Power BI可视化数据?
  • 变形金刚2_变形金刚(
  • 机器学习 测试_测试优先机器学习
  • azure机器学习_Microsoft Azure机器学习x Udacity —第4课笔记
  • 机器学习嵌入式实现_机器学习中的嵌入
  • 无监督学习 k-means_无监督学习-第3部分
  • linkedin爬虫_机器学习的学生和从业者的常见问题在LinkedIn上提问
  • lime 深度学习_用LIME解释机器学习预测并建立信任
  • 神经网络 梯度下降_梯度下降优化器对神经网络训练的影响
  • 深度学习实践:计算机视觉_深度学习与传统计算机视觉技术:您应该选择哪个?
  • 卷积神经网络如何解释和预测图像
  • 深度学习 正则化 正则化率_何时以及如何在深度学习中使用正则化
  • 杨超越微数据_资料来源同意:数据科学技能超越数据
  • 统计概率分布_概率统计中的重要分布

矩阵乘法如何去逆矩阵_矩阵乘法和求逆相关推荐

  1. Eigen入门系列 —— Eigen::Matrix矩阵点乘、叉乘、转置、求逆、求和、行列式、迹、数乘

    Eigen入门系列 -- Eigen::Matrix矩阵点乘.叉乘.转置.求逆.求和.行列式.迹.数乘 前言 程序说明 输出结果 代码示例 前言 随着工业自动化.智能化的不断推进,机器视觉(2D/3D ...

  2. 矩阵相乘的strassen算法_矩阵乘法的Strassen算法+动态规划算法(矩阵链相乘和硬币问题)...

    矩阵乘法的Strassen 这个算法就是在矩阵乘法中采用分治法,能够有效的提高算法的效率. 先来看看咱们在高等代数中学的普通矩阵的乘法 两个矩阵相乘 上边这种普通求解方法的复杂度为: O(n3) 也称 ...

  3. c#矩阵类的实现包括伴随矩阵求逆,初等变换求逆,矩阵的加,乘法转置等功能

    c#好像没有自带的矩阵类,而很多的算法中需要用到矩阵类,今天分享一个c#实现的矩阵类,包含了矩阵的加,乘法,转置求逆(伴随矩阵求逆:当行列式的值特别大或特别小的时候不适用.初等变换:求逆效率要高,不受 ...

  4. pytorch统计矩阵非0的个数_矩阵的三种存储方式---三元组法 行逻辑链接法 十字链表法...

    在介绍矩阵的压缩存储前,我们需要明确一个概念:对于特殊矩阵,比如对称矩阵,稀疏矩阵,上(下)三角矩阵,在数据结构中相同的数据元素只存储一个. @[TOC] 三元组顺序表 稀疏矩阵由于其自身的稀疏特性, ...

  5. python找出矩阵中的马鞍点_矩阵的马鞍点

    #include #define n 4 //马鞍点是第I行值最小第J列值最大 void maxmin(int a[n][n]) { int i,j ,flag; int max[n],min[n]; ...

  6. java如何求矩阵的置换_矩阵乘法(五):置换

    矩阵乘法在一些置换问题上有着很好的应用,特别置换次数较多时,采用矩阵快速幂运算可以加快运算过程. 任意一个置换都能够表示成矩阵的形式.比如,将序列1  2  3  4 置换为 3  1  2  4,相 ...

  7. 蓝桥杯_算法训练_矩阵乘法

    问题描述 输入两个矩阵,分别是m*s,s*n大小.输出两个矩阵相乘的结果. 输入格式 第一行,空格隔开的三个正整数m,s,n(均不超过200). 接下来m行,每行s个空格隔开的整数,表示矩阵A(i,j ...

  8. python实现矩阵叉乘_矩阵乘法的纯Python实现 | 离开Python库!!

    点击关注我哦 一篇文章带你了解矩阵乘法的纯Python实现 在<这篇文章>中,我们有简单提到"矩阵乘法"的相关知识,如果你不记得了,可以复习一下这张图片. 想起来了没? ...

  9. mysql 矩阵乘法_矩阵乘法高级操作

    对于矩阵乘法的一些操作 我们 其实 大部分是 多追加一个系数 或者和 其他算法连在一起. 至于核心无非就是 先列出dp 方程再优化 或者 直接 对题目进行建模 构建矩阵. 至于矩阵乘法的正确性 形状的 ...

最新文章

  1. 《iOS 9应用开发入门经典(第7版)》——第2章,第2.4节小结
  2. java生成公钥和私钥_使用Java生成证书,公钥和私钥
  3. f分布表完整图a=0.05_MySQL8.0新特性-invisible indexes
  4. Mysql基础运维及复制架构——实验文档
  5. 如何在python中使用正则表达式从多行字符串中删除特定字符
  6. Java中如何使用Thread和Runnable创建的线程
  7. hiveserver2启动不起来_一辆顶杆机电启动很响,不好打火,有时空挡指示灯较暗...
  8. 蓝桥杯 乘积最大(区间dp+记忆化搜索)
  9. sketch里的ios控件_30个让你眼前一亮的iOS Swift UI控件!
  10. signature=efaf25d07c6ea03d7552906c0caee5a8,幼児の認知発達における関係把握の問題
  11. Bailian3470 整理扑克牌【贪心+二分】
  12. [学习笔记]数据库设计概览
  13. SAP学习记__物料管理(MM)模块__维护仓储地点
  14. Flutter中,解决按下返回键将应用挂起到后台,并不会退出的问题
  15. rac多scan-ip配置
  16. 0x80004005是什么错误?0x80004005的解决方案
  17. 网络计算机amd,AMD多屏显示设置指南_计算机硬件和网络_IT /计算机_信息
  18. WIN7、WIN8、WIN10家庭组共享
  19. Excel表格中行列互换的方法?
  20. Unity多选题功能开发

热门文章

  1. 解决配置Ubuntu中vnc远程显示灰屏
  2. 使用SVN提示“工作副本已经锁定”的解决办法
  3. [NOIP2015] 子串
  4. GIT 这么好用,为什么还是有人不知道怎么用它提交代码?
  5. 第九章 Libgdx内存管理
  6. Linux下Bluez的编程实现
  7. 1、取得/etiantian文件的权限对应的数字(考试题答案系列)
  8. unit 10计算机英语教程,计算机英语实用教程Unit 10.doc
  9. java读取http请求中的body
  10. python 包和模块的区别_3分钟带你搞懂Python模块、包的区别和使用