Method and apparatus for multiscale training of physical-informed neural network
Patent Information
- Application Number
- PCT/CN2023/105816
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2025-01-09
Smart Images

Figure CN2023105816_09012025_PF_FP_ABST
Abstract
Description
METHOD AND APPARATUS FOR MULTISCALE TRAINING OF PHYSICAL-INFORMED NEURAL NETWORKFIELD
[0001] Aspects of the present disclosure relate generally to artificial intelligence, and more particularly, to method and apparatus provided for multiscale training of physical-informed neural network with a parameter-wise scale-invariant optimizer.BACKGROUND
[0002] Calculating numerical solutions for Partial Differential Equations (PDE) is an important branch of applied mathematics which has become a heated topic for research in various fields, and it also plays an important role in real-world industrial applications, especially in simulation for a wide range of physical components. It would be beneficial to find an accurate and efficient way to solve PDEs.
[0003] The traditional way to solve PDE is by numerical methods such as finite difference method and finite element method. Nevertheless, various numerical methods may generate unrealistic predictions for specific scientific problems, but it is hard for these methods to handle PDEs in high dimensions, and additionally these methods are time consuming and expensive. Therefore, it has become a trend to combine machine learning techniques for solving PDEs. Physics-informed Neural Network (PINN) is one of the representative approaches. PINN has shown its effectiveness in various sophisticated cases and it has already been applied in various fields including fluids mechanics, bio-engineering, meta-material design, etc.
[0004] However, the original PINN still suffers from some challenges during training. One of the problems is the gap between PINN’s loss function and the actual absolute error. In real cases, one of the loss terms of the PINN may be greater than the others by several orders of magnitude, dominating the training process. If that happens and which is usually the case, lower sum of losses does not necessarily mean better approximation. One important cause of the problem above is the inappropriate scaling of the PDE’s domain. The scaling can have a significant influence on PDE losses when the PDE is not invariant to scaling. Thus, it is needed a method for training the PINN to counteract the effect of ill-balanced losses and inappropriate domain scale.SUMMARY
[0005] The following presents a simplified summary of one or more aspects to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.
[0006] Physics-informed Neural Networks (PINNs) have achieved remarkable progress in solving Partial Differential Equations in various fields by encoding PDEs as losses. While PINNs enjoy their conciseness and flexibility, the convergence and accuracy of PINNs are arguable of tremendous challenge, especially for systems with multiscale characteristics, which could be caused by different numbers of sampling points distributed on the boundary and within the solution domain. Therefore, there is a need for improvements in the training of PINNs, aiming against the ill-balanced optimization objectives.
[0007] It is disclosed herein a scale-invariant optimizer, which utilizes gradient momentum to parameter-wisely balance the losses. Further, with the use of the parameter-wise scale-invariant optimizer, training stability under domain scaling and fast convergence speed are achieved in the meantime.
[0008] In an aspect, a method is disclosed. The method comprises constructing a loss function of the neural network by a weighted sum of loss terms generated based at least on one or more PDEs and one or more boundary conditions; dividing loss terms generated based on the one or more PDEs into separate groups with loss terms generated based on the one or more boundary conditions; and updating all the groups of loss terms respectively, and averaging the updates of all the groups of loss terms as step size for updating parameters of the neural network in each epoch.
[0009] In a further aspect, dividing loss terms generated based on the one or more PDEs into separate groups with loss terms generated based on the one or more boundary conditions further comprises dividing each loss term generated based on each PDE of the one or more PDEs into one separate group and loss terms generated based on the one or more boundary conditions into one group.
[0010] In a further aspect, wherein the weighted sum of loss terms is generated further based on one or more initial conditions, and wherein loss terms generated based on each initial condition of the one or more initial conditions are divided into separate groups.
[0011] In a further aspect, wherein all the groups of loss terms are updated with Adam optimizer respectively.
[0012] In a further aspect, wherein hyperparameters β1 and β2 of the Adam optimizer are set to equal values.
[0013] In a further aspect, wherein the loss terms of the loss function are L2 losses.
[0014] In a further aspect, wherein the one or more PDEs are one or more of Maxwell Equations, Navier-Stokes Equations, Poisson Equation, Helmholtz Equation, Heat and Diffusion Equations, Equilibrium Differential Equations, Displacement Equations and / or Principal Equations.
[0015] In an aspect, a computer implemented method for approximating solutions of Partial Differential Equations (PDEs) with a neural network trained with one of the methods disclosed herein, comprising: inputting coordinates of a point within a solution domain of the PDEs to the neural network; and outputting a solution of the PDEs corresponding to the point by the neural network.
[0016] In a further aspect, the PDEs are Maxwell Equations, and a plurality of solutions of the PDEs corresponds to the distribution of the electromagnetic field conforming to the Maxwell Equations. The plurality of solutions of the PDEs can be used for the design of DC / DC converter.
[0017] In a further aspect, the PDEs are Navier-Strokes equations, and a plurality of solutions of the PDEs corresponds to the velocity and pressure field conforming to the Navier-Strokes equations. The solution of the PDEs can be used for the implementation of fuel cell.
[0018] In an aspect, a computer system is disclosed. The computer system comprises one or more processors; and one or more storage devices storing computer-executable instructions that, when executed, cause the one or more processors to perform the operations of one of the methods disclosed herein.
[0019] In an aspect, one or more computer readable storage media storing computer-executable instructions that, when executed, cause one or more processors to perform the operations of one of the methods disclosed herein is disclosed.
[0020] In an aspect, a computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform the operations of one of the methods disclosed herein is disclosed.BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The disclosed aspects will be described in connection with the appended drawings that are provided to illustrate and not to limit the disclosed aspects.
[0022] Fig. 1 illustrates an exemplary Poisson’s equation in a complex domain, in accordance with various aspects of the present disclosure.
[0023] Fig. 2 illustrates an exemplary flow chart for training a neural network to approximate solutions of Partial Differential Equations (PDEs) , in accordance with various aspects of the present disclosure.
[0024] Fig. 3 illustrates an exemplary flow chart for using the trained neural network, in accordance with various aspects of the present disclosure.
[0025] Fig. 4 illustrates an exemplary computer system, in accordance with various aspects of the present disclosure.DETAILED DESCRIPTION
[0026] The present disclosure will now be discussed with reference to several example implementations. It is to be understood that these implementations are discussed only for enabling those skilled in the art to better understand and thus implement the embodiments of the present disclosure, rather than suggesting any limitations on the scope of the present disclosure.
[0027] Various embodiments will be described in detail with reference to the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. References made to examples and embodiments are for illustrative purposes, and are not intended to limit the scope of the disclosure.
[0028] Physics-informed Neural Networks (PINNs) is a machine learning technique used to solve partial differential equations (PDEs) , which could approximate solutions of PDEs by training neural networks to minimize the differentiable loss. First, an exemplary PDE is defined as below with corresponding boundary and initial conditions:
[0029] where f is the differential equation, u is the solution to that equation, Ω is the domain, and is the boundary of it. In addition, λ is an additional parameter, B, I are the boundary and initial condition and Ti is the corresponding set for initial conditions.
[0030] The loss function of the model could then be defined by the weighted sum of three losses generated by the constraints above as: L (θ, λ; T) =wfLf (θ, λ; Tf) +wbLb (θ, λ; Tb) +wiLi (θ, λ; Ti) (2)
[0031] where wf, wb, wi are the weights for different losses and T, Tf, Tb, Ti are the numbers of sampling points. The loss functions Lf, Lb, Li could then be defined as below, which are L2 loss in this example:
[0032] When training a PINN, it aims to optimize different losses as shown in Eq. (3) at the same time and make every loss term as low as possible. However, the PDE loss and boundary loss may be several orders of magnitude away in real cases, leading to the failure to approach the correct solution. One of the main reasons for the problem is improper scaling of the domain. Most PDEs are not scaling invariant, which causes the change in domain to rescale PDE loss.
[0033] Fig. 1 illustrates an exemplary Poisson’s equation in a complex domain, in accordance with various aspects of the present disclosure.
[0034] The exemplary Poisson’s equation’s reference solution is shown on the left of Fig. 1, the picture in the middle shows the training result of baseline PINN on 8×8 domain and the right one is on 1×1 domain. As illustrated, when training on 1×1 domain, the model has difficulties fitting the boundary condition, since Poisson’s equation is not scaling invariant, the PDE loss and boundary loss would differ a lot when narrowed from 8×8 domain to 1×1 domain.
[0035] PINNs are commonly optimized by Adaptive Momentum Estimation (Adam) optimizer, different from Stochastic Gradient Descent (SGD) optimizer, Adam uses a first-order momentum and a second-order momentum to calculate the step size for updating neural network parameters. However, the Adam optimizer often reaches ill situations when the scale and convergence rate of loss terms vary significantly.
[0036] By observing that domain scaling can have a huge impact on PINN training, it is proposed herein a new optimizer to address the problem.
[0037] As illustrated above, since each PDE and boundary condition is an individual objective, it is natural to regard the PINN optimization as a multi-task learning problem. Moreover, to correct the imbalance between individual objectives, it is straight-forward to consider a method to reweight the loss terms.
[0038] It is noticed by the inventor that the first-order momentum and the second-order momentum of Adam optimizer are relatively stable. Secondly, the second-order momentum basically reflects the intrinsic difference between the scale of PDE loss and boundary loss. By using the second momentum as weights, the PDE loss and boundary loss will have the nearly same scale.
[0039] Based on the inspiration of considering PINN optimization as a multi-task problem, it is disclosed herein to divide the loss of PINN into several groups.
[0040] In an example of the disclosed method, all the PDE losses are divided into one group, and all the boundary losses are divided into another group, due to the PDE losses and boundary losses will be several orders of magnitude away.
[0041] In another example of the disclosed method, each PDE loss is divided into a separate group and all the boundary losses are divided into another group, since different PDEs are likely to have different intrinsic scaling factors, causing imbalance inside the same group, while boundary losses are usually calculated by measuring L2 error on sampling points and they are invariant to the scaling of the domain.
[0042] In a further example of the disclosed method, all the initial losses are divided into one group other than PDE losses and boundary losses, by reason of potential imbalance between PDEs and boundary conditions.
[0043] For each group, the first-order momentum and second-order momentum are maintained separately and the update for each group is determined like Adam optimizer. Finally, the updates for every group are averaged and used as the final update step size for the network parameters. For the nature of consider it as a multi-task problem, the proposed optimizer herein is named Multi-Adam.
[0044] In an example, the process of Multi-Adam is shown below in Table 1.
[0045] Table 1
[0046] Betas β1, β2 in Adam optimizer are usually (0.9, 0.999) by default, but these values are not optimal for the proposed Multi-Adam. For the best convergence of PINN training, it is noticed by the inventor that the scale invariant ability is related to the equality of β1 and β2. The equality implies that the optimizer tracks the same period of history of first-order and second-order gradient momentums, so by dividing one by another the scaling factor is eliminated. In an example, the β1 and β2 can be set to (0.99, 0.99) .
[0047] By using the proposed Multi-Adam optimizer, specially speaking by using the second momentum as weights for different groups, respective loss terms will have the nearly same scale. Moreover, it is observed in experiments that Multi-Adam barely optimizes in the first thousand of epochs but once it obtains a good estimate of the first-order and second-order momentums, a super-fast convergence rate can be observed. Compared with other methods that converge slowly with much more unstable phenomenon such as Adam optimizer or GranNorm, high efficiency and stability and accuracy can be achieved by Multi-Adam.
[0048] In real-world industrial applications, systems like physics can be characterized by PDEs, especially in simulation for a wide range of physical components. In an example, Maxwell’s equations, which are a set of PDEs describing the relationship between the electric and magnetic fields and the charge and current densities, can be used for the design of DC / DC converter. In another example, Heat and diffusion equations and / or equations for fluid dynamics such as Navier-Strokes equations are used in the implementation of fuel cell. Other examples would be PDEs of structural mechanics such as elastic mechanics for the design of E-machines.
[0049] In order to solve PDEs characterizing various systems accurately and efficiently, PINN could be trained to approximate solutions of PDEs in a supervised manner. PDE constraints are introduced into the loss function, resulting in the trained neural networks fit the observed real data and minimalize the PDEs residuals at the same time.
[0050] Fig. 2 illustrates an exemplary flow chart for training a neural network to approximate solutions of Partial Differential Equations (PDEs) , in accordance with various aspects of the present disclosure. As described below, some or all illustrated features may be omitted in an implementation within the scope of the present disclosure, and some illustrated features may not be required for implementation of all embodiments. Further, some of the blocks may be performed parallel or in a different order. In some examples, the method may be carried out by any suitable apparatus or means for carrying out the functions or algorithm described below.
[0051] The method begins at block 201, with constructing a loss function of the neural network by a weighted sum of loss terms generated based at least on one or more PDEs and one or more boundary conditions.
[0052] In an example, the inputs to the neural network to be trained are coordinates of multiple sampling points, either in the boundary or within the solution domain. In a further example, the inputs to the neural network to be trained also comprises corresponding time-points for time-related problems.
[0053] In an example, the loss function of the neural network is constructed as L (θ, λ; T) =wf1Lf1 (θ, λ; Tf) +…wfnLfn (θ, λ; Tf) +wb1Lb1 (θ, λ; Tb) +…+wb1Lb1 (θ, λ; Tb) , wherein Lf1 to Lfn are PDE losses, Lb1 to Lbn are boundary losses, wf1…fn, wb1…bn are the weights for PDE losses and boundary losses respectively and T, Tf, Tb are the numbers of sampling points.
[0054] In a further example, the loss function of the neural network can be constructed also based on one or more initial conditions as L (θ, λ; T) =wf1Lf1 (θ, λ; Tf) +…wfnLfn (θ, λ; Tf) +wb1Lb1 (θ, λ; Tb) +…+wb1Lb1 (θ, λ; Tb) +wi1Li1 (θ, λ; Ti) +…+wi1Li1 (θ, λ; Ti) , wherein Li1 to Lin are initial losses, wi1…in are the weights for initial losses, Ti is the numbers of sampling points.
[0055] In an example, the loss terms of the constructed loss function are L2 losses as shown in Equation (3) .
[0056] In an example, the one or more PDEs may be one or more of Maxwell equations for electromagnetic problem, Navier-Stokes equations for flow control, Poisson equation for electronic, magnetic and / or heat problems, Helmholtz equation for electromagnetic problem, Heat and Diffusion equations for thermodynamics problem, Equilibrium differential equations, Displacement equations and Principal equations for elastic problems, etc.
[0057] The method then proceeds to block 202, with dividing loss terms generated based on the one or more PDEs into separate groups with loss terms generated based on the one or more boundary conditions.
[0058] Referring to one example above, loss terms generated based on the one or more PDEs as Lf1 (θ, λ; Tf) to Lfn (θ, λ; Tf) are divided into separate groups with loss terms generated based on the one or more boundary conditions as Lb1 (θ, λ; Tb) to Lbn(θ, λ; Tb) .
[0059] In a further example, each loss term generated based on each PDE of the one or more PDEs is divided into one separate group and loss terms generated based on the one or more boundary conditions into one group, resulting in Lf1 (θ, λ; Tf) divided into one group, Lf2 (θ, λ; Tf) divided into one group and so on, and loss terms Lb1 (θ, λ; Tb) to Lbn(θ, λ; Tb) are divided into one group.
[0060] In a further example, in the case of the loss function comprises loss terms based on one or more initial conditions, the loss terms corresponding to one or more initial conditions can be divided into one separate group, or each loss term corresponding to each initial condition can be divided into one group.
[0061] The method then proceeds to block 203, with updating all the groups of loss terms respectively, and averaging the updates of all the groups of loss terms as step size for updating parameters of the neural network in each epoch.
[0062] In an example, all the groups of loss terms are updated with Adam optimizer respectively
[0063] In a further example, hyperparameters β1 and β2 of the Adam optimizer are set to equal values. For example, hyperparameters β1 and β2 of the Adam optimizer can be set to (0.99, 0.99) .
[0064] In an example, the operation at block 203 can be performed referring to Table 1 above. After the neural network is trained, it can be used for a variety of industrial applications, especially in simulation for a wide range of physical components.
[0065] Fig. 3 illustrates an exemplary flow chart for using the trained neural network, in accordance with various aspects of the present disclosure. As described below, some or all illustrated features may be omitted in an implementation within the scope of the present disclosure, and some illustrated features may not be required for implementation of all embodiments. Further, some of the blocks may be performed parallel or in a different order. In some examples, the method may be carried out by any suitable apparatus or means for carrying out the functions or algorithm described below.
[0066] As described with Fig. 2, the neural network is trained to approximate solutions of PDEs, for example, the PDEs may be one or more of Maxwell equations for electromagnetic problem, Navier-Stokes equations for flow control, Poisson equation for electronic, magnetic and / or heat problems, Helmholtz equation for electromagnetic problem, Heat and Diffusion equations for thermodynamics problem, Equilibrium differential equations, Displacement equations and Principal equations for elastic problems, etc.
[0067] The method begins at block 301, with inputting coordinates of a point within a solution domain of the PDEs. In a further example, a specific time is also input into the neural network for time-related problems.
[0068] The method then proceeds to block 302, with outputting a solution of the PDEs corresponding to the point by the neural network. In a further example, for time-related problems, the output solution is corresponding to a specific time.
[0069] In an aspect, the PDEs are Maxwell Equations, and a plurality of solutions of the PDEs corresponds to the distribution of the electromagnetic field conforming to the Maxwell Equations. The plurality of solutions of the PDEs can be used for the design of DC / DC converter.
[0070] In another aspect, the PDEs are Navier-Strokes equations, and a plurality of solutions of the PDEs corresponds to the velocity and pressure field conforming to the Navier-Strokes equations. The solution of the PDEs can be used for the implementation of fuel cell.
[0071] In an example, with a certain density of points and their corresponding solutions within a domain, a picture similar as middle and right pictures of Fig. 1 can be generated.
[0072] Fig. 4 illustrates an exemplary computer system, in accordance with various aspects of the present disclosure. The computer system may comprise at least one processor 410. The computer system may further comprise at least one storage device 420. It should be appreciated that the storage device 420 may store computer-executable instructions that, when executed, cause the processor 410 to perform any operations according to the embodiments of the present disclosure as described in connection with Figs 1-3.
[0073] The embodiments of the present disclosure may be embodied in one or more computer-readable medium such as non-transitory computer-readable medium. The non-transitory computer-readable medium may store computer-executable instructions that, when executed, cause one or more processors to perform any operations according to the embodiments of the present disclosure as described in connection with Figs 1-3.
[0074] The embodiments of the present disclosure may be embodied in a computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform any operations according to the embodiments of the present disclosure as described in connection with Figs 1-3.
[0075] It should be appreciated that all the operations in the methods described above are merely exemplary, and the present disclosure is not limited to any operations in the methods or sequence orders of these operations, and should cover all other equivalents under the same or similar concepts.
[0076] It should also be appreciated that all the modules in the apparatuses described above may be implemented in various approaches. These modules may be implemented as hardware, software, or a combination thereof. Moreover, any of these modules may be further functionally divided into sub-modules or combined together.
[0077] The previous description is provided to enable any person skilled in the art to practice the various aspects described herein. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects. Thus, the claims are not intended to be limited to the aspects shown herein. All structural and functional equivalents to the elements of the various aspects described throughout the present disclosure that are known or later come to be known to those of ordinary skill in the art are expressly incorporated herein by reference and are intended to be encompassed by the claims.
Claims
1.A computer implemented method for training a neural network to approximate solutions of Partial Differential Equations (PDEs) , comprising:constructing a loss function of the neural network by a weighted sum of loss terms generated based at least on one or more PDEs and one or more boundary conditions;dividing loss terms generated based on the one or more PDEs into separate groups with loss terms generated based on the one or more boundary conditions; andupdating all the groups of loss terms respectively, and averaging the updates of all the groups of loss terms as step size for updating parameters of the neural network in each epoch.2.The computer implemented method of claim 1, dividing loss terms generated based on the one or more PDEs into separate groups with loss terms generated based on the one or more boundary conditions further comprising:dividing each loss term generated based on each PDE of the one or more PDEs into one separate group and loss terms generated based on the one or more boundary conditions into one group.3.The computer implemented method of claim 1, wherein the weighted sum of loss terms is generated further based on one or more initial conditions, and wherein loss terms generated based on each initial condition of the one or more initial conditions are divided into separate groups.4.The computer implemented method of claim 1, wherein all the groups of loss terms are updated with Adam optimizer respectively.5.The computer implemented method of claim 4, wherein hyperparameters β1 and β2 of the Adam optimizer are set to equal values.6.The computer implemented method of claim 1, wherein the loss terms of the loss function are L2 losses.7.The computer implemented method claim 1, wherein the one or more PDEs are one or more of Maxwell Equations, Navier-Stokes Equations, Poisson Equation, Helmholtz Equation, Heat and Diffusion Equations, Equilibrium Differential Equations, Displacement Equations and / or Principal Equations.8.A computer implemented method for approximating solutions of Partial Differential Equations (PDEs) with a neural network trained with one of claims 1-7, comprising:inputting coordinates of a point within a solution domain of the PDEs to the trained neural network; andoutputting a solution of the PDEs corresponding to the point by the neural network.9.The computer implemented method of claim 8, wherein the PDEs are Maxwell Equations, and a plurality of solutions of the PDEs corresponds to the distribution of the electromagnetic field conforming to the Maxwell Equations.10.The computer implemented method of claim 8, wherein the PDEs are Navier-Strokes equations, and a plurality of solutions of the PDEs corresponds to the velocity and pressure field conforming to the Navier-Strokes equations.11.A computer system, comprising:one or more processors; andone or more storage devices storing computer-executable instructions that, when executed, cause the one or more processors to perform the operations of the method of one of claims 1-10.12.One or more computer readable storage medium storing computer-executable instructions that, when executed, cause one or more processors to perform the operations of the method of one of claims 1-10.13.A computer program product comprising computer-executable instructions that, when executed, cause one or more processors to perform the operations of the method of one of claims 1-10.
Citation Information
Patent Citations
Loss function optimization method and device, equipment and storage medium
CN111738408A
Training method and system of deep neural network based on critical damping momentum
CN112488309A
Flow field information acquisition method and device, model training method and device and electronic equipment
CN114282448A
Training neural networks using learned optimizers
US20220391706A1