第34回:解を学ぶのではなくsolution operatorを学ぶ

ChatGPTで作る有限要素プログラム入門 Season 3 第10回(通算第34回)

はじめに――PDE solverからfunction-space mapへ

第25–33回では,一つのPDE problemに対して Deep Ritz,PINNs,mixed neural formulationを作ってきました.

しかしright-hand side \(f\) が変わるたびに新しいsolutionを求めるなら, 本当に扱っている対象は一つの関数 \(u\) ではありません.

PDEが定める

\[ \boxed{ S: f \longmapsto u } \tag{1} \]

というsolution operatorです.

第34回の問い
\[ \boxed{ \text{一つの解 }u \text{ を近似することと, solution operator }S \text{ を近似することは何が違うか?} } \tag{2} \]

1.Poisson equationをoperator equationとして書く

まず

\[ -\Delta u=f \quad\text{in }\Omega, \qquad u=0 \quad\text{on }\partial\Omega \tag{3} \]

を考えます.

\(V=H_0^1(\Omega)\) とし,

\[ \boxed{ a(u,v) = \int_\Omega \nabla u\cdot\nabla v\,dx } \tag{4} \]

と置けば,

\[ a(u,v) = \langle f,v\rangle \qquad \forall v\in V. \tag{5} \]

2.solution operatorは \(V^\ast\to V\) の写像である

operator

\[ \mathcal A:V\to V^\ast \]

を

\[ \boxed{ \langle\mathcal Au,v\rangle = a(u,v) } \tag{6} \]

で定めます.

Poisson solution operatorは

\[ \boxed{ S = \mathcal A^{-1} : V^\ast \to V. } \tag{7} \]

つまり「PDEを解く」とは \[ f \] を一つ入れて \[ Sf \] を評価することです.

3.well-posednessはoperator stabilityである

一般のcoercive bilinear formについて

\[ a(v,v) \ge \alpha \|v\|_V^2 \tag{8} \]

ならLax–Milgramから

\[ \boxed{ \|Sf\|_V \le \frac1\alpha \|f\|_{V^\ast}. } \tag{9} \]

従って

\[ \boxed{ \|Sf-Sg\|_V \le \frac1\alpha \|f-g\|_{V^\ast}. } \tag{10} \]

これはsolution operatorのLipschitz stabilityです.

4.linear PDEではsolution operatorもlinearである

Poisson problemでは

\[ \boxed{ S(\lambda f+\mu g) = \lambda Sf+\mu Sg. } \tag{11} \]

従って一つのfixed \(f\) に対するsolution approximationより, \(S\) 全体を近似する方がはるかに多くの構造を含んでいます.

nonlinear PDEではsolution mapもnonlinearになりますが, その場合はまずuniquenessを持つparameter regimeを指定する必要があります.

5.FEMはすでにsolution operatorを近似している

finite element space

\[ V_h \subset V \]

に対して

\[ \boxed{ a(S_hf,v_h) = \langle f,v_h\rangle \qquad \forall v_h\in V_h } \tag{12} \]

で

\[ \boxed{ S_h: V^\ast \to V_h } \tag{13} \]

を定めます.

通常は一つのload vectorをsolveしますが, 数学的には \(S_h\) はすべてのright-hand sideに作用する discrete solution operatorです.

6.Céa estimateもoperator approximationとして読める

bilinear formのcontinuity constantを \(M\) とすると

\[ \boxed{ \|Sf-S_hf\|_V \le \frac{M}{\alpha} \inf_{v_h\in V_h} \|Sf-v_h\|_V. } \tag{14} \]

入力class \(\mathcal K\subset V^\ast\) に対して

\[ \boxed{ \sup_{f\in\mathcal K} \|Sf-S_hf\|_V } \tag{15} \]

を考えれば, これはfunction class全体に対するoperator approximation errorです.

7.FEMのdiscrete operatorを三段階に分解する

basis \[ \{\phi_1,\ldots,\phi_n\} \] を取り,

\[ \boxed{ K_{ij} = a(\phi_j,\phi_i) } \tag{16} \]

とします.

load mapを

\[ \boxed{ B_hf = \bigl( \langle f,\phi_1\rangle, \ldots, \langle f,\phi_n\rangle \bigr)^{\top} } \tag{17} \]

とし,coefficient vectorを \(\boldsymbol a\) とすれば

\[ K\boldsymbol a = B_hf. \tag{18} \]

8.FEM operatorのfactorisation

coefficient vectorからfunctionへ戻すreconstructionを

\[ E_h\boldsymbol a = \sum_{j=1}^n a_j\phi_j \]

とします.

すると

\[ \boxed{ S_h = E_h K^{-1} B_h. } \tag{19} \]

つまり

\[ \boxed{ f \overset{B_h}{\longmapsto} \text{finite observations} \overset{K^{-1}}{\longmapsto} \text{coefficients} \overset{E_h}{\longmapsto} u_h. } \tag{20} \]

FEM自身が既にfinite-dimensional operator pipelineを持っています.

9.ここでの「観測」はpoint valueではなくweak momentである

式 (17) に現れる情報は

\[ \boxed{ \langle f,\phi_i\rangle } \tag{21} \]

です.

これは \[ f(x_i) \] というpoint sampleではありません.

FEMはtest functionsを通して right-hand sideのweak momentsを有限個取り出しています.

10.1次元P1 FEMではoperator matrixを直接書ける

\(\Omega=(0,1)\) の一様P1 meshで, \(f_h\) もinterior hat basisで

\[ f_h = \sum_{j=1}^n c_j\phi_j \]

と表すとload vectorは

\[ \boxed{ \boldsymbol b = M\boldsymbol c, } \tag{22} \]

ここで \(M\) はmass matrixです.

solution coefficientsは

\[ \boxed{ \boldsymbol a = K^{-1}M\boldsymbol c. } \tag{23} \]

11.discrete solution operator matrix

したがってcoefficient space上のsolution operatorは

\[ \boxed{ T_h = K^{-1}M. } \tag{24} \]

一つの \(f_h\) をsolveする代わりに, matrix \(T_h\) 全体を考えれば

\[ \boxed{ \boldsymbol c \longmapsto T_h\boldsymbol c } \tag{25} \]

が離散operator learningの最も単純なbaselineになります.

12.1次元operator matrixをコードで作る

import numpy as np

def p1_poisson_operator(n_dof):
    h = 1.0 / (n_dof + 1)

    K = np.zeros(
        (n_dof, n_dof)
    )

    M = np.zeros(
        (n_dof, n_dof)
    )

    for i in range(n_dof):
        K[i, i] += 2.0 / h
        M[i, i] += 2.0 * h / 3.0

        if i + 1 < n_dof:
            K[i, i + 1] += -1.0 / h
            K[i + 1, i] += -1.0 / h

            M[i, i + 1] += h / 6.0
            M[i + 1, i] += h / 6.0

    T = np.linalg.solve(K, M)

    return K, M, T

13.operator datasetは一つのsolution pairではない

input coefficient vectors

\[ \boldsymbol c^{(1)}, \ldots, \boldsymbol c^{(N_{\rm train})} \]

を作り,

\[ \boxed{ \boldsymbol a^{(k)} = T_h \boldsymbol c^{(k)} } \tag{26} \]

をtraining pairsとします.

datasetの一行は

\[ \boxed{ \text{one function} \longmapsto \text{another function} } \tag{27} \]

を離散化したものです.

14.linear operatorならlinear networkでbaselineを作れる

n = 63

model = torch.nn.Linear(
    n,
    n,
    bias=False
)

optimizer = torch.optim.Adam(
    model.parameters(),
    lr=1.0e-3
)

for step in range(5000):
    c = torch.randn(
        256,
        n,
        dtype=torch.float64
    )

    with torch.no_grad():
        target = c @ T.T

    pred = model(c)

    loss = torch.mean(
        (pred - target) ** 2
    )

    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

このtoy problemではtarget operator自体がlinearなので, 十分にrichなtraining dataがあればlinear mapで学習可能です.

ここではneural networkを複雑にすることが目的ではなく, 「solutionではなくmapを学ぶ」最小例を作っています.

15.operator learningのabstract form

input function spaceを \(X\),output spaceを \(Y\) として

\[ \boxed{ S: X \to Y. } \tag{28} \]

operator learnerを

\[ \boxed{ \mathcal G_\theta: X \to Y } \tag{29} \]

と書けば,目標は

\[ \boxed{ \mathcal G_\theta \approx S } \tag{30} \]

です.

これはfixed \(f\) に対する \[ u_\theta\approx Sf \] より一段上の近似問題です.

16.実装ではinput functionを有限情報へ落とす

実際のcomputerへfunction \(f\) をそのまま渡すことはできません. そこでobservation map

\[ \boxed{ \mathcal O_m: X \to \mathbb R^m } \tag{31} \]

を使い,

\[ \boxed{ \mathcal O_m f = \bigl( \ell_1(f), \ldots, \ell_m(f) \bigr) } \tag{32} \]

とします.

\(\ell_j\) はpoint evaluationでもmomentでも構いませんが, input space上でwell-definedである必要があります.

17.point sensorはinput spaceによっては定義できない

もし \[ X=L^2(\Omega) \] なら

\[ \boxed{ f \longmapsto f(x_j) } \tag{33} \]

は一般の \(L^2\) equivalence class上ではwell-definedではありません.

point sensorsを使うなら, continuous input classや \[ H^s(\Omega), \qquad s>d/2 \] のようにpoint evaluationが意味を持つregularityを仮定する必要があります.

18.weak sensorsなら低regularity inputにも使いやすい

例えば

\[ \boxed{ \ell_j(f) = \langle f,\psi_j\rangle } \tag{34} \]

というmoment observationなら, \(\psi_j\) を適切に選ぶことで \(V^\ast\) inputにも自然に使えます.

FEMのload map \[ B_h \] はまさにこの形でした.

19.operator learnerは実際にはfinite-observation learnerである

computer上のmodelは通常

\[ \boxed{ G_\theta: \mathbb R^m \to Y } \tag{35} \]

として

\[ \boxed{ f \longmapsto \mathcal O_mf \longmapsto G_\theta(\mathcal O_mf) } \tag{36} \]

を実行します.

つまりoperator learningには最初から finite observation bottleneckが入っています.

20.input reconstructionを明示するとerrorを分解できる

observation vectorからinput functionを再構成するmap

\[ \boxed{ I_m: \mathbb R^m \to X } \tag{37} \]

を考えます.

すると

\[ Sf - G_\theta(\mathcal O_mf) \]

を

\[ \boxed{ \begin{aligned} Sf-G_\theta(\mathcal O_mf) ={}& S\bigl( f-I_m\mathcal O_mf \bigr) \\ &+ \Bigl[ S(I_m\mathcal O_mf) - G_\theta(\mathcal O_mf) \Bigr] \end{aligned} } \tag{38} \]

と分けられます.

21.observation errorはPDE stabilityを通してsolution errorになる

solution operatorが

\[ \|Sf-Sg\|_Y \le C_S \|f-g\|_X \]

を満たすなら,式 (38) から

\[ \boxed{ \begin{aligned} \|Sf-G_\theta(\mathcal O_mf)\|_Y \le{}& C_S \|f-I_m\mathcal O_mf\|_X \\ &+ \|S(I_m\mathcal O_mf)-G_\theta(\mathcal O_mf)\|_Y. \end{aligned} } \tag{39} \]

第一項はobservation / reconstruction error, 第二項はlearned operator errorです.

22.point placementがoperator errorへ入る場所

sensor points \[ x_1,\ldots,x_m \] を変えると,

\[ \mathcal O_m \]

も \[ I_m \]

も変わります.

従って

\[ \boxed{ \text{sensor geometry} \longrightarrow \text{input reconstruction} \longrightarrow \text{solution operator error}. } \tag{40} \]

Season 3前半のcollocation-point geometryが, ここではinput information geometryになります.

23.outputも有限次元へ落とす必要がある

output function \(u\in Y\) もcomputer上では

\[ \boxed{ \mathcal Q_n: Y \to \mathbb R^n } \tag{41} \]

で表します.

例えば

  • FEM coefficients,
  • grid values,
  • spectral coefficients,
  • query pointでのvalues,

などです.

input observationsだけでなくoutput representationのgeometryもoperator approximationに入ります.

24.FEM coefficientsをoutputにするoperator learner

最もFEMに近い設計は

\[ \boxed{ \widehat G_\theta: \mathbb R^m \to \mathbb R^n } \tag{42} \]

でsolution coefficientsを予測し,

\[ \boxed{ u_\theta = E_h \widehat G_\theta(\mathcal O_mf) } \tag{43} \]

とする方法です.

この場合output spaceとbasisが明示されるので, \(L^2\)・\(H^1\) errorをFEM matricesで評価しやすくなります.

25.query pointを入力するoperator learner

別の設計では

\[ \boxed{ G_\theta( \mathcal O_mf, x ) \approx (Sf)(x) } \tag{44} \]

としてquery point \(x\) ごとにsolution valueを返します.

DeepONetのbranch / trunk構造はこの考え方の代表例です.

この場合は input sensor geometryと output query geometry の両方を記録する必要があります.

26.neural operatorという言葉だけでmesh-freeとは言えない

architectureがfunction-space mapを意図していても, training dataは有限gridや有限sensorsから作られます.

従って

\[ \boxed{ \text{operator architecture} \quad\not\Rightarrow\quad \text{geometry-free computation}. } \tag{45} \]

discretisation independenceを主張するなら, 入力・出力resolutionを変えたtestを別途行う必要があります.

27.training objectiveはinput distributionに依存する

training functionsをprobability measure \(\mu\) から取るなら

\[ \boxed{ \min_\theta \mathbb E_{f\sim\mu} \left[ \| G_\theta(\mathcal O_mf)-Sf \|_Y^2 \right]. } \tag{46} \]

これは

\[ \boxed{ \text{average-case approximation under }\mu } \tag{47} \]

です.

\(\mu\) の外にあるforcingへ精度が保たれることは, training lossだけからは言えません.

28.worst-case operator approximationは別の問題である

input class \(\mathcal K\subset X\) に対して

\[ \boxed{ E_{\rm op} = \sup_{f\in\mathcal K} \| G_\theta(\mathcal O_mf)-Sf \|_Y } \tag{48} \]

を考えると, distribution averageより強い評価になります.

operator learningの性能を論じるときは average-caseとworst-caseを区別します.

29.training functionsのspanだけ学んでいないか監査する

例えばtraining forcingを

\[ f(x) = \sum_{k=1}^{p} c_k \sin(k\pi x) \tag{49} \]

だけから作れば, modelはこのlow-dimensional familyに非常に強くなれます.

しかしそれは

\[ \boxed{ S \text{ on all of }X } \]

を学んだこととは違います.

testではfrequency range,regularity,localisationを変えます.

30.operator stabilityとdataset difficultyを混同しない

PDE operatorがstableでも, observation mapがill-conditionedならinput reconstructionは不安定になります.

逆にsensor mapがよくても, PDE itselfがparameterに対してsensitiveならsolution mapが大きく変化します.

従って

\[ \boxed{ \text{PDE stability} + \text{observation stability} + \text{learning stability} } \tag{50} \]

を別々に見る必要があります.

31.parameter-to-solution mapへ拡張する

inputはright-hand sideだけとは限りません.

例えば

\[ -\nabla\cdot( a(x)\nabla u ) = f \]

なら

\[ \boxed{ S: (a,f) \longmapsto u. } \tag{51} \]

さらにboundary dataやgeometry parameterを含めて

\[ \boxed{ S: (a,f,g,\text{geometry}) \longmapsto u } \tag{52} \]

とすることもできます.

ただしinput spaceとwell-posed parameter setを先に定義しなければ, 「operator」の意味が曖昧になります.

32.nonlinear PDEではsolution mapのsingle-valuednessを確認する

Navier–Stokesやnonlinear reaction problemでは, 同じinputに複数solutionがあり得るparameter regimeがあります.

その場合

\[ \boxed{ S:f\mapsto u } \tag{53} \]

というsingle-valued operatorを無条件に置いてはいけません.

uniqueness regimeを制限するか, solution branchを追加情報で指定する必要があります.

33.physics-informed operator learningも作れる

training pair \((f,u)\) を大量に用意する代わりに, operator output

\[ u_\theta(f) = G_\theta(\mathcal O_mf) \]

へPDE residualを課すこともできます.

例えばstrong formを使えば

\[ \boxed{ \mathcal L_{\rm PDE} = \mathbb E_{f\sim\mu} \left[ \| -\Delta G_\theta(\mathcal O_mf)-f \|_{L^2}^2 \right]. } \tag{54} \]

となります.この場合はinput functionsとspatial collocation pointsの 二種類のsamplingが入ります.

ただし,operator learningそのものがstrong formを意味するわけではありません.Poisson problemなら,FEMと同じweak formulationを使って

\[ \boxed{ a\bigl(G_\theta(\mathcal O_mf),v\bigr) \approx \langle f,v\rangle \qquad \forall v\in V } \]

と課すこともできます.有限個のtest functions \(v_1,\ldots,v_M\) を使うなら,例えば

\[ \boxed{ \mathcal L_{\rm weak}(\theta) = \mathbb E_{f\sim\mu} \sum_{j=1}^{M} \left| a\bigl(G_\theta(\mathcal O_mf),v_j\bigr) - \langle f,v_j\rangle \right|^2 } \]

というGalerkin型のlossが自然です.strong residualでは二階微分とcollocation geometryが前面に出ますが,weak formではtest space,quadrature,stabilityが中心になります.FEMからoperator learningを見るなら,この違いを分けておく必要があります.

34.mixed operator learningへも拡張できる

第33回のfluxを含めれば

\[ \boxed{ \mathcal G_\theta: f \longmapsto ( u_\theta(f), \boldsymbol q_\theta(f) ) } \tag{55} \]

というoperatorを学べます.

すると各input \(f\) に対して

\[ \boldsymbol q_\theta(f) \approx A\nabla u_\theta(f), \]

\[ \nabla\cdot\boldsymbol q_\theta(f) \approx -f \]

を監査できます.

35.many-query problemでoperator approximationが意味を持つ

一つの \(f\) しか解かないなら, 高精度FEM solveを直接行う方が単純な場合があります.

operator approximationが特に意味を持つのは

\[ \boxed{ f^{(1)},f^{(2)},\ldots,f^{(N_{\rm query})} } \tag{56} \]

のように多数のqueriesを繰り返すときです.

ただしoffline training costを含めて比較しなければ, 「高速化」を公平に評価できません.

36.FEM baselineを必ず残す

operator learnerを評価するときは

\[ \boxed{ S_h = E_hK^{-1}B_h } \tag{57} \]

というphysics-defined discrete operatorをbaselineに残します.

比較すべきなのは

  • offline construction / training cost,
  • online evaluation cost,
  • input observation cost,
  • solution error,
  • out-of-distribution stability,

です.

37.finite observationの限界は次回の主題である

もし

\[ \boxed{ \mathcal O_mf_1 = \mathcal O_mf_2 } \tag{58} \]

なら,deterministic learnerは

\[ \boxed{ G_\theta(\mathcal O_mf_1) = G_\theta(\mathcal O_mf_2) } \tag{59} \]

としか出力できません.

しかしPDE solutionが \[ Sf_1\ne Sf_2 \] なら,有限観測だけでは両者を同時に正しく再構成できません.

次回はこのinformation lossを定量化します.

38.AIがoperator learningで間違えやすい点

mistake何が壊れるか
一つのPDE solutionを学んでoperator learningと呼ぶinput function dependenceを持たない
\(L^2\) inputにpoint evaluationを無条件に使うobservation map自体がwell-definedでない
training distribution averageをuniform operator errorと呼ぶaverage-caseとworst-caseを混同する
sensor geometryをarchitecture detailとみなすinput information lossを無視する
grid-free architectureだからgeometry-freeとするtraining discretisationを消してしまう
FEMをsingle-solve methodとしてしか比較しないdiscrete solution operator baselineを見落とす
nonlinear PDEでuniquenessを確認せずsolution operatorを書くmapがsingle-valuedでない可能性を無視する
physics-informed operator learningをstrong residualだけに限定するweak / Galerkin formulationとtest-space stabilityを見落とす

39.solution-operator audit prompt

Audit prompt
このPDE operator-learning implementationを数学的に監査してください.
(1) input space \(X\),output space \(Y\),solution operator \(S:X\to Y\) を明示しているか,
(2) PDE well-posednessからoperator stability constantを確認しているか,
(3) FEM baselineを \(S_h=E_hK^{-1}B_h\) というoperatorとして比較しているか,
(4) input observation functionals \(\ell_j\) がinput space上でwell-definedか,
(5) point sensorsを使う場合,必要なinput regularityを明示しているか,
(6) observation / reconstruction errorとlearned-operator errorを分離しているか,
(7) input sensor geometryとoutput representation geometryを保存しているか,
(8) training distribution averageとworst-case operator errorを区別しているか,
(9) training forcing familyのspan / frequency / regularityを記録しているか,
(10) nonlinear PDEではsolution mapのuniqueness regimeを確認しているか,
(11) physics-informed operator learningではstrong / weak formulationのどちらを使うか明示し,strong formならcollocation sampling,weak formならtest space・quadrature・stabilityを監査しているか,
(12) offline training costとonline query costを両方報告しているか
を順に確認してください.

40.第34回の結論

PDEを一つのsolutionとして見ると

\[ f \mapsto u \]

は一回のsolveに見えます.

しかし本質的には

\[ \boxed{ S: X \to Y } \tag{60} \]

というfunction-space mapです.

FEMも

\[ \boxed{ S_h = E_hK^{-1}B_h } \tag{61} \]

としてsolution operatorをfinite-dimensionalに近似しています.

operator learningではさらに

\[ \boxed{ f \longrightarrow \mathcal O_mf \longrightarrow G_\theta(\mathcal O_mf) } \tag{62} \]

と有限観測を通します.

したがってerrorには

\[ \boxed{ \text{PDE approximation} + \text{finite observation} + \text{operator representation} + \text{training} } \tag{63} \]

が重なります.

Season 3 第10回の原則
operator learningでは「何を学ぶか」だけでなく, functionをどの有限情報へ落とし,どのfunction spaceのnormでmapを比較するかを先に決める.

次回はこの有限観測そのものを正面から扱い, 第35回:sensor pointsをどこに置くか — 有限観測の限界 へ進みます.

参考文献・関連ページ

  1. L. Lu, P. Jin, G. Pang, Z. Zhang and G. E. Karniadakis, “Learning nonlinear operators via DeepONet based on the universal approximation theorem of operators”, Nature Machine Intelligence 3 (2021), 218–229.
  2. Z. Li et al., “Fourier Neural Operator for Parametric Partial Differential Equations”, International Conference on Learning Representations, 2021.
  3. N. Kovachki et al., “Neural Operator: Learning Maps Between Function Spaces With Applications to PDEs”, Journal of Machine Learning Research 24 (2023).
  4. S. C. Brenner and L. R. Scott, The Mathematical Theory of Finite Element Methods, 3rd ed., Springer, 2008.
  5. 第25回:Deep Ritz法を作る — FEMのenergy minimisationからneural trial spaceへ
  6. 第26回:Deep Ritzでは点をどこに置くか — quadratureとsampling geometry
  7. 第33回:保存則をニューラルPDEへ入れる — mixed formulationとflux

ページの先頭へ