Learning to solve the Alternating Current Optimal Power Flow (AC-OPF) problem by neural networks (NNs) is a promising approach in real-time applications. Existing methods to ensure the physical feasibility of NN outputs embed a power flow (PF) solver within networks. However, the gradient through the PF solver, namely, implicit differentiation, needs manual Jacobian derivation and the solution of linear systems, which is computationally prohibitive and hinders integration with modern automatic differentiation (AD) frameworks. To address these challenges, we propose FPL-OPF, a novel unsupervised learning framework that incorporates a Fast Physics-aware Layer for AC-OPF problems. FPL-OPF embeds a fast PF iterative solver within the NN and takes solely the last few or even the final iterations into the AD graph. This design ensures high computational efficiency for both the forward and backward passes, circumventing complex custom backward implementations. Theoretically, we rigorously prove that the gradient from this design serves as a high-fidelity surrogate of the true implicit gradient under mild conditions. Extensive experiments demonstrate that FPL-OPF achieves significant speedups over state-of-the-art unsupervised learning approaches, while maintaining near-zero constraint violations and competitive optimality. Our code is available at https://github.com/wowotou1998/fpl-opf
翻译:通过神经网络(NN)学习求解交流最优潮流(AC-OPF)问题在实时应用中是一种富有前景的方法。为确保神经网络输出物理可行性的现有方法,会将潮流(PF)求解器嵌入网络内部。然而,通过潮流求解器的梯度计算(即隐式微分)需要手动推导雅可比矩阵并求解线性方程组,这不仅计算量巨大,而且难以与现代自动微分(AD)框架集成。为应对这些挑战,我们提出了FPL-OPF,一种新颖的无监督学习框架,针对AC-OPF问题集成了快速物理感知层。FPL-OPF将快速潮流迭代求解器嵌入神经网络,并仅将最后几步甚至最后一步迭代纳入自动微分计算图。该设计确保了前向与反向传播的高计算效率,避免了复杂的自定义反向传播实现。理论上,我们严格证明了该设计下的梯度在温和条件下可作为真实隐式梯度的保真替代。大量实验表明,FPL-OPF相比最先进的无监督学习方法实现了显著加速,同时保持了近乎为零的约束违反与竞争性的最优性。我们的代码开源在https://github.com/wowotou1998/fpl-opf