Many numerical methods for evaluating matrix functions can be naturally viewed as computational graphs. Rephrasing these methods as directed acyclic graphs (DAGs) is a particularly effective way to study existing techniques, improve them, and eventually derive new ones. As the accuracy of these matrix techniques is determined by the accuracy of their scalar counterparts, the design of algorithms for matrix functions can be viewed as a scalar-valued optimization problem. The derivatives needed during the optimization can be calculated automatically by exploiting the structure of the DAG, in a fashion akin to backpropagation. The Julia package GraphMatFun.jl offers the tools to generate and manipulate computational graphs, to optimize their coefficients, and to generate Julia, MATLAB, and C code to evaluate them efficiently. The software also provides the means to estimate the accuracy of an algorithm and thus obtain numerically reliable methods. For the matrix exponential, for example, using a particular form (degree-optimal) of polynomials produces algorithms that are cheaper, in terms of computational cost, than the Pad\'e-based techniques typically used in mathematical software. The optimized graphs and the corresponding generated code are available online.
翻译:用于评估矩阵函数的许多数字方法可以自然地被视为计算图。将这些方法改写成定向单极图(DAGs)是研究现有技术、改进这些技术并最终产生新技术的一种特别有效的方法。由于这些矩阵技术的准确性取决于其缩略图对应方的准确性,因此矩阵函数的算法设计可以被视为一个比例值优化问题。优化期间所需的衍生物可以通过利用DAG结构,以类似于反向调整的方式,自动计算出。Julia 软件包GapMatFun.jl提供了生成和操作计算图的工具,优化其系数,并生成朱丽亚、MATLAB和C代码,以高效地评估它们。软件还提供了估算算法准确性的手段,从而获得数字上可靠的方法。例如,对于矩阵指数来说,使用一种特定的形式(度-最优度)来生成计算成本比计算成本更便宜的计算法,而基于Pad\e的计算法则通常在数学软件中使用。