第30回:角特異性をPINNsは捉えられるか — regularityとgraded sampling

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

はじめに――smooth networkを使えばsolutionもsmoothになるわけではない

これまでのPINN実験ではexact solutionをsmoothに選んでいました. しかしpolygonal domainでは,dataがsmoothでもcornerがsolution regularityを制限します.

FEMではこのregularity lossが

\[ \boxed{ \text{convergence rate} \quad+\quad \text{mesh grading} } \tag{1} \]

を決めます. PINNsでも同じ問いが残ります.

第30回の問い
\[ \boxed{ \text{角特異性を持つsolutionに対して, collocation pointsを一様に置いてよいのか?} } \tag{2} \]

1.model domainはre-entrant sector

cornerの効果だけを切り出すため,polar coordinatesで

\[ \boxed{ \Omega_\omega = \{ (r,\theta): 0<r<1,\ 0<\theta<\omega \} } \tag{3} \]

を考えます.

re-entrant angleとして

\[ \boxed{ \omega = \frac{3\pi}{2} } \tag{4} \]

を選びます. これはL-shaped domainのre-entrant cornerと同じlocal angleです.

2.Poisson–Dirichlet corner exponent

wedgeでharmonic separated mode

\[ u(r,\theta) = r^\lambda\Phi(\theta) \]

を考えると

\[ \Phi''+\lambda^2\Phi=0, \qquad \Phi(0)=\Phi(\omega)=0. \]

従って

\[ \boxed{ \lambda_k = \frac{k\pi}{\omega}, \qquad k=1,2,\ldots } \tag{5} \]

です.

3.re-entrant angle \(3\pi/2\) では \(\lambda_1=2/3\)

式 (5) から

\[ \boxed{ \lambda = \lambda_1 = \frac{\pi}{3\pi/2} = \frac23. } \tag{6} \]

したがって最も単純なsingular harmonic modeは

\[ \boxed{ u^\ast(r,\theta) = r^{2/3} \sin\left(\frac{2\theta}{3}\right). } \tag{7} \]

です.

4.このsolutionはharmonicだが \(H^2\) ではない

corner away from \(r=0\) では

\[ \boxed{ \Delta u^\ast=0. } \tag{8} \]

一方

\[ D^m u^\ast \sim r^{2/3-m}. \tag{9} \]

2次元のSobolev integrabilityから, genuine singular modeに対するthresholdは

\[ \boxed{ s < 1+\lambda = \frac53. } \tag{10} \]

従って任意の \(\varepsilon>0\) に対して

\[ \boxed{ u^\ast \in H^{5/3-\varepsilon}(\Omega_\omega), \qquad u^\ast \notin H^2(\Omega_\omega). } \tag{11} \]

5.PINN strong residualとのregularity mismatch

Poisson PINNは通常

\[ r_\theta = -\Delta u_\theta-f \]

をpointwiseに評価します. network \(u_\theta\) はsmoothに作れても, target \(u^\ast\) は \(H^2\) に入りません.

従って

\[ \boxed{ \text{smooth trial function} \quad\text{で}\quad \text{low-regularity weak solution} \quad\text{を近似する} } \tag{12} \]

という構造になります.

6.strong residualがzeroでもsingularityは簡単ではない

今回のexact solutionは \[ \Delta u^\ast=0 \] なので,corner以外ではstrong residualはzeroです.

しかしgradientは

\[ \boxed{ |\nabla u^\ast| \sim r^{-1/3}, } \tag{13} \]

Hessian componentsは

\[ \boxed{ |D^2u^\ast| \sim r^{-4/3}. } \tag{14} \]

つまり

\[ \boxed{ \text{PDE residualの値} \quad\text{だけでは}\quad \text{solution regularityの難しさは見えない.} } \tag{15} \]

7.corner pointそのものをstrong residual pointにしてはいけない

\(r=0\) ではclassical second derivativesがsingularです. 従ってcornerをinterior collocation pointとして automatic differentiationへ直接渡すのは適切ではありません.

corner value \[ u^\ast(0)=0 \] をboundary informationとして使うことと,

\[ \boxed{ -\Delta u_\theta(0) } \tag{16} \]

をclassical residualとして評価することは別です.

8.Deep Ritzとの対照がここで明確になる

Deep RitzのPoisson energyは

\[ E(v) = \frac12\int_\Omega|\nabla v|^2\,dx - \int_\Omega fv\,dx. \tag{17} \]

今回のsingular solutionは

\[ u^\ast\in H^1(\Omega_\omega) \] なのでenergyは自然に定義できます.

従って

\[ \boxed{ \text{weak / energy formulation} \text{ は} H^1\text{-solution regularityと整合しやすい} } \tag{18} \]

のに対し,strong residualでは二階微分を計算する実装が必要です.

9.uniform-area samplingではcorner近傍の点が非常に少ない

sector内をarea-uniformにrandom samplingすると, radial variable \(r\) のdistributionは

\[ \boxed{ \mathbb P(r<\rho) = \rho^2. } \tag{19} \]

従って全 \(N\) pointsのうち \(r<\rho\) に入るexpected countは

\[ \boxed{ N_{\rho}^{\rm area} = N\rho^2. } \tag{20} \]

10.\(r<0.1\) には全体の1%しか入らない

例えば \(N=1000\) なら

\[ N_{0.1}^{\rm area} = 1000\times0.1^2 = 10. \]

つまりre-entrant cornerから距離0.1以内には expected 10 pointsしかありません.

corner singularityが最も強い場所ほど, area-uniform samplingでは点数が少なくなります.

11.radial graded samplingを導入する

\(U,V\sim U(0,1)\) を独立に取り,

\[ \boxed{ r = U^\gamma, \qquad \theta = \omega V } \tag{21} \]

とします.

\(\gamma=1/2\) ならarea-uniformです.

\[ \boxed{ \gamma>\frac12 } \tag{22} \]

とするとpointsはcornerへ強くclusterします.

12.graded familyのcorner point fractionはexactに計算できる

式 (21) から

\[ \boxed{ \mathbb P(r<\rho) = \rho^{1/\gamma}. } \tag{23} \]

従って \(\rho=0.1\) なら

\(\gamma\) sampling \(\mathbb P(r<0.1)\) expected count for \(N=1000\)
\(1/2\)area-uniform\(0.01\)10
\(3/4\)moderately graded\(0.0464\)46
\(1\)radially uniform\(0.1\)100
\(2\)strongly graded\(0.316\)316

13.regularity exponentからgradingを考える一つのheuristic

singular mode \(u_s=r^\lambda\Phi(\theta)\) では

\[ |\nabla u_s|^2 \sim r^{2\lambda-2}. \]

area element \(r\,dr\,d\theta\) を含めると, corner近傍のenergy densityのradial scalingは

\[ \boxed{ r^{2\lambda-1}\,dr. } \tag{24} \]

従ってradius \(\rho\) までのenergy fractionは

\[ \boxed{ O(\rho^{2\lambda}). } \tag{25} \]

14.\(\lambda=2/3\) ならenergy-aware gradingは \(\gamma=3/4\) が一つの目安になる

graded samplerは

\[ \mathbb P(r<\rho)=\rho^{1/\gamma}. \]

これを式 (25) のenergy fraction \[ \rho^{2\lambda} \] に合わせるheuristicを取ると

\[ \boxed{ \frac1\gamma = 2\lambda, \qquad \gamma = \frac1{2\lambda}. } \tag{26} \]

今回 \(\lambda=2/3\) なので

\[ \boxed{ \gamma = \frac34. } \tag{27} \]

これはPINN errorのoptimal grading theoremではありません. solution energyの局在度からpoint densityを設計する一つのdiagnostic ruleです.

15.strong residual用gradingをHessian magnitudeから決めるのは危険

式 (14) から

\[ |D^2u^\ast|^2 \sim r^{-8/3}. \]

area elementを掛けると

\[ r^{-5/3}\,dr \]

となり,\(r=0\) でintegrableではありません.

従って

\[ \boxed{ |D^2u^\ast|^2 \text{ をそのままsampling densityにする} } \tag{28} \]

という発想はnormalisableですらありません.

しかもexact solutionではLaplacianのsingular componentsがcancelして \[ \Delta u^\ast=0 \] です.

16.graded points + equal weightsはcontinuous lossそのものを変える

式 (21) のgraded samplerにequal weightsを付けると, Cartesian area measureではなく別のsampling densityを見ます.

そのdensityは

\[ \boxed{ q_\gamma(x) = \frac1{\gamma\omega} r^{1/\gamma-2}. } \tag{29} \]

\(\gamma>1/2\) ではcornerへweightが集中します.

従って

\[ \boxed{ \text{graded points + equal weights} = \text{corner-weighted residual objective}. } \tag{30} \]

17.point resolutionだけ変えたいならimportance weightsを使う

normalised area average

\[ \frac1{|\Omega_\omega|} \int_{\Omega_\omega} |r_\theta|^2\,dx \]

をtargetのまま保ち, graded distribution \(q_\gamma\) からsampleするなら importance correctionを使えます.

\(|\Omega_\omega|=\omega/2\) なので, normalised area densityは \(2/\omega\) です.

従ってimportance weightは

\[ \boxed{ W_\gamma(r) = 2\gamma\, r^{2-1/\gamma}. } \tag{31} \]

18.二つのexperimentを分ける

graded sampling studyでは少なくとも

\[ \boxed{ \begin{aligned} \text{A. resolution study} &:\ \text{graded points + importance weights},\\ \text{B. objective study} &:\ \text{graded points + equal weights} \end{aligned} } \tag{32} \]

を分けるべきです.

Aは同じcontinuous residual normをよりcorner-resolvedなsamplesで近似するexperiment, Bは意図的にcornerを重視した別objectiveを学習するexperimentです.

19.graded sector samplerを実装する

def graded_sector_points(
    N,
    omega,
    gamma,
    device,
    generator=None
):
    uv = torch.rand(
        (N, 2),
        device=device,
        generator=generator
    )

    r = uv[:, 0:1] ** gamma
    theta = omega * uv[:, 1:2]

    x = r * torch.cos(theta)
    y = r * torch.sin(theta)

    pts = torch.cat([x, y], dim=1)

    return pts, r

\(\gamma=0.5\) ならarea-uniform, \(\gamma>0.5\) ならcorner-biasedです.

20.importance weightsもコード化する

def area_importance_weight(r, gamma):
    exponent = 2.0 - 1.0 / gamma

    return (
        2.0 * gamma
        * r ** exponent
    )

\(\gamma=0.5\) なら

\[ W_{1/2}(r)=1 \]

となり,通常のarea-uniform samplingへ戻ります.

21.exact singular solutionも実装する

def singular_solution(xy, omega):
    x = xy[:, 0:1]
    y = xy[:, 1:2]

    r = torch.sqrt(
        x ** 2 + y ** 2
    )

    theta = torch.atan2(y, x)
    theta = torch.where(
        theta < 0.0,
        theta + 2.0 * math.pi,
        theta
    )

    lam = math.pi / omega

    return (
        r ** lam
        * torch.sin(lam * theta)
    )

実装ではsectorの角度rangeと atan2 のbranch conventionを一致させます.

22.boundary samplingは全experimentで固定する

第29回のboundary effectと混ぜないため, 今回のcomparisonでは

\[ \boxed{ X_{\partial}, \qquad \lambda_{\partial} } \tag{33} \]

を全runで固定します.

変えるのはinterior point distributionの \[ \gamma \] だけです.

23.training lossより \(H^1\) errorを見る

exact solutionが \(H^2\) でないので, solution accuracyの中心metricはenergy scale

\[ \boxed{ E_{H^1} = |u_\theta-u^\ast|_{H^1(\Omega_\omega)} } \tag{34} \]

とします.

さらに

\[ \boxed{ E_{L^2} = \|u_\theta-u^\ast\|_{L^2(\Omega_\omega)} } \tag{35} \]

も記録します.

24.corner-local errorを別に測る

global errorだけではcorner approximationを見失うので,

\[ \Omega_\rho = \Omega_\omega\cap\{r<\rho\} \]

に対して

\[ \boxed{ E_{H^1}(\rho) = |u_\theta-u^\ast|_{H^1(\Omega_\rho)} } \tag{36} \]

を測ります.

例えば \[ \rho=1/2,\ 1/4,\ 1/8,\ 1/16 \] とすれば,cornerへ近づくにつれてerrorがどう変わるかを見られます.

25.annular error profileも有効である

dyadic annuli

\[ \boxed{ A_k = \{ 2^{-(k+1)} < r < 2^{-k} \} \cap\Omega_\omega } \tag{37} \]

を使って

\[ \boxed{ e_k = |u_\theta-u^\ast|_{H^1(A_k)} } \tag{38} \]

を並べると, networkがどのscaleからsingularityを解像できなくなるか見えます.

26.random seedだけでなくcorner countを記録する

graded random samplingでは同じ \(\gamma\) でも realised cloudは毎回違います.

従って各runで

\[ \boxed{ N(r<\rho) } \tag{39} \]

を複数の \(\rho\) について記録します.

単に「\(\gamma=1\) を使った」と書くより, 実際にcornerへ何点入ったかを保存した方が再現性があります.

27.graded samplingはFEMのgraded meshと似ているが同じではない

FEMではcornerへmeshを細分化すると

\[ \boxed{ \text{local trial-space resolution} } \]

そのものが上がります.

PINNsでpointsを増やしてもnetwork parameter countは同じです. 変わるのは主に

\[ \boxed{ \text{training information / sampling measure}. } \tag{40} \]

従って

\[ \boxed{ \text{graded mesh} \neq \text{graded collocation} } \tag{41} \]

ですが,regularityに応じてresolutionを集中させるという設計思想は共通します.

28.smooth activationはsingular exponentを自動で知っているわけではない

tanh networkはsmoothです. しかし

\[ r^{2/3} \]

というfractional-power asymptoticsをnetwork architectureが自動でencodeしているわけではありません.

従って

\[ \boxed{ \text{more collocation points} \not\Rightarrow \text{singular asymptoticsを効率よく表現できる} } \tag{42} \]

可能性があります.

必要ならsingular basis enrichmentやcoordinate transformも別のdesign optionになります.

29.singularity enrichmentという別の選択肢

例えば

\[ \boxed{ u_\theta = c_\theta r^\lambda \sin(\lambda\theta) + v_\theta } \tag{43} \]

のようにknown singular modeをtrial ansatzへ入れることも考えられます.

これはFEMでsingular-function enrichmentを行う考え方に近いです.

ただしcorner angleやboundary conditionから \[ \lambda \] を正しく導出できる場合に限ります.

30.regularityを知らずにadaptive residualだけを見る危険

exact singular modeはcorner away from \(r=0\) でharmonicです. 従ってstrong residual peakだけを見ても, solution gradient singularityの場所を十分に反映しないことがあります.

つまり

\[ \boxed{ \text{residual adaptivity} \quad\text{と}\quad \text{regularity-aware grading} } \tag{44} \]

は同じではありません.

第32回ではこの違いをさらに詳しく扱います.

31.AIがcorner-singularity studyで間違えやすい点

mistake何が壊れるか
smooth networkだからexact solutionも \(H^2\) とするcorner regularityを無視する
corner pointでclassical strong residualを評価singular derivativeを誤って扱う
graded pointsにequal weightsを付けて同じlossと呼ぶtarget measureを変えてしまう
\(\lambda\) だけからoptimal \(\gamma\) を断定network・loss・target norm依存性を無視する
global \(L^2\) errorだけを見るcorner-local failureを見落とす
graded collocationをgraded FEMと同一視trial-space refinementとsampling refinementを混同する
residual peakだけからsingularity位置を推定harmonic singular modeを見落とす

32.corner-regularity audit prompt

Audit prompt
このPINN corner-singularity experimentを数学的に監査してください.
(1) corner opening angle \(\omega\) とsingular exponent \(\lambda\) をPDE・boundary conditionから導出しているか,
(2) exact solutionのSobolev regularityをnetwork smoothnessと混同していないか,
(3) corner pointそのものでclassical strong residualを評価していないか,
(4) uniform-area samplingでcorner近傍に何点入るかを記録しているか,
(5) graded sampling parameter \(\gamma\) と realised corner countを記録しているか,
(6) graded points + equal weightsとimportance-weighted samplingを区別しているか,
(7) \(\lambda\) から導いたgrading ruleをheuristicと定理に分けて説明しているか,
(8) global \(L^2\) errorだけでなくglobal / local \(H^1\) errorを評価しているか,
(9) boundary samplesとboundary loss weightを全sampling comparisonで固定しているか,
(10) graded collocationをgraded mesh refinementと同一視していないか,
(11) residual adaptivityとregularity-aware gradingを区別しているか,
(12) known singular mode enrichmentを使う場合はcorner spectrumの導出を監査しているか
を順に確認してください.

33.第30回の結論

re-entrant corner \[ \omega=\frac{3\pi}{2} \] では

\[ \boxed{ \lambda=\frac23, \qquad u^\ast \in H^{5/3-\varepsilon} \setminus H^2. } \tag{45} \]

PINNsで重要なのは, networkをsmoothにすることだけではありません.

solution regularityに応じて

\[ \boxed{ \text{where to sample} + \text{what measure to approximate} + \text{which norm to audit} } \tag{46} \]

を決める必要があります.

graded sampling \[ r=U^\gamma \] はcorner resolutionを増やせますが, equal weightsならtraining objective自体をcorner-weightedに変えます. 同じcontinuous residual normを保ちたいならimportance correctionが必要です.

Season 3 第6回の原則
低regularity solutionに対しては, 点を「多く」置くのではなく, regularityが失われるscaleを理解して点を配置する.

次回はcorner-local gradingからさらに進み, 第31回:boundary layerでは点をどこに置くか — anisotropic sampling へ進みます.

参考文献・関連ページ

  1. P. Grisvard, Elliptic Problems in Nonsmooth Domains, Pitman, 1985.
  2. M. Dauge, Elliptic Boundary Value Problems on Corner Domains, Springer, 1988.
  3. M. Raissi, P. Perdikaris and G. E. Karniadakis, “Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations”, Journal of Computational Physics 378 (2019), 686–707.
  4. W. E and B. Yu, “The Deep Ritz Method: A Deep Learning-Based Numerical Algorithm for Solving Variational Problems”, Communications in Mathematics and Statistics 6 (2018), 1–12.
  5. 第20回:Morley要素を実装する — 4階問題と非適合有限要素法
  6. 第26回:Deep Ritzでは点をどこに置くか — quadratureとsampling geometry
  7. 第28回:PINNsでは点配置で答えが変わるか — uniform・random・adaptive sampling
  8. 第29回:境界点は何点必要か — interior lossとboundary loss

ページの先頭へ