Solving for high dimensional committor functions using artificial neural networks
Yuehaw Khoo, Jianfeng Lu, Lexing Ying
Introduction
In this paper, we study the transition between two states described by the overdamped Langevin process
which is the probability of hitting region before region with the stochastic process (1) starting at . The committor function provides useful statistical description on properties such as density and probability current of reaction trajectory. However, obtaining the committor function can be a formiddable task, as it involves solving a high-dimensional Fokker-Planck equation
The high dimensional nature of (3) renders obtaining via finite-element-type methods intractable. On the other hand, since the transition paths are often localized to a quasi one-dimensional reaction tube, the region of interest is rather small compare to . Under this approximation, the finite temperature string method is developed to simultaneously find the best “tube” and the corresponding committor function. Another approach is based on explicit dimension reduction using e.g., the leading eigenfunctions of the generator by means of diffusion maps to approximate . More recently, a direct point cloud discretization for the Fokker-Planck equation has been also considered.
In recent years, the artificial neural-network (NN) has shown great success in representing high-dimensional probablity distributions or classifiers in a variety of machine learning tasks . Motivated by those recent success, in this note we use an NN to provide a low-dimensional parameterization of the committor function
This paper is organized as the following. In Section 2, we design an NN tailored for solving for the committor function. In Section 3, we demonstrate the success of the proposed method in a few examples. In Section 4, we conclude the note. Before moving on, in the next subsection we survey related methods for solving (3).
respectively. Let be vectors corresponding to committor function values on the points belong to regions , the committor function satisfies
In the presence of a spectral gap the eigenmodes of provides reduced coordinates for the reaction tube, thus solving (6) for can be seen as expanding using the reduced coordinates. However, discretizing the generator using diffusion map may suffer from low order of convergence. Therefore improves upon diffusion map by explicitly constructing the tangent plane of each point in the sampled point cloud and discretizing the generator in each of the tangent plane.
On the other hand, recent years have seen usage of machine learning techniques in solving high-dimensional partial differential equations. The success of where an NN parameterized spin wavefunction is used as an ansatz for solving the many-body Schrödinger equation motivates us to consider solving (3) using an NN as well. Our work is also similar to the methods in for solving partial differential equations. demonstrate success of NN-based method for solving boundary values problem
where on , is a smooth function that satisfies the boundary conditions on , and is an NN-parameterized function. Then is found from solving
leading to an optimization problem over the NN parameters. The improvement of over is that and are also learned as a neural-network separately from , whereas in they are obtained via explicit construction. Such methods remove the need of specifying basis for discretizing therefore can complement Galerkin-type method. While these methods obtain rather impressive results in low-dimension, their performance in high dimension is unexplored, which is in fact the most interesting regime. In a very recent work , a neural-network is used to parameterize the solution to a high-dimensional parabolic equation. Although such setting is similar the one we consider, in our case the boundary conditions might result singularities in , making it more difficult to be approximated using an NN, which will be address in Section 2. Moreover, since work with the strong form of a partial differential equation, the computational cost can be high as the second order derivative of is needed, whereas our approach is based on the variational formulation of the PDE. Although using an NN in solving the variational formulation of a PDE has been explored before, does not face the type of singularity issue arises in our application.
Proposed method
To see the boundary conditions for on , let be the minimizer of (10) and . Since is a stationary point, for any
The third equality follows from on , and requiring
via imposing suitable boundary condition on . Here stands for the surface integral. When the domain is unbounded as the considered case, the condition
where denotes a ball with radius , can ensure (16). Notice that we simply need to have subexponential growth as for (17) to hold, as long as when for some . The last equality in (11) implies that a solution to (10) provides a solution to (3).
As mentioned earlier, to cope with the high-dimensionality of , the proposed method consists of parameterizing as an NN function . Instead of (10), we solve
where the boundary conditions are only enforced as soft-constraints (with hardness tuned by the choice of ). The first integral is then approximated via sampling according to the overdamped Langevin process (1). To approximate the second and third integrals, for our problems there exist rather convenient scheme for drawing samples from , . The choice of the measures on the boundaries is based on the consideration of sampling convenience. In our examples, we mainly work with regions and being balls, therefore the samples on and are drawn by normalizing and recentering normally distributed samples. Note that we can rewrite (18) as a single expectation
where is the characteristic function of region , is a parameter that controls the proportion between the sample size in with the sample size in . This allows us to solve for (3) as an optimization problem (19) over NN weights using stochastic gradient type methods based on stochastic approximation of the expectation. While this is in principle straightforward, challenges arise due to the specific nature of the high dimensional Fokker-Planck equation we aim to solve. We discuss those challenges below and then the proposed neural-network design to overcome them.
The last boundary condition is there in order to satisfy (17). A solution to (20) can be obtained by first solving the Laplace’s equation with Dirichlet’s boundary conditions
where is the gamma function, the solution of (21) can be obtained as
2 Challenge in low T𝑇T regime
A different type of singularities can exist in the low temperature regime. Consider the potential
Here, (26) resembles a double potential well, and and are located in the potential wells. When the temperature is low, the equilibrium distribution for such is concentrated in and while the midpoint of and has a low density. Therefore, as goes from 0 to 1 when goes from -1 to 1, it is preferrable for to concentrate around the midpoint of and in order to have a low cost
As an example, we plot the committor function when in Fig. 2 when . While the committor function is steep around , unlike the case of high , an NN with a single hidden layer with activation function gives a good approximation. Since our goal is simply to show qualitatively that an NN is capable of handling such singularity issue, we defer the implementation details to Section 3.
3 Neural-network architecture
In this subsection, we present an NN network architecture that can deal with the aforementioned challenges. When solving problem (20) via its variational formulation, a natural choice of the NN architecture is to mimic (24) and take
where are neural-network parameterized functions, . By this ansatz, we explicitly remove the dominant singularities at . On the other hand, in order to determine the committor function of the transition process in the potential (26) when , where is a large scalar and is certain smooth function may be used to capture the sharp transition around the midpoint between and . This suggests using as nonlinearity in an NN.
Therefore, to deal the issue of singularity, we propose the following neural-network architecture to solve for the committor function:
where ’s are functions parameterized by the NN, is the number of singularities, and each is a problem dependent function with singularity at . The vector contains the parameters of the neural networks. Except , each is an NN with 3 hidden layers where each hidden layer has 6 nodes. consists of multiple hidden layers each having 12 nodes. A hyperparameter we tune here is the number of hidden layers in , where the choice of it is made using cross-validation. More precisely, the NN for committor function should give similar cost in training and testing samples. We use as the activation function of the hidden nodes. At high temperature, we expect singularities of type to be dominant, whereas at low temperature the function with nonlinearities should be the main contributor to the committor function. The pipeline of solving for is depicted in Fig. 3. As shown in Fig. 4, when using such architecture to solve for the variational form of (20), we indeed recover the type behavior near and .
Numerical experiments
In this section, we evaluate the proposed method in a few numerical examples. In these examples, the minimization in (19) using such NN architecture is done using the Adam optimizer, a variant of stochastic gradient descent, in the TensorFlow engine. The ratio of samples on to samples on are kept between 1/10 to 1/100. Then is tuned in order to have the boundary conditions satisfied with accuracy. In all of the experiments, 2000 boundary samples are used, and we set the batch size to be 3000 in the Adam optimizer. We evaluate the performance using the following metric
where is the rate of reaction. Note that is the energy one minimizes for in the variational formulation. To calculate these errors, we generate samples by simulating the stochastic process (1).
In the first numerical experiment, we solve for the committor function in the potential well (26) with regions and being (27) when . In this case, where
To solve this problem using an NN, we set in (30) as there is no singularity in this problem. In , only one hidden layer is used. In this example, we sample differently from what is presented in (19). When is small, it is difficult to obtain sufficient samples near the saddle point of . Therefore, instead of working with (19) directly, we sample uniformly from $(x_{2},\ldots,x_{d})d-1|\nabla q_{\theta}(\mathbf{x})|^{2}\chi_{\Omega\setminus A\cup B}(\mathbf{x})$ to
to ensure sufficient sample coverages along . In this case,
For a subset of these samples, we let to get the samples on the boundaries . We use a separate batch of samples, serving as validation dataset, to determine and . In Table 1 we report the error and the number of samples used for solving this problem in dimension with temperature .
In the second experiment, we solve for the committor function for the transition process between a pair of coecentric spheres, with potential
In this example, even with moderate , the committor function still display a singular behavior . Therefore in (30) we let , . We use 3 hidden layers for . The equilibrium density is proportional to , therefore the samples can be drawn from the gaussian distribution. The samples on the two boundaries are obtained via rescaling samples from the normal distribution to have norm or . The results for , , , are summarized in Table 2. We compare the solution with and without including the type singularity. It is worth noting that the explicit inclusion of singularity is rather important for this example even at moderate temperature. In Fig. 5a, we plot along several randomly chosen radial directions to check whether is close to a single-variable function when explicitly including a singular function in the NN architecture. In Fig. 5b, we plot the NN committor function when the singularity is not explicitly taken care of.
In the third experiment, we work with the rugged-Muller potential
considered in . This is a Muller potential perturbed by a rugged potential in the first two dimension, where the roughness is controlled by . In the rest of the dimensions, we place a quadratic potential well where its strength is controlled by . The domain . The parameters in (37) are taken from , for completeness we provide them in the following:
In this example, we let , regions and being two balls with radius 0.1 centered at and . The points are again sampled using Euler-Maruyama scheme. The ground truth is obtained via applying finite element method on uniform grid to (3), where the code is provided by the authors of . We use an NN with two singularities of type where is the position of singularity, and that has 3 hidden layers. The results are reported in Table 3 and the contours of the committor function are shown in Fig. 6. As shown in the table, although we can achieve few percents accuracy, for the case with lower temperature more samples are needed to determine the committor function (since the equilibrium distribution is less smooth).
Conclusion
In this note, we develop method based on neural-network to represent the high-dimensional committor function. The neural-network parameters are found via optimizing the variational form of the Fokker-Planck equation. In order to better approximate the committor function, the NN function has to be designed carefully in order to deal with the singularities in high and low regime. Through numerical experiments, we show the usefulness of the proposed alternative approach in dealing with high-dimensional partial differential equations. We remark that the quality of the learned committor function depends crucially on sampling. When the temperature is low, due to the sparsity of samples between regions and when a naive sampling scheme is used, the NN approximation to the committor function tends to make a transition that is too sharp compare to the ground truth. The usage of enhanced sampling schemes, for example using the currently learned NN to guide further sampling, is certainly an important future direction to investigate.