用Transformer解二维热传导,能在个人电脑上高效运行。
Beyond Language: Applying MLX Transformers to Engineering Physics
- 用MLX框架构建物理信息Transformer,直接求解二维热传导问题。
- 在未见边界条件下,模型准确预测温度场达到稳态的演化过程。
- 适合想在本地部署物理仿真模型的研究者和工程师。
Transformer神经网络正推动大语言模型领域的爆发式发展,但在工程物理领域应用仍较少。为降低物理导向Transformer的使用门槛,我们提出一种物理信息Transformer模型,用于求解具有Dirichlet边界条件的二维平板热传导问题。该模型基于机器学习框架MLX实现,利用Apple M系列芯片的统一内存,可在仅需少量内存的个人设备上高效训练与推理。训练、验证与测试均通过中心差分法求解二维热传导方程生成数据集,每组解初始设定四个随机狄利克雷边界条件、均匀随机内部温度分布及随机热扩散率。训练过程中内嵌验证以监控过拟合。结果表明,训练后的模型能准确预测未见条件下的温度场演化至稳态过程。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。