TensorFlow训练的深度神经网络和贝叶斯神经网络的原生Fortran实现
Native Fortran Implementation of TensorFlow-Trained Deep and Bayesian Neural Networks
AI总结:
针对核工程领域Fortran代码与TensorFlow训练的ML模型不兼容问题,提出无需依赖外部工具的原生Fortran框架实现DNNs和BNNs,经测试获显著加速且成功集成到CTF代码,支持核应用中ML方法研究。
摘要:
过去十年间,机器学习(ML)在核工程领域的研究显著增长。随着多种方法趋于成熟,下一阶段的研究将确定ML模型在生产环境中实施的可行性和实用性。用于反应堆设计和评估的若干代码主要用Fortran语言编写,而该语言无法直接与TensorFlow训练的ML模型兼容。本研究提出一个在Fortran中实现深度神经网络(DNNs)和贝叶斯神经网络(BNNs)的框架,无需TensorFlow的C API、Python运行时或ONNX转换即可原生执行。该框架设计注重易用性和计算效率,可在任何Fortran代码中实现,支持通过集成或BNNs进行迭代求解器和不确定性量化(UQ)。验证通过一个由含噪正弦曲线组成的双输入单输出测试用例进行,将基于Fortran的预测与TensorFlow的预测对比。DNN预测差异可忽略不计,且实现了19.6倍的加速;而BNN预测存在轻微不一致,可能源于随机数生成的差异,其推理实现了8.0倍的加速。该方法随后在预测临界热通量(CHF)的核相关问题上进一步验证,表现出类似行为并获得显著计算增益。讨论还包括该框架成功集成到CTF热工水力代码中,概述了其实用性。总体而言,该框架能有效在Fortran中实现DNN和BNN模型推理,支持在实际核应用中持续研究基于ML的方法。
英文摘要:
Over the past decade, the investigation of machine learning (ML) within the field of nuclear engineering has grown significantly. With many approaches reaching maturity, the next phase of investigation will determine the feasibility and usefulness of ML model implementation in a production setting. Several of the codes used for reactor design and assessment are primarily written in the Fortran language, which is not immediately compatible with TensorFlow-trained ML models. This study presents a framework for implementing deep neural networks (DNNs) and Bayesian neural networks (BNNs) in Fortran, allowing for native execution without TensorFlow's C API, Python runtime, or ONNX conversion. Designed for ease of use and computational efficiency, the framework can be implemented in any Fortran code, supporting iterative solvers and UQ via ensembles or BNNs. Verification was performed using a two-input, one-output test case composed of a noisy sinusoid to compare Fortran-based predictions to those from TensorFlow. The DNN predictions showed negligible differences and achieved a 19.6x speedup, whereas the BNN predictions exhibited minor disagreement, plausibly due to differences in random number generation. An 8.0x speedup was noted for BNN inference. The approach was then further verified on a nuclear-relevant problem predicting critical heat flux (CHF), which demonstrated similar behavior along with significant computational gains. Discussion regarding the framework's successful integration into the CTF thermal-hydraulics code is also included, outlining its practical usefulness. Overall, this framework was shown to be effective at implementing both DNN and BNN model inference within Fortran, allowing for the continued study of ML-based methods in real-world nuclear applications.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。