矢量化编程

From Ufldl

Jump to: navigation, search
Line 8: Line 8:
----
----
-
【原文】:Vectorization refers to a powerful way to speed up your algorithms. Numerical computing and parallel computing researchers have put decades of work into making certain numerical operations (such as matrix-matrix multiplication, matrix-matrix addition, matrix-vector multiplication) fast. The idea of vectorization is that we would like to express our learning algorithms in terms of these highly optimized operations.
+
【原文】:'''Vectorization''' refers to a powerful way to speed up your algorithms. Numerical computing and parallel computing researchers have put decades of work into making certain numerical operations (such as matrix-matrix multiplication, matrix-matrix addition, matrix-vector multiplication) fast. The idea of vectorization is that we would like to express our learning algorithms in terms of these highly optimized operations.
----
----
-
【初译】:矢量化编程是提速你算法的一种有效方式。数值计算和并行计算的研究人员已经为提升特定数值运算操作(如矩阵-矩阵乘法、矩阵-矩阵加法、矩阵-向量乘法等)的速度努力了几十年。矢量化编程的想法就是尽量使用这些被高度优化的数值运算操作来实现我们的学习算法。
+
【初译】:'''矢量化编程'''是提速你算法的一种有效方式。数值计算和并行计算的研究人员已经为提升特定数值运算操作(如矩阵-矩阵乘法、矩阵-矩阵加法、矩阵-向量乘法等)的速度努力了几十年。矢量化编程的想法就是尽量使用这些被高度优化的数值运算操作来实现我们的学习算法。
----
----
-
【一审】:矢量化编程是提高算法速度的一种有效方法。为了提升特定数值运算操作(如矩阵相乘、矩阵相加、矩阵-向量乘法等)的速度,数值计算和并行计算的研究人员已经努力了几十年。矢量化编程的思想就是尽量使用这些被高度优化的数值运算操作来实现我们的学习算法。
+
【一审】:'''矢量化编程'''是提高算法速度的一种有效方法。为了提升特定数值运算操作(如矩阵相乘、矩阵相加、矩阵-向量乘法等)的速度,数值计算和并行计算的研究人员已经努力了几十年。矢量化编程的思想就是尽量使用这些被高度优化的数值运算操作来实现我们的学习算法。
----
----
【原文】:For example, if <math>x \in \Re^{n+1}</math> and <math>\textstyle \theta \in \Re^{n+1}</math> are vectors  
【原文】:For example, if <math>x \in \Re^{n+1}</math> and <math>\textstyle \theta \in \Re^{n+1}</math> are vectors  
Line 49: Line 49:
----
----
【原文】:More generally, a good rule-of-thumb for coding Matlab/Octave is:
【原文】:More generally, a good rule-of-thumb for coding Matlab/Octave is:
-
Whenever possible, avoid using explicit for-loops in your code.
+
'''Whenever possible, avoid using explicit for-loops in your code.'''
----
----
-
【初译】:通常,一个良好的编写Matlab/Octave程序的窍门就是:在编写代码时尽可能的避免使用明显的for循环。
+
【初译】:通常,一个良好的编写Matlab/Octave程序的窍门就是:'''在编写代码时尽可能的避免使用明显的for循环。'''
----
----
-
【一审】:通常,一个良好的编写Matlab/Octave程序的窍门是:代码中尽可能避免显式的for循环。
+
【一审】:通常,一个良好的编写Matlab/Octave程序的窍门是:'''代码中尽可能避免显式的for循环。'''
----
----
【原文】:In particular, the first code example used an explicit for loop. By implementing the same functionality without the for loop, we sped it up significantly. A large part of vectorizing our Matlab/Octave code will focus on getting rid of for loops, since this lets Matlab/Octave extract more parallelism from your code, while also incurring less computational overhead from the interpreter.
【原文】:In particular, the first code example used an explicit for loop. By implementing the same functionality without the for loop, we sped it up significantly. A large part of vectorizing our Matlab/Octave code will focus on getting rid of for loops, since this lets Matlab/Octave extract more parallelism from your code, while also incurring less computational overhead from the interpreter.

Revision as of 12:18, 7 March 2013

Personal tools