High level domain specific languages for the finite element method underpin high productivity programming environments for simulations based on partial differential equations (PDE) while employing automatic code generation to achieve high performance. However, a limitation of this approach is that it does not support operators that are not directly expressible in the vector calculus. This is critical in applications where PDEs are not enough to accurately describe the physical problem of interest. The use of deep learning techniques have become increasingly popular in filling this knowledge gap, for example to include features not represented in the differential equations, or closures for unresolved spatiotemporal scales. We introduce an interface within the Firedrake finite element system that enables a seamless interface with deep learning models. This new feature composes with the automatic differentiation capabilities of Firedrake, enabling the automated solution of inverse problems. Our implementation interfaces with PyTorch and can be extended to other machine learning libraries. The resulting framework supports complex models coupling PDEs and deep learning whilst maintaining separation of concerns between application scientists and software experts.
翻译:有限元素方法的高域特定语言支持基于部分差异方程式(PDE)的模拟高生产率编程环境,同时使用自动代码生成来取得高性能。然而,这一方法的一个局限性是,它不支持在矢量计算中无法直接表达的操作者。这对于应用中PDE不足以准确描述实际感兴趣的问题来说至关重要。在填补这一知识差距时,使用深层次学习技术越来越受欢迎,例如包括差异方程式中未反映的特征,或对尚未解决的超时尺度的封闭。我们在Firedrake有限元素系统中引入了一个界面,使与深层学习模型的无缝接口。这一新特征与Firedrake的自动区分能力相容,使反问题得以自动解决。我们与PyTorch的操作界面可以扩展到其他机器学习图书馆。由此产生的框架支持复杂的模型组合PDE和深层次学习,同时保持应用科学家和软件专家之间的关切。