Paper reading: Solving the Dirichlet problem for the Monge–Ampère equation using neural networks
39 min read7 sectionsAIThis post was written by AI.阅读中文版
Abstract.A close reading of Nyström and Vestberg: two ansatzes (a penalized MLP and an input convex neural network), an a posteriori error estimate built on the stability of Alexandrov solutions, and every experiment from two to five dimensions, together with the questions they leave open.
This post is a close reading of the paper by Nyström and Vestberg [1]. The paper solves the Dirichlet problem for the Monge–Ampère equation,
where is a bounded open convex set, is locally integrable and is continuous (their (1.1), p. 2). The authors state on p. 2 that, according to their literature review in Section 2.2, there seems to be no earlier work that solves the Monge–Ampère equation with neural networks.
The problem is hard for two reasons. On the one hand, is fully nonlinear, so neural network methods for linear PDEs do not carry over directly. On the other hand, usually has more than one solution: in two dimensions Rellich's theorem only says that there are at most two, and when is even and , every convex solution comes with the concave solution (p. 2). Applications need the unique convex solution, so a numerical method has to make sure it picks that one. We discussed this in the previous post: a loss made only of the residual and a boundary term cannot tell the convex solution from the concave one, and in the experiment there a vanilla PINN ended up on the concave one for all 10 random seeds.
The paper answers with two ansatzes that aim at convexity. The first is a standard multilayer perceptron (MLP) with a loss term that penalizes non-convexity; it essentially only works in two dimensions. The second is an input convex neural network (ICNN) [2], whose architecture makes it convex in its input, in any dimension. Most of the paper is about the second. The rest of this post is organized as follows. Section 2 collects the theory the paper relies on. Section 3 describes both methods and how they are trained. Section 4 presents the stability result and the a posteriori error estimate derived from it. Section 5 goes through the experiments one by one, and Section 6 discusses what they show and what they do not.
We read arXiv version v3 (13 June 2023); the journal version appeared in Journal of Computational Mathematics and Data Science, volume 8. All page, equation, figure and table numbers below refer to arXiv v3.
2 Background
For a convex function that need not be smooth, the paper follows Figalli [3] and defines the Monge–Ampère measure , where is the set of subgradients of at points of and is Lebesgue measure. For , . A convex function is an Alexandrov solution of if (their Definition 2.1). Two results are used later.
Theorem 2.1 (Comparison principle). (Their Theorem 2.2, from [3, Theorem 2.10].) Let be convex on a bounded domain with on . If in , then in .
Theorem 2.2 (Well-posedness of the Dirichlet problem). (Their Theorem 2.3.) Let be a bounded strictly convex domain, a bounded Borel measure on and . Then the Dirichlet problem in , on has a unique Alexandrov solution in . If is merely convex, the same holds provided extends to a convex function on .
Every test problem in the paper is built the same way: take a known convex , set and . Except in Example 4.5, is in ; in Example 4.5 the subdifferential is needed to check that is an Alexandrov solution. Uniqueness among convex functions then follows from Theorem 2.1. In all examples except Example 4.4, existence and uniqueness also follow from Theorem 2.2 (p. 9).
3 Two ansatzes
Both methods minimize the residual of the equation at collocation points. They differ in how they obtain convexity and how they handle the boundary condition.
3.1 Penalized MLP: exact boundary values plus a convexity penalty
The first method reuses the ansatz that Berg and Nyström [4] proposed for linear problems,
where is a smooth function with the right boundary values, is positive in the domain and zero on its boundary, and is a deep network with parameters (their (3.1)). Whatever is, satisfies the Dirichlet condition exactly, so the loss only has to deal with the equation. On the unit square the paper builds and as follows (p. 10):
is a network with one hidden layer of tanh units, fitted to by BFGS with a mean squared error loss.
is a network with one hidden layer of tanh units, fitted to the exact distance function at random interior points and to zero at boundary points.
has five hidden layers of sigmoid units and a linear output, parameters in total.
Minimizing the residual alone does not single out the convex solution, so the paper adds a convexity penalty. For a symmetric matrix the eigenvalues are
The paper's (3.2) drops the factor under the square root1; the argument is unaffected. The residual term drives towards , and when both eigenvalues are nonnegative if and only if . Since the diagonal of a positive semidefinite matrix is nonnegative, under the matrix is positive semidefinite exactly when and . This gives the loss
with interior collocation points and a large constant (their (3.3)–(3.5); their has no factor ). The experiments use . The authors also tried the variant of Brix et al., which replaces in the residual by (their (3.6)). It did not improve accuracy, and the plain determinant needed fewer iterations (p. 7). Their guess is that with a large the modification hardly matters.
The penalty has two limitations. As the authors say, it essentially only works in two dimensions, because in higher dimensions the sign of the eigenvalues is hard to check (p. 7). The example from the previous post shows why: in three dimensions a matrix with eigenvalues can have a positive determinant and positive diagonal entries without being positive semidefinite. Besides, the argument relies on , which the residual enforces only approximately, and only at the collocation points; nothing is said about convexity between them. The two-dimensional trace penalty from the previous post works for the same reason and has the same gap.
3.2 ICNN: convex by construction, boundary values by penalty
The second method makes the network itself convex in its input. The ICNN of their (3.7) is
where the are nondecreasing convex functions applied componentwise, the have nonnegative entries, and , are unconstrained. Convexity follows from two facts: a nonnegative combination of convex functions is convex, and a nondecreasing convex function of a convex function is convex. The terms feed the input directly into every layer ("passthrough"); they are affine in and do not affect convexity. Three implementation details matter (pp. 8 and 11):
The nonnegative weights are written as , and training is done in .
The hidden activation is softplus, , which is convex, increasing and smooth, so the network is smooth and its second derivatives can be computed by automatic differentiation. The form actually used is written out in their (6.9): the last layer is the affine map with no activation, so that the output range is not restricted.
The network has five hidden layers of units, parameters in total.
Here convexity and the boundary condition get in each other's way. Even if , and in were all convex networks, the product is in general not convex, so the ICNN cannot use exact boundary values (p. 8). The paper uses a boundary penalty instead:
with points (their (3.8)). The convexity penalty is no longer needed; the price is that the boundary condition now holds only approximately.
3.3 Training
All derivatives, including the Hessian and the gradient of the loss with respect to the parameters, are computed by automatic differentiation in TensorFlow. The main optimizer is BFGS from SciPy, which uses only function values and first derivatives and stops when the Euclidean norm of the gradient falls below , the SciPy default (p. 8). The authors also use their own implementation of Adam. Parameters are initialized from a normal distribution. Collocation points are drawn with numpy.random.uniform: directly inside the square; on straight boundary pieces by an affine map from ; on the circular arc of Example 4.6 by a trigonometric parametrization, with interior points drawn in the unit square and rejected if they fall outside the domain (pp. 8–9).
A recurring problem is that BFGS stops early with a "precision loss" message, that is, the line search fails. The paper's fix is an Adam restart: train with Adam for a while to leave the problematic region, then switch back to BFGS. In Example 4.1 this meant a few hundred epochs at a learning rate of order (p. 10). The same trick appears in Example 4.4 and in the five-dimensional case (Section 5).
4 Stability and an a posteriori error estimate
The theory in the paper (its Section 6) does not ask whether training converges. It asks a different question: if we already have a convex function that nearly satisfies the equation and the boundary condition, how far is it from the true solution?
Proposition 4.1 (Stability). (Their Proposition 6.1.) Let be convex functions on a bounded domain that solve (in the Alexandrov sense) in , on , with and , . Assume also . Then
where depends only on the dimension.
Idea of the proof. Write and . Let be the convex solution with right-hand side and boundary values ; by the comparison principle, . Let be the convex solution with constant right-hand side and zero boundary values. The Monge–Ampère measure is superadditive, (their Proposition A.2), so a second use of the comparison principle gives . Finally, the Alexandrov maximum principle (their Theorem A.1) gives . Exchanging and yields with , where is the constant in the Alexandrov maximum principle.∎
The statement only asks for a bounded domain, but the proof uses their Theorem A.1, which the paper states for bounded convex domains, and Theorem 2.2 to get and . We therefore read the proposition as a result on bounded convex domains, which matches the setting of .
How does this give an error estimate? Let be the (unknown) solution of and a known smooth convex function, for example a trained ICNN. Then is itself the solution of a Dirichlet problem with right-hand side and boundary values . By , is controlled by and , and both involve only known functions. The remaining gap is that the loss sees the residual at finitely many points while needs a supremum. The paper bridges it with Lipschitz constants.
Lemma 4.2 (A posteriori estimate). (Their Lemma 6.2.) Let solve with and Lipschitz, and let be convex. Take points , and radii such that and . Then
Everything on the right except and can be computed from finitely many function evaluations. For those two constants, the paper first shows that bounds on the derivatives of up to order three suffice: from with ,
(their (6.8)). Their Lemma 6.3 then gives explicit bounds on the first, second and third derivatives of a softplus ICNN in terms of its weights alone. With the entrywise absolute value and the nonnegative matrices , , one has ; the second and third derivative bounds are sums of products of entries of and . The proof uses only for softplus and the chain rule. Inserting these bounds into Lemma 4.2 gives an error bound that needs no exact solution, only finitely many function evaluations.
The estimate only covers convex approximations. Proposition 4.1 needs both and to be convex, so it applies to the ICNN but not to the penalized MLP, which is only approximately convex at the collocation points. This is a theoretical advantage of the ICNN approach.
Besides, the residual enters with exponent , so the bound is pessimistic. Figure 1 plots . In two dimensions, even a residual supremum of still leaves an error term of ; in four dimensions, bringing down to takes a residual supremum of . Unless is small, such bounds are far above the errors of order observed in Section 5. The constant comes from the Alexandrov maximum principle, and the paper gives no value for it.
The paper also never evaluates the bound on any experiment. So we do not know how large from their Lemma 6.3 is for a trained network, how small the covering radius has to be, or how many orders of magnitude separate the bound from the actual error. The authors list better Lipschitz bounds as future work (p. 27).
Figure 1. The factor multiplying the residual in , computed from the formula. Black solid, dashed, dash-dot and dotted lines are ; the wide grey solid line is itself, for comparison.
5 Experiments
Section 4 of the paper has seven examples, and Section 5 studies the number of collocation points. Example 4.1 uses the penalized MLP; all others use the ICNN. Table 1 summarizes the settings, and Figure 2 shows some of the test problems. The paper gives error tables only for Sections 4.6, 4.7 and 5.3; the other 2D examples of Section 4 are reported as heat maps of the absolute error. When we quote a number from a heat map below, it is the highest tick on the color bar and indicates only the order of magnitude.
Table 1. Settings of the examples, from Section 4 of the paper (pp. 9–17). "Plus " means extra boundary points on each of the two edges next to the singularity, weighted by ; for Examples 4.3 and 4.4 the paper only says that the method of Example 4.2 is reused and does not restate the numbers of points. "Not given" means the paper does not state the value.
Ex.
Domain
Exact solution or feature
Method
Interior / boundary points
Weights
Iterations
4.1
, smooth
penalized MLP
/
BFGS + Adam restarts
4.2
same
ICNN
/
BFGS, converged at
4.3
singular at the origin (on the boundary), integrable
ICNN
not given; plus
,
4.4
singular at , not integrable
ICNN
not given; plus
,
BFGS + Adam
4.5
discontinuous at
ICNN
/ ; /
not given
see text
4.6
asymmetric convex domain
no symmetry; noisy
ICNN
/
not given
; at most
4.7
,
ICNN
see text
not given
see text
Figure 2. Four test problems, computed from the formulas in the paper. (a) The domain of Example 4.6 (, , , ; black outline) with level sets of the exact solution (thin black lines labelled with the value of ; the unlabelled one in the lower corner of the arc is ). (b) Radial profile of Example 4.5: (black solid line) vanishes for and continues in a way outside, while (wide grey solid line) jumps from to at (grey dotted line). (c) The right-hand sides of Examples 4.3 (black dashed line) and 4.4 (black solid line) along the diagonal; the singularities sit at the origin and at , both on the boundary.
5.1 A smooth problem in 2D: the two methods side by side
Examples 4.1 and 4.2 solve the same problem on :
(their (4.1) and (4.2)). Both use random interior points and boundary points. The penalized MLP uses ; BFGS stopped with precision loss at some point and was restarted after a few hundred Adam epochs. The highest tick on its error heat map (their Figure 1) is . The ICNN uses and includes the boundary points in as well; BFGS converged after iterations, and the highest tick on its error heat map (their Figure 2) is . The authors summarize this as errors of order for the penalized MLP and for the ICNN (p. 11). Since is of order one on the unit square, the relative errors are of the same order. They also note that the accuracy of the penalized MLP is comparable to the examples in [4].
The gap of two orders of magnitude is large, but the comparison does not control several factors. The networks differ (a sigmoid MLP with parameters against a softplus ICNN with ), the penalty weights differ ( against ), one method has exact boundary values and the other only approximate ones, and only the first needed Adam restarts. Each method is reported for a single run, with no statistics over random seeds and no run times. So the result shows that the ICNN reaches high accuracy on this problem; it does not show that the whole factor of comes from structural convexity being better than a penalty.
5.2 Singularities on the boundary
Example 4.3 takes
Here is singular at the origin, which lies on the boundary of , but it is integrable (pp. 11–12). The method of Example 4.2 works, but the authors found it better to add boundary points near the singularity and give them a larger weight. The loss becomes
where the are equidistant points on each of the segments and , with and (their (4.3)). With , the absolute error after iterations was already below the best the authors could reach without it, and the maximum error dropped by more than . The highest tick on the heat map after iterations (their Figure 3) is .
Example 4.4 is a piece of a sphere,
with singular at the corner . The singularity is stronger than in Example 4.3, and is not integrable (pp. 12–13), so Theorem 2.2 does not apply; uniqueness follows from the explicit solution and the comparison principle. Training keeps the and of Example 4.3, with extra boundary points on each of and . BFGS stopped with precision loss several times, most likely because of the strong singularity, according to the authors, and each time a few Adam iterations got it going again. The highest tick on the final heat map (their Figure 4) is ; judging from the figure, the largest error sits on the right edge close to the corner .
5.3 A discontinuous right-hand side
Example 4.5 uses the radial function on
which is . Using for radial functions, for and for ; the circle carries no Monge–Ampère mass, so is the Alexandrov solution with right-hand side (4.4) (p. 13). This is the only example whose solution is not in .
The network is the one of Example 4.2. With interior and boundary points, the highest tick on the heat map (their Figure 5) is , much worse than before, with the largest errors near the discontinuity . Adding points near made training harder; the authors explain that points very close to each other on the two sides of the circle must be mapped to very different values, and . Refining everywhere instead, with interior and boundary points, cut the maximum error to less than half (their Figure 6, highest tick ), still large compared with the other examples. On the number of iterations, the text says while the captions of their Figures 5 and 6 say (pp. 14–15); we cannot tell which is right. [TODO: check the iteration count of Example 4.5 in the journal version (JCMDS 8, 100080)]
5.4 An asymmetric domain and noise
The domain of Example 4.6 is bounded by , , and (Figure 2a). The exact solution
was chosen to have no particular symmetry (p. 15). There are interior and boundary points, with the number of points on each boundary piece roughly proportional to its length. After BFGS iterations, the highest tick on the noise-free heat map (their Figure 7) is .
The authors then add normally distributed noise to the values of the right-hand side, with standard deviations from to , train with BFGS until convergence or for at most iterations, and measure the maximum and average error at random interior points (their Table 1). Figure 3a shows the result. Without noise the maximum error is and the average error . With standard deviations and the maximum error is and , a range in which the authors see little change; with and it is and . The authors call the method "rather stable" with respect to noise, and note that values vary between runs while the general trend is that noise lowers accuracy. We add two observations. Going from to , the maximum error grows by a factor of about and the average error by about , more than the noise level itself. Besides, the paper says neither whether the noise is drawn once or redrawn during training, nor how much the numbers vary over repeated runs.
Figure 3. Blue curves are ICNN results; for (b) the network is our inference (see below). (a) Error in Example 4.6 when normal noise is added to the right-hand side: maximum error as a solid line with filled circles, average error as a dotted line with open circles; the grey horizontal solid and dotted lines are the noise-free values (a standard deviation of has no place on a log axis). Data from Table 1 of the paper. (b) Average error when boundary and interior points are doubled together; there are times (Table 4, solid line, filled circles) or times (Table 5, dashed line, open squares; Table 6, dash-dot line, filled triangles) as many interior points as boundary points. Data from Tables 4–6 of the paper, each run with at most BFGS iterations. The value printed as "1.27-03" in Table 6 is plotted as .
5.5 Higher dimensions
Example 4.7 extends Example 4.2 to on . The paper does not restate the network for these runs, nor does it write out the right-hand side in dimensions; from for radial functions we get .
In 3D, with interior and boundary points, BFGS terminated successfully after iterations. The final maximum error is , the average error and the error (their Table 2).
In 4D, with interior and boundary points, BFGS stopped with precision loss after iterations. At that point the maximum error is , the average error and the error (their Table 3).
In 5D, training failed. BFGS stopped immediately with precision loss, and Adam alone reduced the loss only very slowly. The only procedure that worked was: (1) Adam on the boundary loss alone for up to epochs; (2) Adam on the full loss for some thousands of epochs, which decreased much faster after step (1); (3) BFGS, which reduced the loss quickly and then stopped again with precision loss; (4) alternating between Adam and BFGS. Full-batch Adam worked best. The loss started at order and came down to order fairly quickly, after which convergence was slow, and the approximate solution still differed clearly from the exact one. No error numbers are reported for 5D; the authors only say that the method needs further development (pp. 16–17).
Figure 4a shows the errors in 3D and 4D against the number of iterations. The final error in 4D is about times the 3D one, and the maximum error about times; the 4D run did not terminate normally, which slightly penalizes it in this comparison. The paper offers no analysis of the 5D failure. Figure 4b is our own observation, not part of the paper: on the right-hand side has minimum at the origin and maximum at the corner , about for . A right-hand side whose scale grows like this may be one reason why the 5D loss starts so large and BFGS fails at once. This is only a guess; testing it would mean running the same network on a problem whose does not grow with the dimension.
Figure 4. (a) Errors of the ICNN (blue) in 3D and 4D during training. Line style gives the error: solid for maximum, dashed for , dotted for average; the marker gives the dimension: filled circles for 3D, open squares for 4D. Data from Tables 2 and 3 of the paper; the value printed as "7.387-05" in Table 3 is plotted as . Training failed in 5D, and the paper gives no error numbers. (b) Our own calculation of the maximum of the right-hand side for on (black solid line, a dot at each with its value next to it); the minimum is always .
5.6 Number of collocation points
Section 5 of the paper studies three problems: that of Example 4.1, that of Example 4.3, and the function (4.1) on the unit disk. To separate the roles of the two kinds of points, here contains only interior points. The paper does not say which network this section uses; since the boundary points enter the loss only through , we infer that it is the ICNN. Each run uses BFGS until convergence or at most iterations.
With boundary points fixed, the number of interior points starts at or and is doubled (their Figures 8–10).
With interior points fixed, the number of boundary points starts at and is doubled (their Figures 11–13).
Both are doubled together (their Tables 4–6, Figure 3b).
The three studies agree: the average error first drops quickly as points are added, then slows down and oscillates. In their Table 4, for example, the average error is with boundary and interior points, already with and , and stays between and after that, ending at with and . Table 6 decreases more slowly and reaches at and . The authors attribute the plateau mainly to the cap of iterations, which is often hit before the optimizer terminates when many points are used; they checked that more iterations improve the accuracy. Increasing only one kind of point also changes the ratio between the two, which may hurt convergence (pp. 19–20). So this section shows that a small number of points already gives good results; it does not establish a convergence rate.
There is one inconsistency here that we cannot resolve. The text says that Tables 4, 5 and 6 belong to Example 4.1, Example 4.3 and the disk, in that order, but the captions of Tables 4 and 5 both name the disk problem, and the caption of Table 6 names Example 4.3 (pp. 18 and 21). Figure 3b therefore labels the curves by table number only. [TODO: check the captions of Tables 4–6 in the journal version]
6 Discussion
The paper establishes the following. The ICNN is a workable convex ansatz: a network with parameters reaches absolute errors of order on a smooth 2D problem. For singularities on the boundary, extra weighted boundary points near the singularity help considerably. The method handles an asymmetric convex domain, is insensitive to small noise in the right-hand side, and still gives good results in 3D and 4D. On the theory side, Proposition 4.1 and Lemma 4.2 give a route to an error estimate without the exact solution, and this route only works for convex approximations, which is exactly where the ICNN has an edge over the penalty approach.
The paper leaves the following questions open:
The two methods are compared once, on one 2D problem, with different networks, weights, boundary treatments and optimization histories (Section 5). There is no comparison with any classical method either; the authors say explicitly that they did not reproduce the methods of Benamou, Froese and Oberman [5], which were tested on some of the same 2D problems (p. 9).
Every result is a single run. The authors acknowledge that results vary with the random points and initialization but give no spread. No run times are reported; the conclusion only says, qualitatively, that time per iteration grows little with more points while the number of BFGS iterations grows (p. 27).
The a posteriori bound is never evaluated, and its exponent makes it weak in higher dimensions.
The 5D failure is not analyzed. Training relies on a hand-tuned alternation between BFGS and Adam, and when to switch and which learning rate to use is given for only a few examples.
Outside 2D the penalized MLP has no convexity guarantee, and in 2D its convexity holds only approximately at the collocation points. The paper does not report whether the trained penalized MLP is convex between them.
The ICNN satisfies the boundary condition only approximately. In several heat maps the largest error sits near the boundary (for example their Figures 2, 3, 4 and 7); this is our reading of the figures, and the paper does not discuss it.
The future work the authors list includes the more general equation , in particular prescribed Gaussian curvature and optimal transport (where the boundary condition asks the gradient to map the boundary to the boundary), deep versus shallow networks, estimating and reducing computation time, and better Lipschitz bounds for Section 6 (p. 27).
7 Conclusion
Nyström and Vestberg solve the Dirichlet problem for the Monge–Ampère equation with two ansatzes. The penalized MLP keeps exact boundary values and pushes towards convexity through a penalty on the diagonal of the Hessian, which essentially only works in 2D. The ICNN is convex by construction and imposes the boundary condition by a penalty, in any dimension. In the authors' examples, the ICNN reaches errors of order on a smooth 2D problem, handles boundary singularities, a discontinuous right-hand side (with lower accuracy), an asymmetric domain and a noisy right-hand side, and works in 3D and 4D; training fails in 5D. On the theory side, the stability of Alexandrov solutions gives an a posteriori estimate for convex approximations, but it scales only like the -th power of the residual, and the paper does not apply it to its experiments. As the first work of its kind (to the authors' knowledge), the paper sets out the approach of combining a convex architecture with a residual loss; what it leaves open is a proper comparison, stable training in higher dimensions, and the distance between the theoretical bound and the actual error.
References
Nyström, Kaj, and Vestberg, Matias, Solving the Dirichlet problem for the Monge–Ampère equation using neural networks, Journal of Computational Mathematics and Data Science 8 (2023) 100080.
Amos, Brandon, Xu, Lei, and Kolter, J. Zico, Input Convex Neural Networks, in Proceedings of the 34th International Conference on Machine Learning, pp. 146–155.
Figalli, Alessio, The Monge–Ampère Equation and Its Applications, Zurich Lectures in Advanced Mathematics, European Mathematical Society, Zürich, 2017.
Berg, Jens, and Nyström, Kaj, A unified deep artificial neural network approach to partial differential equations in complex geometries, Neurocomputing 317 (2018) 28–41.
Benamou, Jean-David, Froese, Brittany D., and Oberman, Adam M., Two numerical methods for the elliptic Monge–Ampère equation, ESAIM: Mathematical Modelling and Numerical Analysis 44 no. 4 (2010) 737–758.
Notes
The eigenvalues of a symmetric matrix solve , whose discriminant is . ↩
@misc{zhang2026nn-mae-icnn-dirichlet,
author = {Zhang, Chengrui},
title = {{Paper reading: Solving the Dirichlet problem for the Monge–Ampère equation using neural networks}},
year = {2026},
url = {https://chengrui.dev/en/posts/nn-mae-icnn-dirichlet/},
note = {Blog post},
}