超越语言:将MLX Transformer应用于工程物理
Beyond Language: Applying MLX Transformers to Engineering Physics
AI总结:
针对工程物理领域Transformer应用较少的问题,提出基于MLX框架的物理 informed Transformer模型求解二维热传导问题,可在个人设备高效训练,在测试集上展现优异性能。
摘要:
Transformer神经网络正推动大语言模型(Large Language Models, LLMs)领域的研究活动与发现呈爆发式增长。相比之下,将Transformer应用于工程物理领域的尝试仍寥寥无几。为给以物理为核心的Transformer研究提供简易切入点,我们提出了一种物理 informed Transformer模型,用于求解带Dirichlet边界条件的二维平板热传导问题。该模型基于机器学习框架MLX实现,可利用Apple M系列处理器的统一内存。采用MLX意味着模型仅需适中的内存需求,就能在个人设备上高效完成训练与预测。我们采用中心有限差分法求解二维热传导问题,以此生成Transformer模型的训练、验证与测试数据集。数据集中的每个有限差分解均以四个随机Dirichlet边界条件、均匀但随机的内部温度分布以及随机选取的热扩散系数初始化。训练过程中会同步执行验证,以监控模型是否过拟合。针对未见过的测试条件集,训练后的模型能准确预测温度场演化至稳态的过程,展现出优异的性能。
英文摘要:
Transformer Neural Networks are driving an explosion of activity and discovery in the field of Large Language Models (LLMs). In contrast, there have been only a few attempts to apply Transformers in engineering physics. Aiming to offer an easy entry point to physics-centric Transformers, we introduce a physics-informed Transformer model for solving the heat conduction problem in a 2D plate with Dirichlet boundary conditions. The model is implemented in the machine learning framework MLX and leverages the unified memory of Apple M-series processors. The use of MLX means that the models can be trained and perform predictions efficiently on personal machines with only modest memory requirements. To train, validate and test the Transformer model we solve the 2D heat conduction problem using central finite differences. Each finite difference solution in these sets is initialized with four random Dirichlet boundary conditions, a uniform but random internal temperature distribution and a randomly selected thermal diffusivity. Validation is performed in-line during training to monitor against over-fitting. The excellent performance of the trained model is demonstrated by predicting the evolution of the temperature field to steady state for the unseen test set of conditions.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。