pbdl-book/overview.md

190 lines
9.2 KiB
Markdown
Raw Normal View History

2021-01-04 09:36:09 +01:00
Overview
============================
2021-05-06 13:38:11 +02:00
The name of this book, _Physics-Based Deep Learning_,
2021-06-28 17:49:03 +02:00
denotes combinations of physical modeling and numerical simulations with
2021-01-12 04:50:42 +01:00
methods based on artificial neural networks.
The general direction of Physics-Based Deep Learning represents a very
2021-05-06 13:38:11 +02:00
active, quickly growing and exciting field of research, and the following chapter will
give a more thorough introduction for the topic and establish the basics
for following chapters.
2021-01-31 05:13:00 +01:00
2021-01-26 06:04:57 +01:00
```{figure} resources/overview-pano.jpg
---
height: 240px
name: overview-pano
---
Understanding our environment, and predicting how it will evolve is one of the key challenges of humankind.
2021-05-06 13:38:11 +02:00
A key tool for achieving these goals are simulations, and the next generation of simulation algorithms
will rely heavily on deep learning components to yield even more accurate predictions about our world.
2021-01-26 06:04:57 +01:00
```
2021-01-04 09:36:09 +01:00
## Motivation
2021-05-06 13:38:11 +02:00
From weather and climate forecasts {cite}`stocker2014climate` (see the picture above),
2021-01-26 06:04:57 +01:00
over quantum physics {cite}`o2016scalable`,
to the control of plasma fusion {cite}`maingi2019fesreport`,
2021-01-04 12:34:34 +01:00
using numerical analysis to obtain solutions for physical models has
2021-06-28 17:49:03 +02:00
become an integral part of science.
2021-01-04 12:34:34 +01:00
2021-01-07 02:39:57 +01:00
At the same time, machine learning technologies and deep neural networks in particular,
2021-01-26 06:04:57 +01:00
have led to impressive achievements in a variety of fields:
from image classification {cite}`krizhevsky2012` over
natural language processing {cite}`radford2019language`,
and more recently also for protein folding {cite}`alquraishi2019alphafold`.
The field is very vibrant, and quickly developing, with the promise of vast possibilities.
2021-03-02 14:42:27 +01:00
On the other hand, the successes of deep learning (DL) approaches
2021-01-26 06:04:57 +01:00
has given rise to concerns that this technology has
2021-01-07 02:39:57 +01:00
the potential to replace the traditional, simulation-driven approach to
2021-01-04 12:34:34 +01:00
science. Instead of relying on models that are carefully crafted
from first principles, can data collections of sufficient size
be processed to provide the correct answers instead?
2021-01-26 06:04:57 +01:00
In short: this concern is unfounded. As we'll show in the next chapters,
it is crucial to bring together both worlds: _classical numerical techniques_
and _deep learning_.
One central reason for the importance of this combination is
2021-05-06 13:38:11 +02:00
that DL approaches are simply not yet powerful enough by themselves.
2021-01-26 06:04:57 +01:00
Given the current state of the art, the clear breakthroughs of DL
2021-03-02 14:42:27 +01:00
in physical applications are outstanding.
The proposed techniques are novel, sometimes difficult to apply, and
2021-01-26 06:04:57 +01:00
significant practical difficulties combing physics and DL persist.
2021-01-07 02:39:57 +01:00
Also, many fundamental theoretical questions remain unaddressed, most importantly
2021-03-09 09:39:54 +01:00
regarding data efficiency and generalization.
2021-01-04 12:34:34 +01:00
Over the course of the last decades,
highly specialized and accurate discretization schemes have
been developed to solve fundamental model equations such
as the Navier-Stokes, Maxwells, or Schroedingers equations.
Seemingly trivial changes to the discretization can determine
whether key phenomena are visible in the solutions or not.
2021-01-26 06:04:57 +01:00
Rather than discarding the powerful methods that have been
2021-05-06 13:38:11 +02:00
developed in the field of numerical mathematics, it
2021-01-26 06:04:57 +01:00
is highly beneficial for DL to use them as much as possible.
2021-01-04 12:34:34 +01:00
2021-01-26 06:04:57 +01:00
```{admonition} Goals of this document
2021-01-04 12:34:34 +01:00
:class: tip
2021-05-06 13:38:11 +02:00
The key aspects that we want to address in the following are:
2021-03-15 14:05:20 +01:00
- explain how to use deep learning techniques,
- how to combine them with **existing knowledge** of physics,
- without **throwing away** our knowledge about numerical methods.
2021-01-04 12:34:34 +01:00
```
2021-01-26 06:04:57 +01:00
Thus, we want to build on all the powerful techniques that we have
at our disposal, and use them wherever we can.
I.e., our goal is to _reconcile_ the data-centered
2021-03-09 09:39:54 +01:00
viewpoint and the physical simulation viewpoint.
2021-01-04 12:34:34 +01:00
2021-03-02 14:42:27 +01:00
The resulting methods have a huge potential to improve
what can be done with numerical methods: e.g., in scenarios
2021-05-06 13:38:11 +02:00
where a solver targets cases from a certain well-defined problem
2021-03-02 14:42:27 +01:00
domain repeatedly, it can make a lot of sense to once invest
significant resources to train
2021-06-22 09:49:57 +02:00
a neural network that supports the repeated solves. Based on the
2021-03-02 14:42:27 +01:00
domain-specific specialization of this network, such a hybrid
could vastly outperform traditional, generic solvers. And despite
the many open questions, first publications have demonstrated
that this goal is not overly far away.
2021-01-04 12:34:34 +01:00
2021-05-06 13:38:11 +02:00
Another way to look at it is that all mathematical models of our nature
are idealized approximations and contain errors. A lot of effort has been
made to obtain very good model equations, but in order to make the next
big step forward, DL methods offer a very powerful tool to close the
remaining gap towards reality.
2021-01-04 09:36:09 +01:00
## Categorization
Within the area of _physics-based deep learning_,
we can distinguish a variety of different
2021-05-06 13:38:11 +02:00
approaches, from targeting constraints, combined methods, and
2021-01-04 09:36:09 +01:00
optimizations to applications. More specifically, all approaches either target
_forward_ simulations (predicting state or temporal evolution) or _inverse_
problems (e.g., obtaining a parametrization for a physical system from
observations).
![An overview of categories of physics-based deep learning methods](resources/physics-based-deep-learning-overview.jpg)
No matter whether we're considering forward or inverse problem,
the most crucial differentiation for the following topics lies in the
nature of the integration between DL techniques
2021-05-09 10:45:10 +02:00
and the domain knowledge, typically in the form of model equations
via partial differential equations (PDEs).
2021-01-04 09:36:09 +01:00
Taking a global perspective, the following three categories can be
identified to categorize _physics-based deep learning_ (PBDL)
techniques:
2021-05-06 13:38:11 +02:00
- _Supervised_: the data is produced by a physical system (real or simulated),
but no further interaction exists. This is the classic machine learning approach.
2021-01-04 09:36:09 +01:00
- _Loss-terms_: the physical dynamics (or parts thereof) are encoded in the
loss function, typically in the form of differentiable operations. The
learning process can repeatedly evaluate the loss, and usually receives
2021-05-06 13:38:11 +02:00
gradients from a PDE-based formulation. These soft-constraints sometimes also go
under the name "physics-informed" training.
2021-01-04 09:36:09 +01:00
- _Interleaved_: the full physical simulation is interleaved and combined with
an output from a deep neural network; this requires a fully differentiable
simulator and represents the tightest coupling between the physical system and
2021-05-06 13:38:11 +02:00
the learning process. Interleaved differentiable physics approaches are especially important for
2021-01-04 09:36:09 +01:00
temporal evolutions, where they can yield an estimate of future behavior of the
dynamics.
Thus, methods can be roughly categorized in terms of forward versus inverse
solve, and how tightly the physical model is integrated into the
2021-05-06 13:38:11 +02:00
optimization loop that trains the deep neural network. Here, especially
the interleaved approaches
2021-01-04 09:36:09 +01:00
that leverage _differentiable physics_ allow for very tight integration
of deep learning and numerical simulation methods.
2021-01-31 05:13:00 +01:00
2021-04-12 03:19:00 +02:00
## More specifically
2021-01-31 05:13:00 +01:00
2021-05-09 08:19:34 +02:00
_Physical simulations_ are a huge field, and we won't cover all possible types of physical models and simulations in the following.
2021-01-31 05:13:00 +01:00
2021-05-09 08:19:34 +02:00
```{note} Rather, the focus of this book lies on:
2021-02-15 09:04:09 +01:00
- _Field-based simulations_ (no Lagrangian methods)
- Combinations with _deep learning_ (plenty of other interesting ML techniques, but not here)
2021-05-09 08:19:34 +02:00
- Experiments as _outlook_ (i.e., replace synthetic data with real-world observations)
2021-01-31 05:13:00 +01:00
```
It's also worth noting that we're starting to build the methods from some very
2021-05-09 08:19:34 +02:00
fundamental building blocks. Here are some considerations for skipping ahead to the later chapters.
2021-01-31 05:13:00 +01:00
2021-02-15 09:04:09 +01:00
```{admonition} Hint: You can skip ahead if...
2021-01-10 14:15:50 +01:00
:class: tip
2021-05-06 13:38:11 +02:00
- you're very familiar with numerical methods and PDE solvers, and want to get started with DL topics right away. The {doc}`supervised` chapter is a good starting point then.
2021-01-10 14:15:50 +01:00
2021-05-06 13:38:11 +02:00
- On the other hand, if you're already deep into NNs&Co, and you'd like to skip ahead to the research related topics, we recommend starting in the {doc}`physicalloss` chapter, which lays the foundations for the next chapters.
2021-01-10 14:15:50 +01:00
2021-02-27 07:07:42 +01:00
A brief look at our _notation_ in the {doc}`notation` chapter won't hurt in both cases, though!
2021-01-10 14:15:50 +01:00
```
2021-03-08 04:15:00 +01:00
## Implementations
This text also represents an introduction to a wide range of deep learning and simulation APIs.
2021-05-09 08:19:34 +02:00
We'll use popular deep learning APIs such as _pytorch_ [https://pytorch.org](https://pytorch.org) and _tensorflow_ [https://www.tensorflow.org](https://www.tensorflow.org), and additionally
2021-05-09 10:45:10 +02:00
give introductions into the differentiable simulation framework _Φ<sub>Flow</sub> (phiflow)_ [https://github.com/tum-pbs/PhiFlow](https://github.com/tum-pbs/PhiFlow). Some examples also use _JAX_ [https://github.com/google/jax](https://github.com/google/jax). Thus after going through
2021-03-08 04:15:00 +01:00
these examples, you should have a good overview of what's available in current APIs, such that
the best one can be selected for new tasks.
2021-05-17 10:48:35 +02:00
As we're (in most jupyter notebook examples) dealing with stochastic optimizations, many of the following code examples will produce slightly different results each time they're run. This is fairly common with NN training, but it's important to keep in mind when executing the code. It also means that the numbers discussed in the text might not exactly match the numbers you'll see after re-running the examples.
2021-01-26 06:04:57 +01:00
---
2021-01-31 05:13:00 +01:00
<br>
<br>
2021-01-10 14:15:50 +01:00
2021-01-26 06:04:57 +01:00
<!-- ## A brief history of PBDL in the context of Fluids
2021-01-07 02:39:57 +01:00
First:
Tompson, seminal...
Chu, descriptors, early but not used
Ling et al. isotropic turb, small FC, unused?
2021-01-26 06:04:57 +01:00
PINNs ... and more ... -->
2021-01-07 02:39:57 +01:00