Treffer: Python code for Sturm and Wexler (2022): Conservation laws in a neural network architecture
Weitere Informationen
This is the Python code archive for Sturm and Wexler (2021), Conservation laws in a neural network architecture: Balancing atoms in a photochemical model. The Python script PhysicsConstrainedNN.py constructs, trains, and evaluates three feed-forward neural network (NN) architectures, one a purely data-driven approach (naive NN), a second with additional input resembling rate laws driving the photochemistry (intermediate) and a third NN with additional input and hard constraints built into the layers (physics-constrained NN) such that atoms are conserved. The neural networks are themselves surrogate models of a reference photochemical model written in the Julia language: https://doi.org/10.5281/zenodo.5736487 In order to train the neural networks and in order for the script to run successfully, model output on concentrations (C.txt), cosine of zenith angle (J.txt) and fluxes of atoms (S.txt) is required from the reference model. These text files can be individually downloaded at the above DOI without needing to run the Julia model. The script is seeded to reproduce the converged weights of the NNs used in the paper. The NNs also available for download in hierarchical data format (.h5), should a user wish to skip training the NNs and evaluate them directly.