计算矩阵逆的时间 [英] time to compute matrix inverse

查看:152
本文介绍了计算矩阵逆的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须演示基于图形的半监督学习算法,该算法需要计算大尺寸(2000 x 2000)的方阵的逆矩阵。



我使用矩阵分解来计算逆矩阵,但经过的时间大约是200(s)。我想知道我是否使用了并行代码花了一半时间(~100s)。

是否有任何想法减少计算逆矩阵的时间? (因为MATLAB耗时约20秒)



P / S:我正在使用带有核心i5计算机的Visual Studio 2012 C#编译器。

I have to demo a graph-based semi-supervised learning algorithm that need to compute an inverse of a square matrix with large size ( 2000 x 2000).

I used Matrix Decomposition to compute the inverse matrix but the elapsed-time is about more 200(s). I wonder if I used parallel code it took a half time (~ 100s).
Any idea to reduce the time to compute an inverse matrix ? (as MATLAB took ~20s)

P/S : I'm using Visual Studio 2012 C# compiler with a core i5 computer.

推荐答案

我唯一的评论就是为什么,除非这是一个数学研究的事情:-)



没有人会真正反转2000x2000矩阵更快地解决方程式,一旦解决了大约一百万倍的速度,使用任何输入值乘以2000x2000逆矩阵得到答案。



所以我是很好奇为什么有人会这样做。



即使在Matlab论坛上,当人们询问大型倒置时,他们通常用
My only comment is why, unless this is a maths research thing :-)

Nobody would really invert a 2000x2000 matrix it would be faster to solve the equation and once solved about a million times faster to use that multiplying any input value by a 2000x2000 inverse matrix to get an answer.

So I am curious why anyone would do this.

Even on Matlab forums when people ask about large inverts they generally preface the answer with
You should ask yourself whether you really need to do the matrix inversion or not.


根据你的方法而定使用和你的代码,矩阵是如此之大,以至于你正在摧毁CPU缓存,从而爆炸了运行的时间。

你可以su我已经优化了Mathlab并以最小化缓存垃圾的方式进行微积分。

如果问题是缓存垃圾,并行化可能会导致更糟糕的时间。



您需要显示代码以获得更多解释。
Depending on the method you use and on your code, the matrix is so big that you are trashing the CPU cache, and thus exploding the time to run.
You can be sure that Mathlab have been optimized and conduct the calculus in a way that minimize cache trashing.
If the problem is cache trashing, Parallelization may lead to even worse timings.

You will need to show your code for more explanations.


这篇关于计算矩阵逆的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆