Physics-Based Machine Learning — Notes
Weighted Residual Methods & Foundations for PINNs
Text & Definitions Equations Key Insights & Warnings
Section 1 — The Model Problem & The Residual Idea
1.1 — The Boundary Value Problem

Let $\Omega \subset \mathbb{R}^n$ be an open, bounded domain with boundary $\partial\Omega$. We seek $u : \bar{\Omega} \to \mathbb{R}$ satisfying:

$$ \mathcal{L}[u] = f \quad \text{in } \Omega \tag{1.1} $$ $$ u = g \quad \text{on } \partial\Omega \tag{1.2} $$

where $\mathcal{L}$ is a differential operator, $f$ is a known forcing function, and $g$ is the boundary data. A canonical example is the Poisson equation, where $\mathcal{L} = -\nabla^2$.

1.2 — The Residual

Since we cannot generally find $u$ exactly, we build an approximation $\tilde{u} \approx u$. Define the residual:

$$ R(x;\,\tilde{u}) = \mathcal{L}[\tilde{u}](x) - f(x), \quad x \in \Omega \tag{1.3} $$

Note that $R = 0$ everywhere if and only if $\tilde{u}$ is the exact solution. For any other $\tilde{u}$, we have $R \not\equiv 0$.

The goal is not to eliminate $R$ pointwise, but to make it small on average — this is the weighted residual idea.
1.3 — Function Spaces

Before choosing a method, we must specify where $\tilde{u}$ and the test functions live. This is not just formalism — it determines whether the method is well-posed and what regularity the solution needs.

Definition 1.1 — $L^2(\Omega)$

The space of square-integrable functions:

$$ L^2(\Omega) = \left\{ v : \Omega \to \mathbb{R} \;\middle|\; \int_\Omega |v(x)|^2 \, dx < \infty \right\} $$

with inner product:

$$ \langle u, v \rangle_{L^2} = \int_\Omega u(x)\, v(x)\, dx $$
Definition 1.2 — The Sobolev space $H^1(\Omega)$
$$ H^1(\Omega) = \left\{ v \in L^2(\Omega) \;\middle|\; \nabla v \in L^2(\Omega) \right\} $$

Functions in $H^1$ are in $L^2$ and have first derivatives that are also in $L^2$.

Definition 1.3 — The space $H^1_0(\Omega)$
$$ H^1_0(\Omega) = \left\{ v \in H^1(\Omega) \;\middle|\; v\big|_{\partial\Omega} = 0 \right\} $$

$H^1$ functions that vanish on the boundary — homogeneous Dirichlet boundary conditions are built into the space.

Why $H^1$ and not $C^1$ (smooth functions)?
Physical solutions can have kinks at material interfaces. $H^1$ is large enough to contain these and still guarantee finite energy $\int_\Omega |\nabla v|^2\,dx < \infty$. $L^2$ alone is too large — derivatives may not exist. $C^1$ is too restrictive — it excludes valid physical solutions.
1.4 — Trial Space, Test Space, and the Weighted Residual Statement

We define two spaces: the trial space $V$ (where we seek $\tilde{u}$, which must satisfy the boundary conditions) and the test space $W$ (where weight functions $w$ live).

The general weighted residual statement is:

$$ \text{Find } \tilde{u} \in V \text{ such that } \int_\Omega w(x)\, R(x;\,\tilde{u})\, dx = 0 \quad \forall\, w \in W \tag{1.4} $$
The choice of $W$ is what distinguishes the methods:

$W = \{\mathbf{1}_{\Omega_k}\} \implies$ Subregion method
$W = \{\delta(x - x_i)\} \implies$ Collocation method
$W = V \implies$ Galerkin method
Check Question 1

If $w(x) = \delta(x - x_i)$, what does equation (1.4) reduce to? What is this enforcing, geometrically speaking?

Answer: By the Dirac delta sifting property:

$$ \int_\Omega \delta(x - x_i)\, R(x;\,\tilde{u})\, dx = R(x_i;\,\tilde{u}) = 0 $$

This enforces the residual to be exactly zero at each collocation point $x_i$. Geometrically, we are pinning the residual to zero at a finite set of chosen points.


Section 2 — Classical Weighted Residual Methods
2.1 — Approximation Setup (common to all methods)

We approximate $u$ using a finite linear combination of basis functions $\{\phi_j\}_{j=1}^N$:

$$ \tilde{u}(x) = \sum_{j=1}^N c_j\, \phi_j(x) \tag{2.1} $$

where $c_j \in \mathbb{R}$ are the unknown coefficients we want to determine, and $\phi_j \in V$ are prescribed basis functions satisfying the boundary conditions.

Substituting into (1.3), the residual becomes:

$$ R(x;\,\tilde{u}) = \mathcal{L}\!\left[\sum_{j=1}^N c_j\,\phi_j\right]\!(x) - f(x) = \sum_{j=1}^N c_j\,\mathcal{L}[\phi_j](x) - f(x) \tag{2.2} $$
The last equality uses linearity of $\mathcal{L}$, which holds for all methods in this section. Keep this assumption in mind — nonlinear operators will complicate things later.
2.2 — The Subregion (Subdomain) Method

Partition $\Omega$ into $N$ non-overlapping subdomains $\Omega_1, \Omega_2, \ldots, \Omega_N$ such that $\bigcup_k \Omega_k = \Omega$.

The test functions are characteristic (indicator) functions:

$$ w_k(x) = \mathbf{1}_{\Omega_k}(x) = \begin{cases} 1 & x \in \Omega_k \\ 0 & \text{otherwise} \end{cases} $$

The weighted residual condition (1.4) for each subdomain $\Omega_k$ becomes:

$$ \int_{\Omega_k} R(x;\,\tilde{u})\, dx = 0, \quad k = 1, 2, \ldots, N \tag{2.3} $$

Substituting (2.2):

$$ \sum_{j=1}^N c_j \int_{\Omega_k} \mathcal{L}[\phi_j](x)\, dx = \int_{\Omega_k} f(x)\, dx, \quad k = 1, \ldots, N \tag{2.4} $$

This is a linear system $\mathbf{A}\mathbf{c} = \mathbf{b}$ with:

$$ A_{kj} = \int_{\Omega_k} \mathcal{L}[\phi_j](x)\, dx, \qquad b_k = \int_{\Omega_k} f(x)\, dx \tag{2.5} $$
Geometric meaning: The average of the residual over each subdomain is zero. The residual can still be nonzero locally — it just cancels out in the integral over each $\Omega_k$.
2.3 — The Collocation Method

Choose $N$ distinct collocation points $\{x_1, x_2, \ldots, x_N\} \subset \Omega$.

The test functions are Dirac deltas:

$$ w_k(x) = \delta(x - x_k) $$

From the sifting property, condition (1.4) gives:

$$ R(x_k;\,\tilde{u}) = 0, \quad k = 1, 2, \ldots, N \tag{2.6} $$

Substituting (2.2):

$$ \sum_{j=1}^N c_j\, \mathcal{L}[\phi_j](x_k) = f(x_k), \quad k = 1, \ldots, N \tag{2.7} $$

Again a linear system $\mathbf{A}\mathbf{c} = \mathbf{b}$ with:

$$ A_{kj} = \mathcal{L}[\phi_j](x_k), \qquad b_k = f(x_k) \tag{2.8} $$
Requirement: $\tilde{u}$ must be smooth enough for $\mathcal{L}[\tilde{u}](x_k)$ to be well-defined pointwise. For $\mathcal{L} = -\nabla^2$, we need $\tilde{u} \in C^2(\Omega)$ — stronger than $H^1$. This is why the choice of basis functions matters.
2.4 — The Galerkin Method

Here the test space equals the trial space: $W = V$. We take $w = \phi_i$ for each $i = 1, \ldots, N$. Condition (1.4) becomes:

$$ \int_\Omega \phi_i(x)\, R(x;\,\tilde{u})\, dx = 0, \quad i = 1, 2, \ldots, N \tag{2.9} $$

Substituting (2.2):

$$ \sum_{j=1}^N c_j \int_\Omega \phi_i(x)\, \mathcal{L}[\phi_j](x)\, dx = \int_\Omega \phi_i(x)\, f(x)\, dx \tag{2.10} $$

Again a linear system $\mathbf{A}\mathbf{c} = \mathbf{b}$ with:

$$ A_{ij} = \int_\Omega \phi_i(x)\, \mathcal{L}[\phi_j](x)\, dx, \qquad b_i = \int_\Omega \phi_i(x)\, f(x)\, dx \tag{2.11} $$

For self-adjoint operators (e.g., $\mathcal{L} = -\nabla^2$), one typically integrates by parts to reduce regularity requirements. This gives the weak form, which only requires $\tilde{u} \in H^1_0(\Omega)$ instead of $C^2$:

$$ \int_\Omega \nabla\phi_i \cdot \nabla\tilde{u}\, dx = \int_\Omega \phi_i\, f\, dx \tag{2.12} $$
Assumptions for (2.12): $\mathcal{L} = -\nabla^2$ (Poisson), homogeneous Dirichlet BCs ($g = 0$) so the boundary term from integration by parts vanishes, and $\phi_i \in H^1_0(\Omega)$.

This is the most important method. The Galerkin weak form is the foundation of the Finite Element Method, and — as we will see — the residual term in PINNs is a collocation-type condition, while the structure of the loss function echoes the Galerkin inner product.
Check Question 2

Look at equations (2.5), (2.8), and (2.11). All three methods produce a linear system $\mathbf{A}\mathbf{c} = \mathbf{b}$.

(a) What is the fundamental difference in how $A_{kj}$ is constructed across the three methods?

(b) Which method requires the highest regularity on $\tilde{u}$, and why?

Answer:

(a) In the subregion method, $A_{kj}$ is an integral of $\mathcal{L}[\phi_j]$ over a subdomain $\Omega_k$. In the collocation method, $A_{kj}$ is a pointwise evaluation $\mathcal{L}[\phi_j](x_k)$ — no integration. In the Galerkin method, $A_{ij}$ is a weighted integral of $\mathcal{L}[\phi_j]$ against the test function $\phi_i$ over the entire domain $\Omega$.

(b) The collocation method requires the highest regularity. Since $\mathcal{L}[\tilde{u}]$ must be evaluated pointwise, all derivatives in $\mathcal{L}$ must exist classically. For $\mathcal{L} = -\nabla^2$, this demands $\tilde{u} \in C^2(\Omega)$. The Galerkin weak form, by contrast, only needs $\tilde{u} \in H^1_0(\Omega)$.

Regularity ranking:

$C^2(\Omega) \;\subset\; H^1(\Omega) \;\subset\; L^2(\Omega)$

Collocation needs $C^2$ (strongest). Subregion needs $\mathcal{L}[\tilde{u}] \in L^1(\Omega_k)$ (integrable over subdomains). Galerkin in weak form needs only $H^1_0$ (weakest) — integration by parts trades regularity on $\tilde{u}$ for regularity on $\phi_i$.

Section 3 — From Classical Bases to Neural Networks
3.1 — The Classical Approximation Revisited

In Section 2, our approximation was:

$$ \tilde{u}(x) = \sum_{j=1}^N c_j\,\phi_j(x) \tag{2.1, restated} $$

This is linear in the parameters $c_j$. The basis functions $\phi_j$ are fixed and chosen a priori (polynomials, piecewise linear hat functions, trigonometric functions, etc.).

Two consequences:

(a) The weighted residual equation always produces a linear system $\mathbf{A}\mathbf{c} = \mathbf{b}$.

(b) The quality of the approximation depends entirely on how well the fixed basis $\{\phi_j\}$ can represent $u$ — this is the approximation power of the space $V^h = \text{span}\{\phi_1, \ldots, \phi_N\}$.

The fundamental limitation: for complex geometries or high-dimensional problems ($n \gg 3$), constructing good basis functions and meshes becomes extremely expensive or intractable. This is the curse of dimensionality for classical methods.
3.2 — Neural Network as a Universal Approximator

Now replace the linear combination with a neural network. Define:

$$ u_\theta(x) = \mathcal{N}(x;\,\theta) \tag{3.1} $$

where $\theta \in \mathbb{R}^p$ collects all weights and biases, and $\mathcal{N}$ is the network architecture (e.g., a feedforward multilayer perceptron).

For a single hidden layer with $m$ neurons and activation $\sigma$:

$$ u_\theta(x) = \sum_{k=1}^m \alpha_k\,\sigma\!\left(\sum_{i=1}^n w_{ki}\,x_i + b_k\right) + \beta \tag{3.2} $$

where $\theta = \{\alpha_k,\, w_{ki},\, b_k,\, \beta\}$.

Critical difference from (2.1): The approximation $u_\theta$ is nonlinear in the parameters $\theta$. The "basis functions" are no longer fixed — they are learned during training. This is what gives neural networks their flexibility, but it also means we can no longer solve a linear system. We must optimize.
3.3 — Function Space of Neural Networks

The set of all functions representable by a given architecture forms:

$$ \mathcal{F}_\theta = \left\{ \mathcal{N}(\cdot\,;\,\theta) \;\middle|\; \theta \in \mathbb{R}^p \right\} \tag{3.3} $$

This is not a linear subspace — it is a nonlinear manifold in function space.

However, the Universal Approximation Theorem (Cybenko 1989, Hornik 1991) guarantees:

Theorem 3.1 — Universal Approximation

For any $f \in C(\bar{\Omega})$ and any $\varepsilon > 0$, there exists a network $u_\theta$ with one hidden layer such that:

$$ \sup_{x \in \bar{\Omega}} |u_\theta(x) - f(x)| < \varepsilon \tag{3.4} $$
What this says: neural networks are dense in $C(\bar{\Omega})$. They can approximate any continuous function to arbitrary accuracy — given enough neurons.

What this does NOT say: it says nothing about how many neurons you need, how to find $\theta$, or whether gradient descent will converge.
3.4 — Regularity of Neural Networks

If the activation function $\sigma$ is smooth (e.g., $\sigma = \tanh$, sigmoid, softplus), then:

$$ u_\theta \in C^\infty(\Omega) \tag{3.5} $$

because $u_\theta$ is a composition of smooth maps. All derivatives exist and can be computed via automatic differentiation.

This is why neural networks + collocation is natural. Recall that collocation requires $C^2$. Neural networks with smooth activations give $C^\infty$ for free. No mesh, no element construction — just evaluate $\mathcal{L}[u_\theta](x_k)$ at any point using autodiff.

Warning: ReLU activations give $u_\theta \in C^0$ only (not even $C^1$). This is problematic for PDE-based methods. That is why PINNs typically use $\tanh$, $\sin$, or other smooth activations.
Check Question 3

In the classical setting (2.1), the approximation is linear in $c_j$, and the weighted residual produces $\mathbf{A}\mathbf{c} = \mathbf{b}$.

With the neural network approximation (3.1), we still write the residual $R(x;\,u_\theta) = \mathcal{L}[u_\theta](x) - f(x)$.

(a) Can we still write a linear system $\mathbf{A}\boldsymbol{\theta} = \mathbf{b}$? Why or why not?

(b) If not, what replaces the linear system as the mechanism to find $\theta$?

Answer:

(a) No. Since $u_\theta$ is nonlinear in $\theta$, the residual $R(x;\,u_\theta) = \mathcal{L}[u_\theta](x) - f(x)$ is a nonlinear function of $\theta$. We cannot factor it as $\mathbf{A}\boldsymbol{\theta} - \mathbf{b}$. The linearity that gave us equation (2.2) relied on $\tilde{u}$ being a linear combination of fixed basis functions — that structure is gone.

(b) We replace the linear solve with optimization. We define a scalar loss function $\mathcal{J}(\theta)$ that measures how large the residual is, and minimize it via gradient-based methods (gradient descent, Adam, L-BFGS, etc.) using gradients computed by automatic differentiation.


Section 4 — Physics-Informed Neural Networks (PINNs)
4.1 — The Core Idea

PINNs combine the neural network approximation of Section 3 with the collocation philosophy of Section 2.3. The key move: instead of solving $R(x_k;\,u_\theta) = 0$ as a nonlinear system, we minimize the squared residual over a set of collocation points.

Consider the boundary value problem from Section 1:

$$ \mathcal{L}[u] = f \quad \text{in } \Omega, \qquad u = g \quad \text{on } \partial\Omega $$

We represent the solution by a neural network $u_\theta(x) = \mathcal{N}(x;\,\theta)$ and define the PDE residual at any point $x \in \Omega$:

$$ R(x;\,\theta) = \mathcal{L}[u_\theta](x) - f(x) \tag{4.1} $$

and the boundary residual at any point $x \in \partial\Omega$:

$$ R_{\partial\Omega}(x;\,\theta) = u_\theta(x) - g(x) \tag{4.2} $$
Crucial difference from classical collocation: In (2.6), we enforced $R = 0$ exactly at each point, giving an $N \times N$ system. Here we do not enforce exact zeros — we minimize the residual in a least-squares sense over a (possibly very large) set of points. This turns a hard constraint into a soft penalty.
4.2 — The PINN Loss Function

Sample two sets of collocation points:

(i) Interior points: $\{x_r^{(i)}\}_{i=1}^{N_r} \subset \Omega$ (for the PDE residual)

(ii) Boundary points: $\{x_b^{(i)}\}_{i=1}^{N_b} \subset \partial\Omega$ (for the boundary condition)

Define the component losses:

$$ \mathcal{J}_r(\theta) = \frac{1}{N_r} \sum_{i=1}^{N_r} \left| R\!\left(x_r^{(i)};\,\theta\right) \right|^2 = \frac{1}{N_r} \sum_{i=1}^{N_r} \left| \mathcal{L}[u_\theta]\!\left(x_r^{(i)}\right) - f\!\left(x_r^{(i)}\right) \right|^2 \tag{4.3} $$
$$ \mathcal{J}_b(\theta) = \frac{1}{N_b} \sum_{i=1}^{N_b} \left| u_\theta\!\left(x_b^{(i)}\right) - g\!\left(x_b^{(i)}\right) \right|^2 \tag{4.4} $$

The total PINN loss is:

$$ \mathcal{J}(\theta) = \lambda_r\,\mathcal{J}_r(\theta) + \lambda_b\,\mathcal{J}_b(\theta) \tag{4.5} $$

where $\lambda_r, \lambda_b > 0$ are weighting hyperparameters that balance PDE fidelity against boundary satisfaction.

Connection to weighted residuals: Equation (4.3) is a Monte Carlo discretization of the $L^2$ norm of the residual: $$ \mathcal{J}_r(\theta) \approx \frac{|\Omega|}{N_r} \int_\Omega |R(x;\,\theta)|^2\,dx = \frac{|\Omega|}{N_r}\,\|R\|_{L^2(\Omega)}^2 $$ So PINNs can be interpreted as a Galerkin-like method (minimizing the $L^2$ residual norm) implemented via collocation (pointwise evaluation). It inherits features of both frameworks.
4.3 — The Training Problem

The PINN training problem is:

$$ \theta^* = \arg\min_{\theta \in \mathbb{R}^p} \mathcal{J}(\theta) \tag{4.6} $$

This is a nonconvex optimization problem in $\mathbb{R}^p$, where $p$ can be $10^4$–$10^7$ depending on the network size. We solve it iteratively via gradient descent:

$$ \theta^{(k+1)} = \theta^{(k)} - \eta\,\nabla_\theta \mathcal{J}(\theta^{(k)}) \tag{4.7} $$

where $\eta > 0$ is the learning rate. In practice, variants such as Adam or L-BFGS are used.

The gradient $\nabla_\theta \mathcal{J}$ requires differentiating through the PDE operator $\mathcal{L}$. By the chain rule, for a single collocation point $x_r$:

$$ \nabla_\theta \left|R(x_r;\,\theta)\right|^2 = 2\,R(x_r;\,\theta)\;\nabla_\theta\!\left[\mathcal{L}[u_\theta](x_r)\right] \tag{4.8} $$

The term $\nabla_\theta[\mathcal{L}[u_\theta](x_r)]$ involves second-order derivatives: first, spatial derivatives of $u_\theta$ (to evaluate $\mathcal{L}$), and then parameter derivatives of the result (to compute the gradient). This is handled by automatic differentiation — specifically, by differentiating through the computational graph of $u_\theta$.

The autodiff pipeline for PINNs:

1. Forward pass: evaluate $u_\theta(x)$
2. Spatial derivatives: compute $\nabla_x u_\theta$, $\nabla_x^2 u_\theta$, etc. via autodiff w.r.t. $x$
3. Assemble residual: $R = \mathcal{L}[u_\theta] - f$
4. Loss: $\mathcal{J} = \frac{1}{N_r}\sum |R|^2 + \ldots$
5. Parameter gradient: $\nabla_\theta \mathcal{J}$ via autodiff w.r.t. $\theta$ (backpropagation)

Steps 2 and 5 are both automatic differentiation, but with respect to different variables ($x$ vs. $\theta$). This double use of autodiff is the computational backbone of PINNs.
4.4 — Incorporating Data (the "Informed" Part)

One of the strengths of PINNs is the ability to fuse physics (the PDE) with observational data. Suppose we have $N_d$ measurements $\{(x_d^{(i)},\, u_d^{(i)})\}_{i=1}^{N_d}$ of the true solution. We add a data-fidelity term:

$$ \mathcal{J}_d(\theta) = \frac{1}{N_d} \sum_{i=1}^{N_d} \left| u_\theta\!\left(x_d^{(i)}\right) - u_d^{(i)} \right|^2 \tag{4.9} $$

The full PINN loss becomes:

$$ \mathcal{J}(\theta) = \lambda_r\,\mathcal{J}_r(\theta) + \lambda_b\,\mathcal{J}_b(\theta) + \lambda_d\,\mathcal{J}_d(\theta) \tag{4.10} $$
This is what makes PINNs unique in the weighted residual landscape. Classical methods (subregion, collocation, Galerkin) are purely physics-driven — they only use the PDE. PINNs can simultaneously satisfy the PDE, match boundary conditions, and fit experimental data, all in a single optimization. This enables inverse problems: if some parameters of $\mathcal{L}$ are unknown, they can be included in $\theta$ and learned from data.
4.5 — Function Space and Well-Posedness Considerations

Recall from Section 3.3 that the neural network hypothesis class $\mathcal{F}_\theta$ is a nonlinear manifold, not a linear subspace. This has important consequences:

(a) No Céa's lemma: In the Galerkin/FEM setting, Céa's lemma guarantees that the discrete solution is the best approximation in $V^h$ (up to a constant). No such result exists for PINNs — minimizing $\mathcal{J}(\theta)$ does not guarantee we find the closest function in $\mathcal{F}_\theta$ to the true solution.

(b) No guaranteed convergence: The loss landscape is nonconvex. Gradient descent can get trapped in local minima or saddle points. The quality of the solution depends on initialization, architecture, optimizer, and learning rate schedule.

(c) Regularity is controlled by architecture: With smooth activations ($\tanh$, $\sin$), $u_\theta \in C^\infty$. But the effective approximation quality depends on width, depth, and the spectral bias of the network (tendency to learn low-frequency components first).

Summary — PINNs as a weighted residual method:

$\bullet$ Trial space: $\mathcal{F}_\theta$ (neural network manifold, nonlinear in $\theta$)
$\bullet$ Test functions: Dirac deltas at collocation points (collocation philosophy)
$\bullet$ Residual enforcement: soft (least-squares minimization), not hard ($R = 0$ exactly)
$\bullet$ Regularity: $C^\infty$ with smooth activations — collocation requirement satisfied automatically
$\bullet$ Solution method: nonconvex optimization via gradient descent + autodiff
$\bullet$ Unique feature: data fusion via $\mathcal{J}_d$ — enables inverse problems
4.6 — Summary Table: From Classical to PINNs
Subregion Collocation Galerkin PINNs
Test functions $W$ $\mathbf{1}_{\Omega_k}$ $\delta(x - x_k)$ $\phi_i \in V$ $\delta(x - x_r^{(i)})$
Trial space $V^h$ (linear) $V^h$ (linear) $V^h$ (linear) $\mathcal{F}_\theta$ (nonlinear)
Regularity needed $L^1_{\text{loc}}$ $C^2$ $H^1_0$ (weak form) $C^2$ (have $C^\infty$)
Enforcement $R = 0$ (integral) $R = 0$ (pointwise) $R = 0$ (weighted) $\|R\|^2 \to \min$ (soft)
Solve method Linear system Linear system Linear system Gradient descent
Data fusion No No No Yes ($\mathcal{J}_d$)
Check Question 4

Consider the PINN loss (4.10) with all three terms. Suppose you set $\lambda_r = 0$ (turn off the PDE residual) and keep $\lambda_b > 0$, $\lambda_d > 0$.

(a) What kind of problem does this reduce to? Is it still "physics-informed"?

(b) Now suppose instead you set $\lambda_d = 0$ (no data) and keep $\lambda_r > 0$, $\lambda_b > 0$. How does this compare to classical collocation from Section 2.3?

Answer:

(a) With $\lambda_r = 0$, the PDE is completely absent from the loss. What remains is boundary matching ($\mathcal{J}_b$) and data fitting ($\mathcal{J}_d$). This is pure data fitting / interpolation — the network learns to pass through the data and satisfy boundary values, but has no knowledge of the governing physics. It is no longer "physics-informed."

(b) With $\lambda_d = 0$, we have $\mathcal{J} = \lambda_r\,\mathcal{J}_r + \lambda_b\,\mathcal{J}_b$, which is the same structure as classical collocation but with two key differences: (i) the trial space is a nonlinear neural network manifold $\mathcal{F}_\theta$ instead of a linear span, and (ii) enforcement is soft (minimize $|R|^2$) rather than hard ($R = 0$ exactly). This is the "vanilla" PINN — a neural-network collocation method with least-squares residual minimization.


Section 5 — Neural Operators
5.1 — Motivation: From Functions to Operators

In Sections 1–4, we always solved one instance of a PDE: given a specific $f$ and $g$, find the corresponding $u$. If $f$ changes, we must retrain the entire PINN from scratch.

In many applications — design optimization, uncertainty quantification, real-time control — we need to solve the same PDE for many different inputs $f$. The natural mathematical object is the solution operator:

$$ \mathcal{G}: f \mapsto u, \qquad \text{where } \mathcal{L}[u] = f \text{ in } \Omega,\; u = g \text{ on } \partial\Omega \tag{5.1} $$

The operator $\mathcal{G}$ maps an input function $f$ (the forcing) to an output function $u$ (the solution). It acts between function spaces, not between finite-dimensional vectors.

The paradigm shift:

$\bullet$ PINNs learn a function: $u_\theta : \mathbb{R}^n \to \mathbb{R}$ (one input $f$ at a time)
$\bullet$ Neural operators learn an operator: $\mathcal{G}_\theta : \mathcal{A} \to \mathcal{U}$ (all inputs $f$ simultaneously)

Once trained, a neural operator produces the solution for a new $f$ in a single forward pass — no retraining, no optimization loop, no collocation. This is orders of magnitude faster at inference time.
5.2 — The Operator Learning Problem

Let $\mathcal{A}$ and $\mathcal{U}$ be Banach spaces of functions (e.g., $\mathcal{A} = L^2(\Omega)$ for the input forcing, $\mathcal{U} = H^1_0(\Omega)$ for the solution). The true solution operator $\mathcal{G}: \mathcal{A} \to \mathcal{U}$ is typically nonlinear and defined implicitly through the PDE.

We seek a parametric approximation:

$$ \mathcal{G}_\theta : \mathcal{A} \to \mathcal{U}, \qquad \theta \in \mathbb{R}^p \tag{5.2} $$

Given a training dataset of input–output pairs $\{(f^{(i)},\, u^{(i)})\}_{i=1}^{N_{\text{train}}}$ (generated by a classical solver), we train by minimizing:

$$ \mathcal{J}(\theta) = \frac{1}{N_{\text{train}}} \sum_{i=1}^{N_{\text{train}}} \left\| \mathcal{G}_\theta(f^{(i)}) - u^{(i)} \right\|_{\mathcal{U}}^2 \tag{5.3} $$

In practice, the norm $\|\cdot\|_{\mathcal{U}}$ is approximated by evaluating on a discrete grid:

$$ \left\| \mathcal{G}_\theta(f^{(i)}) - u^{(i)} \right\|_{\mathcal{U}}^2 \;\approx\; \frac{1}{M} \sum_{j=1}^{M} \left| \mathcal{G}_\theta(f^{(i)})(x_j) - u^{(i)}(x_j) \right|^2 \tag{5.4} $$
Key distinction from PINNs: The training data here consists of solved PDE instances (input–output function pairs), not just scattered measurements. You need a classical solver (FEM, spectral, finite difference) to generate the training set. The neural operator then amortizes the cost of the solver across all future queries.
5.3 — The Universal Approximation Theorem for Operators

The theoretical foundation for neural operators comes from a generalization of the universal approximation theorem to operators.

Theorem 5.1 — Universal Approximation for Operators (Chen & Chen, 1995)

Let $\mathcal{G}: \mathcal{A} \to \mathcal{U}$ be a continuous (nonlinear) operator between Banach spaces, where $\mathcal{A}$ is a compact subset of $C(\bar{\Omega}_{\text{in}})$ and $\mathcal{U} \subset C(\bar{\Omega}_{\text{out}})$. Then for any $\varepsilon > 0$, there exists a neural network-based operator $\mathcal{G}_\theta$ such that:

$$ \sup_{f \in \mathcal{A}} \sup_{y \in \bar{\Omega}_{\text{out}}} \left| \mathcal{G}_\theta(f)(y) - \mathcal{G}(f)(y) \right| < \varepsilon \tag{5.5} $$
Contrast with Theorem 3.1: The classical universal approximation theorem says a NN can approximate any function $f: \mathbb{R}^n \to \mathbb{R}$. Theorem 5.1 says a NN-based architecture can approximate any continuous operator $\mathcal{G}: \mathcal{A} \to \mathcal{U}$ (mapping functions to functions). This is a much stronger statement — it operates in infinite-dimensional spaces.
5.4 — DeepONet: The Branch-Trunk Architecture

The Deep Operator Network (DeepONet, Lu et al. 2021) is a direct realization of Theorem 5.1. It decomposes the operator into two sub-networks:

Branch network $\mathbf{b}_\theta$: encodes the input function $f$. The input function is evaluated at $m$ fixed sensor locations $\{\xi_1, \ldots, \xi_m\} \subset \Omega$:

$$ \text{Input to branch:} \quad \bigl[f(\xi_1),\, f(\xi_2),\, \ldots,\, f(\xi_m)\bigr] \in \mathbb{R}^m \tag{5.6} $$

Trunk network $\mathbf{t}_\theta$: encodes the output query location $y \in \Omega$.

Both networks output vectors of the same dimension $q$. The operator evaluation is:

$$ \mathcal{G}_\theta(f)(y) = \sum_{k=1}^{q} b_k\!\left(f(\xi_1), \ldots, f(\xi_m)\right)\; t_k(y) + b_0 \tag{5.7} $$

or in compact notation:

$$ \mathcal{G}_\theta(f)(y) = \mathbf{b}_\theta\!\left(\mathbf{f}_{\text{sensors}}\right) \cdot \mathbf{t}_\theta(y) + b_0 \tag{5.8} $$
Structure of DeepONet — compare with (2.1):

Classical: $\tilde{u}(x) = \sum_{j=1}^N c_j\,\phi_j(x)$ — fixed coefficients $c_j$, fixed basis $\phi_j$

DeepONet: $\mathcal{G}_\theta(f)(y) = \sum_{k=1}^q b_k(f)\;t_k(y)$ — coefficients $b_k$ depend on $f$ (learned by the branch), basis $t_k$ is also learned (by the trunk).

This is a nonlinear generalization of a basis expansion where both the coefficients and the basis functions are adaptive.
5.5 — Fourier Neural Operator (FNO)

The Fourier Neural Operator (Li et al. 2021) takes a different approach: instead of separating branch and trunk, it processes the input function through layers that mix information in Fourier space.

Let $v^{(\ell)}(x)$ be the hidden representation at layer $\ell$. Each FNO layer applies:

$$ v^{(\ell+1)}(x) = \sigma\!\left( W^{(\ell)}\,v^{(\ell)}(x) + \left(\mathcal{K}^{(\ell)} v^{(\ell)}\right)\!(x) + b^{(\ell)} \right) \tag{5.9} $$

where $W^{(\ell)}$ is a pointwise linear transformation and $\mathcal{K}^{(\ell)}$ is an integral kernel operator implemented via the Fourier transform:

$$ \left(\mathcal{K}^{(\ell)} v^{(\ell)}\right)\!(x) = \mathcal{F}^{-1}\!\left[ R^{(\ell)} \cdot \mathcal{F}\!\left[v^{(\ell)}\right] \right]\!(x) \tag{5.10} $$

Here $\mathcal{F}$ and $\mathcal{F}^{-1}$ are the Fourier and inverse Fourier transforms (implemented via FFT), and $R^{(\ell)} \in \mathbb{C}^{d_v \times d_v \times k_{\max}}$ is a learnable tensor of Fourier coefficients, truncated at $k_{\max}$ modes.

Why Fourier space? The integral kernel $\mathcal{K}$ in physical space would be $(\mathcal{K}v)(x) = \int_\Omega \kappa(x, y)\,v(y)\,dy$ — expensive to evaluate ($O(M^2)$ for $M$ grid points). By the convolution theorem, if $\kappa(x,y) = \kappa(x-y)$ (translation-invariant), this becomes pointwise multiplication in Fourier space — $O(M \log M)$ via FFT. FNO learns the kernel directly in Fourier space, bypassing the expensive spatial integral.

Truncation at $k_{\max}$ acts as a spectral filter: only the lowest $k_{\max}$ modes are learned, which provides implicit regularization and controls the smoothness of the output.
5.6 — Comparison: PINNs vs. Neural Operators
PINNs DeepONet FNO
Learns One function $u_\theta$ Operator $\mathcal{G}_\theta: f \mapsto u$ Operator $\mathcal{G}_\theta: f \mapsto u$
Training data Collocation points (no solver needed) Input–output pairs from solver Input–output pairs from solver
New $f$ at inference Retrain from scratch Single forward pass Single forward pass
Physics enforcement Built into loss ($\mathcal{J}_r$) Through data (optional physics loss) Through data (optional physics loss)
Input discretization Mesh-free Fixed sensors $\{\xi_i\}$ Uniform grid (FFT)
Resolution invariance Yes (continuous $x$) Trunk: yes; Branch: fixed $m$ Yes (zero-pad in Fourier space)
Theoretical basis Weighted residuals + UAT Operator UAT (Chen & Chen 1995) Operator UAT + spectral theory
5.7 — Physics-Informed Neural Operators

A natural question: can we combine the operator learning framework with the physics-informed loss from PINNs? Yes — this gives physics-informed neural operators (PINO, Li et al. 2024).

The PINO loss combines data-driven and physics-driven terms:

$$ \mathcal{J}_{\text{PINO}}(\theta) = \underbrace{\frac{1}{N_{\text{train}}} \sum_{i=1}^{N_{\text{train}}} \left\| \mathcal{G}_\theta(f^{(i)}) - u^{(i)} \right\|^2}_{\text{data loss (as in 5.3)}} \;+\; \lambda_r \underbrace{\frac{1}{N_{\text{train}}} \sum_{i=1}^{N_{\text{train}}} \frac{1}{N_r} \sum_{j=1}^{N_r} \left| \mathcal{L}\!\left[\mathcal{G}_\theta(f^{(i)})\right]\!(x_j) - f^{(i)}(x_j) \right|^2}_{\text{PDE residual loss (collocation on the operator output)}} \tag{5.11} $$
PINO closes the loop: it uses solver data and the PDE residual simultaneously. The physics loss acts as a regularizer that enforces PDE consistency even for inputs $f$ not seen during training. This improves generalization and can reduce the amount of training data needed.

The full picture from Section 1 to here:
Weighted residuals $\to$ Collocation $\to$ NN approximation $\to$ PINNs $\to$ Neural Operators $\to$ PINO
Each step generalizes the previous one. The residual idea from Section 1 is still present in (5.11) — it never left.
Check Question 5

(a) In DeepONet (equation 5.7), the branch outputs coefficients $b_k(f)$ and the trunk outputs basis functions $t_k(y)$. Compare this structure to the classical approximation (2.1): $\tilde{u}(x) = \sum_j c_j\,\phi_j(x)$. What is fixed and what is learned in each case?

(b) Why does FNO require a uniform grid, while DeepONet does not (for the trunk)? What property of the FFT creates this constraint?

Answer:

(a) In the classical approximation (2.1), $\tilde{u}(x) = \sum_{j=1}^N c_j\,\phi_j(x)$: the basis functions $\phi_j$ are fixed (chosen a priori — e.g., polynomials, hat functions), and the coefficients $c_j$ are fixed scalars determined by solving the linear system. Both are independent of the input $f$; if $f$ changes, we must solve the system again to get new $c_j$.

In DeepONet (5.7), $\mathcal{G}_\theta(f)(y) = \sum_{k=1}^q b_k(f)\,t_k(y)$: the trunk outputs $t_k(y)$ play the role of basis functions, but they are learned (not chosen a priori). The branch outputs $b_k(f)$ play the role of coefficients, but they are functions of the input $f$ — so the same trained network instantly produces new coefficients for any new forcing. In summary:

Classical (2.1) DeepONet (5.7)
Basis functions $\phi_j(x)$ — fixed, chosen a priori $t_k(y)$ — learned by trunk network
Coefficients $c_j$ — fixed scalars (from linear solve) $b_k(f)$ — depend on input $f$ (from branch)
New input $f$ Must re-solve system Single forward pass through branch

(b) FNO requires a uniform grid because it relies on the Fast Fourier Transform (FFT) to implement the spectral convolution (5.10). The FFT algorithm assumes uniformly spaced samples — this is a fundamental requirement of the discrete Fourier transform, which exploits the periodicity and uniform spacing structure to achieve $O(M \log M)$ complexity. On a non-uniform grid, the FFT cannot be applied directly (one would need the NUFFT, which is more expensive and approximate).

DeepONet's trunk network, by contrast, takes the query coordinate $y$ as a continuous input to a standard neural network — it can evaluate $t_k(y)$ at any point $y \in \Omega$, regardless of how the input $f$ was discretized. This gives the trunk full resolution invariance on the output side.