CodeJeNN: A simple C++ neural network generator for physics applications

codejenn:-a-simple-c++-neural-network-generator-for-physics-applications

CodeJeNN: A simple C++ neural network generator for physics applications

[Submitted on 2 Jul 2026 (v1), last revised 22 Oct 2026 (this version, v3)]

View PDF HTML (experimental)

Abstract:Machine learning has shown promise for physics applications, but integrating Python-based libraries into high-performance C++ solvers can create performance bottlenecks. We present CodeJeNN, which addresses this gap by auto-generating self-contained C++ code from trained Keras models for inference. This eliminates external dependencies through inlined functions, allowing seamless integration into existing frameworks. We describe the Keras-to-C++ workflow, supported architectures, and limitations. CodeJeNN is demonstrated through inference benchmarks against Keras (eager and optimized) and a computational fluid dynamics (CFD) simulation of a hydrogen-air mixing layer in which viscosity is modeled using a neural network, showing that the generated models integrate directly into a solver while remaining efficient and accurate.

Submission history

From: Jay Arcities [view email]
[v1] Thu, 2 Jul 2026 20:30:40 UTC (1,919 KB)
[v2] Fri, 31 Jul 2026 19:36:21 UTC (1,920 KB)
[v3] Thu, 22 Oct 2026 18:38:34 UTC (1,921 KB)