IKPLS算法新加速:X旋转与Y负载的直接计算

Improving Improved Kernel PLS

精选理由

IKPLS算法加速技巧:X旋转和Y负载计算改进,CPU快2倍、GPU快6倍,代码开源随便用。

AI 摘要

论文针对IKPLS算法1和2的两个共享步骤(X旋转R和Y负载Q)提出加速。对于R,用直接评价策略替代逐项累加,所需乘法数相同但并行性更好。对于Q,首次发现每个Y loading可由之前迭代已算出的量得出,将计算成本从Θ(KM)降到Θ(M)(M=1或2≤M<K)。在NumPy (CPU)和JAX (GPU)上测试,孤立步骤加速达两个数量级,整体拟合加速约2倍(CPU)和6倍(GPU)。改进已集成到开源Python包ikpls中。

原文 · arXiv cs.LG

Improving Improved Kernel PLS

Improved Kernel Partial Least Squares (IKPLS) algorithms 1 and 2 are among the fastest PLS calibration algorithms. This article focuses on two shared steps, the computation of the $\mathbf{X}$ rotations, $\mathbf{R}$, and the $\mathbf{Y}$ loadings, $\mathbf{Q}$, and accelerates both. For $\mathbf{R}$, term-by-term accumulation is replaced by a direct evaluation strategy that requires the same number of multiplications but parallelizes better on modern hardware. For $\mathbf{Q}$, I identify - to the best of my knowledge, for the first time - equivalences showing that each $\mathbf{Y}$ loading is obtainable, up to explicitly derived constants, from quantities already computed earlier in the same iteration, and I exploit them in IKPLS to reduce the cost of each loading from $Θ\left(KM\right)$ to $Θ\left(M\right)$ operations whenever $M = 1$ or $2 \leq M < K$, with $K$ predictor variables (number of columns in $\mathbf{X}$) and $M$ response variables (number of columns in $\mathbf{Y}$). Both improvements provably yield exactly the same $\mathbf{W}$, $\mathbf{P}$, $\mathbf{Q}$, $\mathbf{R}$, and $\mathbf{T}$ as the original algorithms. Benchmarks with NumPy (CPU) and JAX (GPU) show speedups of up to two orders of magnitude for the isolated steps and of approximately $2\times$ (CPU) and $6\times$ (GPU) for entire fits. Both improvements are implemented in the free, open-source Python package \texttt{ikpls}.