Neural networks as surrogate models that emulate the TGLF quasilinear plasma turbulent transport simulator in various parameter spaces. Each folder includes both ONNX and Pytorch models traced via TorchScript.
The traced PyTorch models can be used in Fortran with FTorch, which provides Fortran bindings for LibTorch (the C++ backend of PyTorch). Please cite the Ftorch publication if using these models from Fortran.
- LibTorch: Download the appropriate version (CPU or GPU) from the PyTorch website and ensure it is accessible in your environment. CPU versions of the
LibTorch
andPip
packages have been tested. TheLibTorch
version requires no Python to install or run. It is suggested to look at theFTorch
instructions below first. - FTorch: Install the FTorch library following the instructions in the FTorch repository. This also provides a compiler specific module (
ftorch.mod
). - Fortran Compiler: Use a modern Fortran compiler (e.g.,
gfortran
orifort
) compatible with FTorch. - CMake: Version >= 3.1 required to build FTorch. Not essential, but helpful for building final Fortran code.