Multi-stage PINN model-oriented alternative updating mixing precision training method, system and device, and medium
By adopting alternating update hybrid precision training method in multi-level PINN model training, the problems of high precision and computing resource consumption in multi-level PINN model training are solved, and an efficient training process and widening application scenarios are realized.
Patent Information
- Application Number
- CN202411771449.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to maintain high-precision characteristics when training multi-level PINN models. At the same time, due to the large consumption of computing resources, it leads to long training time and high memory requirements.
The alternating update hybrid accuracy training method for multi-level PINN models is adopted, and the weight of PINN networks at different levels is represented by different data accuracy. In the training of single-level PINN networks, the training method of packet alternating update and the adaptive stop training judgment method for mixed accuracy training is used.
It realizes the maintenance of high-precision characteristics in multi-level PINN network training, while significantly shortening the time and memory requirements required for model training, and broadening the application scenarios.
Smart Images

Figure CN119783747A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of PINN model training, and specifically relates to an alternating update mixed precision training method, system, device and medium for a multi-level PINN model. Background Art
[0002] PINN (Physical Information Neural Network) for solving partial differential equations has become an active research field in recent years, especially in scientific computing, physical simulation and engineering applications. PINN constructs a fully connected neural network to approximate the numerical solution of PDE, and integrates physical laws (such as differential operators) and initial and boundary conditions as loss functions into the training process of the neural network. The network obtains approximate solutions by optimizing the loss function, so that the neural network automatically satisfies the constraints of PDE during the learning process.
[0003] In order to improve the approximation ability of neural networks, the common practice is to increase the number of hidden layer nodes and layers. However, simply deepening the network will lead to gradient vanishing, gradient explosion, overfitting and computational cost problems, and when it reaches a certain level, blindly deepening the network will not improve the accuracy. On the other hand, in actual application scenarios, in order to ensure the high precision requirements of numerical solutions, single-precision floating point numbers (float32 is abbreviated as FP32 below) or double precision (float64 is abbreviated as FP64 below) are often used in the neural network training process, which results in the training process requiring a large amount of computing resources, including longer training time and a large amount of video memory.
[0004] Half-precision floating point numbers (float16) have shown great advantages in reducing training overhead. However, there are problems with gradient explosion, weight non-update, and non-convergence when training PINN models using half-precision floating point numbers. Mixed precision training is a technology that uses half-precision and single-precision to accelerate deep learning model training and reduce computing resource consumption. It takes advantage of the fast calculation speed of half-precision floating point numbers during forward propagation, and uses single-precision floating point numbers during back propagation to ensure numerical stability. It is widely used in large language model training and computing resource-constrained scenarios. However, there is no precedent for using a mixed precision strategy to train multi-level PINN models and maintain their high precision. It has only been used in training single-level PINN models, with a predicted solution error of 10 -4 . Summary of the invention
[0005] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to propose an alternating update mixed precision training method, system, device and medium for a multi-level PINN model.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] The alternating update mixed precision training method for the multi-level PINN model includes the following steps:
[0008] For the input multi-level PINN model, different data precisions are used to represent the PINN network weights at different levels;
[0009] In the training of the single-stage PINN network, a group alternating update training method is adopted;
[0010] In the training of a single-stage PINN network, an adaptive stop training judgment method for mixed precision training is used to determine whether to stop training the single-stage PINN network;
[0011] Output the trained multi-level PINN model.
[0012] Furthermore, different data precisions are used to represent different levels of PINN network weights, including:
[0013] The word length of the floating-point data representing the weight of the PINN network with a low level number is not less than the word length of the floating-point data representing the weight of the PINN network with a high level number.
[0014] Furthermore, it also includes:
[0015] Collect data points and divide the evaluation data set X eval And the training dataset X train , where the training data set is used for PINN network model training, and the evaluation data set is used for the adaptive stop training judgment method.
[0016] Further, the alternating update training method is as follows:
[0017] According to the preset number of hidden layers L, a PINN model F0 with L hidden layers is generated and the weights of the matrix W in the linear transformation part Z = Wx + b of each layer of the network are initialized in a Xavier manner, and b is set to 0;
[0018] Take the training data set X train Train F0 once and update all its network layer weights;
[0019] Traverse each element m in the set {0,1,…,P-1} and execute:
[0020] F (m+1) Update to freeze and update a single set of network layer weights (F m ,g,m,X train ,N,X eval ,ε,M,K,val_loss_min,i) process result;
[0021] Among them, P is the number of network layer groups, g is the grouping function, N is the upper limit of the number of training times, ε is the training stop threshold, M is the tolerance value, K is the training evaluation step size, val_loss_min is the minimum evaluation loss, and i is the auxiliary count;
[0022] After the traversal is completed, the PINN network F is obtained. P .
[0023] Furthermore, update the weights of a single set of network layers and freeze the weight updates of other network layers, specifically:
[0024] Step 1: traverse each element iter in the set {0,1,…,N-1}, using the training data set X train Perform one-step forward propagation process on F0;
[0025] Step 2, F0 executes the back-propagation process of updating a single group of network layer weights and freezing the weight updates of other network layers, where only the network layer number q that satisfies g(q) = m is considered, the weight gradient of the qth layer network is calculated and its parameters are updated, and the gradient calculation and weight update of the weights of other network layers are frozen; m is the number of the hidden layer group currently updated, g() is the grouping function, and a mapping from the positive number set {0,1,...,L-1} to {0,1,...P-1} is defined;
[0026] Step 3: Adopt the adaptive stop training judgment method for mixed precision training. If the adaptive stop training judgment method (X eval ,iter,ε,M,K,val_loss_min,i) returns true, then stop the current loop and return to step 1;
[0027] Step 4: After the set traversal is completed, return to F0 and use it as the PINN network F1.
[0028] Furthermore, the adaptive stop training judgment method for mixed precision training is as follows:
[0029] Get the current training times iter, 0≤iter≤N-1, if iter%K==0, then calculate the residual mean R(X) of the evaluation data set according to the following formula eval ), recorded as loss_new:
[0030]
[0031] Among them, f() is the label function that the network model needs to learn, Au( ) represents the obtained multi-level PINN network model, and X eval (i) indicates the sampling point to be compared; Au(X eval(i)) Mixed precision calculation is enabled, and the remaining vector operations are calculated by converting low-precision floating-point numbers to high-precision floating-point numbers according to the data type of the operands;
[0032] Calculate error = val_loss_min – loss_new; if error ≤ ε, it is considered that the current training step has reached the required accuracy, i = i + 1. If i ≥ M at this time, that is, M consecutive detections have reached the required accuracy, then stop the execution of the current adaptive stop training judgment method and output true; if error > ε, then val_loss_min = loss_new, i = 0, and output false.
[0033] The present invention also includes an alternating update mixed precision training system for a multi-level PINN model. The system adopts the alternating update mixed precision training method for a multi-level PINN model provided by the present invention. The system includes an input module, a training module, and an output module.
[0034] The input module is used to input the multi-level PINN model and use different data precisions to represent the PINN network weights of different levels;
[0035] A training module, used for adopting a group alternating updating training method in the training of a single-stage PINN network, and adopting an adaptive stop training judgment method for mixed precision training to determine whether to stop training the single-stage PINN network;
[0036] The output module is used to output the trained multi-level PINN model.
[0037] The present invention also includes a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the alternating update mixed precision training method for a multi-level PINN model provided by the present invention is implemented.
[0038] The present invention also includes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the alternating update mixed precision training method for a multi-level PINN model provided by the present invention is implemented.
[0039] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0040] 1. The present invention aims at a multi-level PINN model, and uses different data precisions to represent the weights of different levels of PINN networks. The precision of the latter level model is higher than that of the previous level. In the internal training process of each level of the network, an alternating update training strategy is adopted, and a mixed precision training strategy applied in the field of PINN solving PDE is applied. At the same time, an adaptive stop training strategy for mixed precision training is used to detect the optimal time to stop training. The present invention can maintain the high-precision characteristics of multi-level PINN network training, and significantly shorten the time and memory requirements required for model training, thereby broadening the application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flow chart of alternating updates of the present invention;
[0042] Figure 2 is a flow chart of updating a single set of network layer weights and freezing updates of other network layer weights of the present invention;
[0043] Figure 3 It is a flow chart of the adaptive stop training judgment method for mixed precision training of the present invention. DETAILED DESCRIPTION
[0044] Explanation of related terms:
[0045] Multi-level PINN model: an artificial intelligence computing model method that connects multiple PINN models in parallel to solve PDE. Its characteristics are: each level of PINN model operates independently, and the nodes are not connected to each other; the model gradually approaches the first level and obtains a higher precision solution; the prediction accuracy is high, and the prediction solution error can reach up to 10 in the case of FP64 training. -15 The general PINN model has a prediction error of 10 under FP64 accuracy. -5 For details of model construction, see the article: Aldirany Z, Cottereau R, Laforest M, et al. Multi-level neural networks for accurate solutions of boundary-value problems [J]. Computer Methods in Applied Mechanics and Engineering, 2024, 419: 116666.
[0046] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0047] The present invention provides an alternating update mixed precision training method for a multi-level PINN model, comprising the following steps:
[0048] S1. For the input multi-level PINN model, different data precisions are used to represent the PINN network weights of different levels.
[0049] In this embodiment, different data precisions are used to represent PINN network weights at different levels, and also include:
[0050] The word length of the floating point data representing the weight of the low-level PINN network is not less than the word length of the floating point data representing the weight of the high-level PINN network. In this embodiment, the first-level PINN is represented by 64 bits, and the second and third-level PINNs are represented by 32 bits.
[0051] In this embodiment, it also includes:
[0052] Collect data points and divide the evaluation data set X eval And the training dataset X train , where the training data set is used for PINN network model training, and the evaluation data set is used for the adaptive stop training judgment method.
[0053] The training data set and the evaluation data set respectively established in the alternating update training method and the adaptive stop training judgment method require different numbers of coordinate points, and the number of data in the training data set should be greater than the number of data in the evaluation data set.
[0054] S2. In the training of the single-stage PINN network, a group alternating update training method is adopted, and an adaptive stop training judgment method for mixed precision training is adopted to determine whether the single-stage PINN network stops training; wherein, the alternating update training method, such as Figure 1 As shown, specifically:
[0055] According to the preset number of hidden layers L, a PINN model F0 with L hidden layers is generated and the weights of the matrix W in the linear transformation part Z = Wx + b of each layer of the network are initialized in a Xavier manner, and b is set to 0;
[0056] Take the training data set X train Train F0 once and update all its network layer weights;
[0057] Traverse each element m in the set {0,1,…,P-1} and execute:
[0058] F (m+1) Update to freeze and update a single set of network layer weights (F m ,g,m,X train ,N,X eval ,ε,M,K,val_loss_min,i) process result;
[0059] Among them, P is the number of network layer groups, g is the grouping function, N is the upper limit of the number of training times, ε is the training stop threshold, M is the tolerance value, K is the training evaluation step size, val_loss_min is the minimum evaluation loss, and i is the auxiliary count;
[0060] After the traversal is completed, the PINN network F is obtained. P .
[0061] Among them, update a single set of network layer weights and freeze the updates of other network layer weights, such as Figure 2 As shown, specifically:
[0062] Step 1: traverse each element iter in the set {0,1,…,N-1}, using the training data set X train Perform one-step forward propagation process on F0;
[0063] Step 2, F0 executes the back propagation process of updating a single group of network layer weights and freezing the weight updates of other network layers, wherein only the network layer with network layer number q satisfying g(q)=m is considered, the weight gradient of the qth layer network is calculated and its parameters are updated, and the gradient calculation and weight update of the weights of other network layers are frozen; m is the number of the hidden layer group currently updated, g() is the grouping function, which defines a mapping from the positive number set {0,1,...,L-1} to {0,1,...P-1}; for example, when 4 hidden layers are divided into two groups, L is 4, P is 2, and the grouping function g(0)=g(1)=0, g(2)=g(3)=1; when m=0, only the network weights of the two hidden layers 0 and 1 are updated, and the weights of other layers remain unchanged; when m=1, only the network weights of the two hidden layers 2 and 3 are updated, and the weights of other layers remain unchanged.
[0064] Step 3: Adopt the adaptive stop training judgment method for mixed precision training. If the adaptive stop training judgment method (X eval ,iter,ε,M,K,val_loss_min,i) returns true, then stop the current loop and return to step 1;
[0065] Step 4: After the set traversal is completed, return to F0 and use it as the PINN network F1.
[0066] Among them, Figure 3 As shown in the figure, the adaptive stop training judgment method for mixed precision training is as follows:
[0067] Get the current training times iter, 0≤iter≤N-1, if iter%K==0, then calculate the residual mean R(X) of the evaluation data set according to the following formula eval ), recorded as loss_new:
[0068]
[0069] Among them, f() is the label function that the network model needs to learn, Au( ) represents the obtained multi-level PINN network model, and X eval (i) indicates the sampling point to be compared; Au(X eval (i)) Mixed precision calculation is enabled, and the remaining vector operations are calculated by converting low-precision floating-point numbers to high-precision floating-point numbers according to the data type of the operands;
[0070] Calculate error = val_loss_min – loss_new; if error ≤ ε, it is considered that the current training step has reached the required accuracy, i = i + 1. If i ≥ M at this time, that is, M consecutive detections have reached the required accuracy, then stop the execution of the current adaptive stop training judgment method and output true; if error > ε, then val_loss_min = loss_new, i = 0, and output false.
[0071] In the adaptive stop training judgment method, the training stop threshold ε, tolerance value M and training evaluation step size K have a significant impact on the accuracy of the solution and training time when the training stops. Since the multi-level PINN model has the characteristic of obtaining higher accuracy solutions step by step, and obtaining higher accuracy solutions usually requires longer training time, in order to make the training stop strategy adapt to the accuracy requirements of PINN networks at different levels, it is necessary to set corresponding stop training parameters for PINN networks at different levels. Specifically, as the level of the PINN network increases, the threshold ε should be reduced step by step, the tolerance value M should be increased step by step, and the training evaluation step size K should also be increased step by step. This setting helps to improve the stability and accuracy of training while optimizing training time.
[0072] S3. Output the trained multi-level PINN model.
[0073] The following uses solving a simple one-dimensional Poisson problem as an example to illustrate how the method of the present invention is used in multi-level PINN model training.
[0074] Consider the following one-dimensional Poisson equation:
[0075]
[0076] u(0)=0,
[0077] u(1)=0,
[0078] The exact solution expression is u(x) = e sin(2πx) +x 3 -x-1, take the second-order derivative of u(x) to get the expression of f(x).
[0079] For the above one-dimensional Poisson problem, there is currently a high-precision method for solving it with a multi-level PINN network. The specific steps are introduced using a 4-level PINN model as an example. A 4-level PINN model is established, which is denoted as the 0th level network, the 1st level network, the 2nd level network, and the 3rd level network. The exact solution to the problem is denoted as u(x). The 0th level network uses the residual R0(x,u0(x)) as the loss function to output an approximation of the exact solution.
[0080] R0(x,u0(x))=μ0f(x)-Au0(x)
[0081] The 1st, 2nd, and 3rd levels take the residual of the previous level network as the right-hand side term and output That is, R1(x,u1(x)),R2(x,u2(x)),R3(x,i3(x)) are used as loss functions to train the neural network. The loss function calculation formula of the i-th level network is as follows:
[0082] R i (x,u i (x)) = μ i R i-1 (x,u i-1 (x))-Au i (x),
[0083] Where μ is the scaling factor, and the scaling factor μ of the 4-level network is 1, 10 3 ,10 3 ,10 2 .
[0084] The 0th level PINN network is a rough estimate of the exact solution, and the three outputs of the remaining three levels of PINN networks are high-precision approximations of the exact solution. To obtain a final approximation to the exact solution:
[0085]
[0086] Each level of the PINN network transforms the dimension of the input vector X = [x1] to obtain the vector r(x j ) is input into the PINN network,
[0087] γ(x1)=[cos(ω M x1),sin(ω M x1)],
[0088] cos(ω M x1)=[cos(ω1x1),cos(ω2x1),…,cos(ω M x1)],
[0089] sin(ω Mx1)=[sin(ω1x1),sin(ω2x1),…,sin(ω M x1)]
[0090] where ω M =2 M-1 π. Transform the output Y of the output layer to obtain the predicted value corresponding to the vector X. where γ g (x1)=[sin(ω M x1)]. The 4-level PINN network structure is shown in Table 1:
[0091] Number of input layer nodes Number of hidden layers Number of hidden layer nodes Number of output layer nodes M Level 0 2 1
[10] 1 1 Level 1 6 1
[20] 3 3 Level 2 10 1
[40] 5 5 Level 3 2 1
[20] 1 1
[0092] Table 1
[0093] The process of obtaining the target solution of the PINN model is essentially to find the minimum value of a non-convex optimization problem. The solution depends on the choice of optimizer. The common practice is to use the Adam algorithm or the BFGS algorithm. If used alone, there may be a tendency for the training to converge to the local minimum early. In this example, the training is carried out by first using the Adam optimizer and then switching to the BFGS optimizer. The settings of the 4-level PINN network optimizer are shown in Table 2 below, and the learning rate is uniformly set to 0.1.
[0094] Level 0 Level 1 Level 2 Level 3 Adam training times 4000 4000 4000 4000 Number of L-BFGS training 200 400 600 0
[0095] Table 2
[0096] The 0th level PINN network is taken as an example to illustrate how the network weights are grouped. The 0th level PINN network structure is shown in Table 1. The 0th level PINN network includes 3 layers including the input layer, hidden layer, and output layer. The network weights to be trained are divided into two groups, namely: the network weights between the input layer and the hidden layer are group 0, and the network weights between the hidden layer and the output layer are group 1. In the same way, the 1st, 2nd, and 3rd level PINN networks are divided into two groups.
[0097] During the training process of the 4-level PINN using different optimizers, the parameter settings of the adaptive stop training judgment method are shown in Table 3:
[0098]
[0099] Table 3
[0100] The specific training of the 4-level PINN network follows the following steps, and the entire training process is carried out according to the standard mixed precision training strategy.
[0101] Step 1: Collect data points, divide the data set, and evenly select 100,000 points in the interval [0,1] as the training set X train , 5000 points as the evaluation set Xeval , i=0.
[0102] Step 2: Construct the i-th level PINN network PINN i (0≤i≤3), and initialize the network weights.
[0103] Step 3: Train PINN 4000 times using the alternating update training method based on the Adam optimizer i .
[0104] ① Train once and update all network weights;
[0105] ② Freeze the first group of network weights, train 1999 times, and only update the 0th group of network weights;
[0106] ③Restore all network weights to a trainable state, train once, and update all network weights;
[0107] ④ Freeze the network weights of group 0, train 1999 times, and only update the network weights of group 1;
[0108] ⑤Restore all network weights to a trainable state;
[0109] In step 3, ① to ⑤ use the evaluation set to apply the adaptive stop training judgment method, and the parameter settings are shown in Table 3.
[0110] Step 4: Based on the L-BFGS optimizer, the training method of alternating updates is adopted. The number of training times is the same as that of PINN. i The corresponding relationship of the network levels is shown in Table 2, and all network weights are updated. i The network levels are shown in Table 3.
[0111] Step 5: Calculate the residual R of the training set i (x,u i (x)), multiplied by the scaling factor μ i After that, the right-hand side term of the residual is used as the next-level PINN network to calculate the next-level network, and then the next-level network is trained according to the process of steps 2 to 4 until all 4-level networks are trained.
[0112] In another embodiment, an alternating update mixed precision training system for a multi-level PINN model is provided. The system adopts the alternating update mixed precision training method for a multi-level PINN model of the above embodiment. The system includes an input module, a training module, and an output module.
[0113] The input module is used to input the multi-level PINN model and use different data precisions to represent the PINN network weights of different levels;
[0114] A training module, used for adopting a group alternating updating training method in the training of a single-stage PINN network, and adopting an adaptive stop training judgment method for mixed precision training to determine whether to stop training the single-stage PINN network;
[0115] The output module is used to output the trained multi-level PINN model.
[0116] In another embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the alternating update mixed precision training method for the multi-level PINN model as described in the above embodiment is implemented.
[0117] The hardware entity of the computer device includes a processor, a memory and a communication interface; wherein the processor generally controls the overall operation of the computer device; the communication interface is used to enable the computer device to communicate with other terminals or servers through a network; the memory is configured to store instructions and applications executable by the processor, and can also cache data to be processed or processed by the processor and various modules in the computer device (including but not limited to image data, audio data, voice communication data and video communication data), which can be implemented through flash memory (FLASH) or random access memory (RAM).
[0118] Data can be transmitted between the processor, the communication interface and the memory via a bus, which may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together.
[0119] In another embodiment, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the alternating update mixed precision training method for a multi-level PINN model of the above embodiment.
[0120] The storage medium may be transient or non-transient. Exemplarily, the storage medium includes, but is not limited to, a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store computer program codes.
[0121] Exemplarily, the processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
[0122] It should also be noted that in this specification, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0123] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An alternating update mixed precision training method for a multi-level PINN model, characterized in that: The following steps are involved: For the input multi-level PINN model, different data precisions are used to represent the PINN network weights at different levels; In the training of the single-stage PINN network, a group alternating update training method is adopted; In the training of a single-stage PINN network, an adaptive stop training judgment method for mixed precision training is used to determine whether to stop training the single-stage PINN network; Output the trained multi-level PINN model.
2. The alternating update mixed precision training method for a multi-level PINN model according to claim 1, characterized in that: Different data precisions are used to represent different levels of PINN network weights, including: The word length of the floating-point data representing the weight of the PINN network with a low level number is not less than the word length of the floating-point data representing the weight of the PINN network with a high level number.
3. The alternating update mixed precision training method for a multi-level PINN model according to claim 1, characterized in that: Also includes: Collect data points and divide the evaluation data set X eval And the training dataset X train , where the training data set is used for PINN network model training, and the evaluation data set is used for the adaptive stop training judgment method.
4. The alternating update mixed precision training method for a multi-level PINN model according to claim 3, characterized in that: The training method of alternating updates is as follows: According to the preset number of hidden layers L, a PINN model F0 with L hidden layers is generated and the weights of the matrix W in the linear transformation part Z = Wx + b of each layer of the network are initialized in a Xavier manner, and b is set to 0; Take the training data set X train Train F0 once and update all its network layer weights; Traverse each element m in the set {0,1,…,P-1} and execute: F (m+1) Update to freeze and update a single set of network layer weights (F m ,g,m,X train ,N,X eval ,ε,M,K,val_loss_min,i) process result; Among them, P is the number of network layer groups, g is the grouping function, N is the upper limit of the number of training times, ε is the training stop threshold, M is the tolerance value, K is the training evaluation step size, val_loss_min is the minimum evaluation loss, and i is the auxiliary count; After the traversal is completed, the PINN network F is obtained. P .
5. The alternating update mixed precision training method for a multi-level PINN model according to claim 4, characterized in that: Update a single set of network layer weights and freeze updates of other network layer weights, specifically: Step 1: traverse each element iter in the set {0, 1, ..., N-1}, using the training data set X train Perform one-step forward propagation process on F0; Step 2, F0 executes the back-propagation process of updating a single group of network layer weights and freezing the weight updates of other network layers, where only the network layer number q that satisfies g(q) = m is considered, the weight gradient of the qth layer network is calculated and its parameters are updated, and the gradient calculation and weight update of the weights of other network layers are frozen; m is the number of the hidden layer group currently updated, g() is the grouping function, and a mapping from the positive number set {0,1,...,L-1} to {0,1,...P-1} is defined; Step 3: Adopt the adaptive stop training judgment method for mixed precision training. If the adaptive stop training judgment method (X eval ,iter,ε,M,K,val_loss_min,i) returns true, then stop the current loop and return to step 1; Step 4: After the set traversal is completed, return to F0 and use it as the PINN network F1.
6. The alternating update mixed precision training method for a multi-level PINN model according to claim 5, characterized in that: The adaptive stop training judgment method for mixed precision training is as follows: Get the current training times iter, 0≤iter≤N-1, if iter%K==0, then calculate the residual mean R(X) of the evaluation data set according to the following formula eval ), recorded as loss_new: Among them, f() is the label function that the network model needs to learn, Au() represents the obtained multi-level PINN network model, and X eval (i) indicates the sampling point to be compared; Au(X eval (i)) Mixed precision calculation is enabled, and the remaining vector operations are calculated by converting low-precision floating-point numbers to high-precision floating-point numbers according to the data type of the operands; Calculate error = val_loss_min – loss_new; if error ≤ ε, it is considered that the current training step has reached the required accuracy, i = i + 1. If i ≥ M at this time, that is, M consecutive detections have reached the required accuracy, then stop the execution of the current adaptive stop training judgment method and output true; if error > ε, then val_loss_min = loss_new, i = 0, and output false.
7. Alternating update mixed precision training system for multi-level PINN model, characterized by: The system adopts the alternating update mixed precision training method for the multi-level PINN model as described in any one of claims 1 to 6, and the system includes an input module, a training module and an output module; The input module is used to input the multi-level PINN model and use different data precisions to represent the PINN network weights of different levels; A training module, used for adopting a group alternating updating training method in the training of a single-stage PINN network, and adopting an adaptive stop training judgment method for mixed precision training to determine whether to stop training the single-stage PINN network; The output module is used to output the trained multi-level PINN model.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.