A data processing method, a neural network training method, and related devices
By directly updating the initial mesh through a neural network, the problems of long time consumption and high resource consumption in traditional PDE solution methods are solved, achieving efficient mesh optimization and PDE solution.
Patent Information
- Application Number
- CN202210417652.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-04-20
AI Technical Summary
Traditional methods for solving partial differential equations (PDEs) require repeated solutions to the initial mesh and optimization, which is time-consuming and computationally expensive.
The initial grid is updated directly by the first neural network to generate reversible second grid points, avoiding repeated PDE solutions and reducing computational resource overhead.
It shortens computation time, reduces computational resource consumption, and ensures the effectiveness and efficiency of mesh generation.
Smart Images

Figure CN114781610B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to a data processing method, a neural network training method, and related equipment. Background Technology
[0002] Many physical systems can be described by partial differential equations (PDEs). For example, in scenarios such as electromagnetic simulation, thermal simulation, electrostatic field simulation, semiconductor device simulation, fluid simulation, and structural simulation, the PDE corresponding to the object to be simulated can be obtained and solved.
[0003] Traditional PDE solvers, such as finite-difference methods (FDM), finite element method (FEM), and finite volume method (FVM), are all based on mesh generation. That is, the solution space corresponding to the PDE needs to be decomposed into multiple mesh elements, and then the PDE solver can be used to calculate the solution of the PDE on each mesh element. Here, the "solution space corresponding to the PDE" can also be understood as the solution domain of the PDE.
[0004] Currently, after obtaining the initial mesh corresponding to the PDE, the Monge-Ampère (MA) method can be used to optimize the initial mesh. However, the aforementioned method requires repeatedly solving the PDE and then optimizing the mesh based on the obtained PDE solution, which is time-consuming and has a large computational resource overhead. Summary of the Invention
[0005] This application provides a data processing method, a neural network training method, and related equipment. The initial grid is updated directly through a first neural network to obtain N second grid points output by the first neural network, which is the updated grid. This eliminates the need for repeated PDE solving, reduces time consumption, and lowers the cost of computer resources. Since the mapping relationship between the N second grid points and the N first grid points is reversible, it avoids solving for meaningless numerical solutions as much as possible.
[0006] To address the aforementioned technical problems, this application provides the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a data processing method that can apply artificial intelligence technology to the field of simulation. The method includes: an execution device acquiring first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial mesh corresponding to the PDE. Further, the PDE is obtained based on the object to be simulated. For example, if a PDE is used for simulation in thermodynamics, electricity, or other fields, the Poisson equation (an example of a PDE) can be selected. The Poisson equation can describe the distribution of thermal fields, electromagnetic fields, or other objects to be simulated in a steady state in the solution space. As another example, when using a PDE for fluid simulation, the Burgers equation can be selected.
[0008] The shape of the initial mesh can also be referred to as the shape of the solution space corresponding to the PDE. The shape of the initial mesh is determined based on the object to be simulated. For example, if the object to be simulated is a reed, the shape of the initial mesh can be the same as the shape of the reed. For example, if the object to be simulated is the thermal field around a heating element on a chip, the shape of the initial mesh can be a top view of the chip or the shape of the chip. As another example, if the object to be simulated is the electromagnetic field around a charge, the shape of the initial mesh can be a solid centered on that charge, etc. The initial mesh corresponding to the PDE is obtained by meshing the solution space (also referred to as the solution region) corresponding to the PDE. The initial mesh includes N first mesh points, where N is a positive integer.
[0009] The execution device inputs the first information into the first neural network to update the initial grid through the first neural network, obtaining N second grid points output by the first neural network. The N second grid points belong to the updated grid, and the updated grid is used to solve the PDE. The mapping relationship between the N second grid points and the N first grid points is reversible, that is, after inputting the N first grid points into the first neural network, the N second grid points output by the first neural network can be obtained, and the N first grid points can be calculated based on the N second grid points.
[0010] In this implementation, the initial mesh to be optimized and the constraints of the parameters in the PDE to be solved are input into the first neural network. The initial mesh is directly updated through the first neural network, resulting in N second mesh points output by the first neural network, which is the updated mesh. This eliminates the need for repeated PDE solving, reducing time consumption and lowering computer resource consumption. Furthermore, since the mapping relationship between the N second mesh points and the N first mesh points is reversible, meaning that any two different first mesh points cannot be updated to the same second mesh point, and the N first mesh points can be any N points within the boundary of the initial mesh, the first neural network needs to ensure that any two points at different positions within the boundary of the initial mesh will not be updated to the same position. This greatly ensures that the updated mesh will not be flipped, and that the solution space corresponding to the PDE can be divided into multiple meshes without overlap or omission. Since "dividing the solution space of the PDE into multiple meshes without overlap or omission" is the basic principle of PDE numerical solution, this approach minimizes the possibility of obtaining meaningless numerical solutions.
[0011] In one possible implementation of the first aspect, the initial mesh corresponding to the PDE can be obtained by uniformly partitioning the solution space corresponding to the PDE, or by non-uniformly partitioning the solution space corresponding to the PDE. Further, the initial mesh corresponding to the PDE can be obtained by randomly decomposing the solution space corresponding to the PDE, or by performing a single partitioning of the solution space corresponding to the PDE using a conventional partitioning method. This conventional partitioning method can specifically be any of the following: Delaunay triangulation, advancing front, or other types of partitioning methods.
[0012] In one possible implementation of the first aspect, the execution device inputs first information into a first neural network to update the initial grid through the first neural network, obtaining N second grid points output by the first neural network. This includes: the execution device inputting the constraint conditions of the parameters in the PDE to be solved and the position information of the N first grid points into the first neural network to update the initial grid through the first neural network, obtaining the position information of the N second grid points output by the first neural network. Alternatively,
[0013] The execution device acquires a first graph structure corresponding to the initial mesh of the PDE. The vertices of the first graph structure represent the first mesh points in the initial mesh, and the edges of the first graph structure represent the connection relationships between different first mesh points in the initial mesh. The execution device inputs the feature information of the constraint conditions of the parameters in the PDE to be solved and the first graph structure into a first neural network to obtain a second graph structure output by the first neural network. The second graph structure is used to indicate the updated mesh, the vertices of the second graph structure represent the second mesh points in the updated mesh, and the edges of the second graph structure represent the connection relationships between different second mesh points.
[0014] In one possible implementation of the first aspect, the execution device inputs first information into a neural network to update the initial grid through the first neural network and obtains second information output by the first neural network. This includes: the execution device inputs the constraint conditions of the parameters in the PDE to be solved into a first sub-neural network to perform a feature extraction operation through the first sub-neural network to obtain feature information of the constraint conditions; based on the feature information of the constraint conditions and the initial grid corresponding to the PDE, the execution device updates the initial grid through a second sub-neural network to obtain N second grid points, wherein the first sub-neural network and the second sub-neural network are included in the first neural network, and the second sub-neural network can be a reversible neural network.
[0015] In this implementation, the constraints of the parameters in the PDE are first extracted. Then, under the constraint of the feature information of the constraints, the initial input grid is updated using the second sub-neural network. This helps to obtain rich information about the constraints of the parameters in the PDE, which in turn helps to improve the understanding of the constraints of the parameters in the PDE by the first neural network. This, in turn, helps to improve the fit between the distribution of multiple grid cells in the updated grid and the PDE to be solved, and helps to obtain a better updated grid.
[0016] In one possible implementation of the first aspect, the second sub-neural network is obtained based on a spline neural network. In this embodiment, since the spline function in the spline neural network is used to process the N first grid points, the boundary between the updated grid and the initial grid remains unchanged, which helps to avoid solving meaningless numerical solutions. In addition, the spline neural network realizes the mapping between each grid point, that is, the spline neural network learns the mapping ability of PDEs to continuous points in the entire solution space, so it can naturally generalize to initial grids of different densities, which helps to ensure the generalization ability of the first neural network to different grid densities.
[0017] In one possible implementation of the first aspect, the first neural network is trained based on a loss function, which includes a first loss function term and a second loss function term. The first loss function term indicates the distance between the second grid points and the target region. The closer the N second grid points are to the target region, the smaller the value of the first loss function term. In other words, the first loss function term indicates the degree of fit between multiple grid cells (or N second grid points) in the updated grid and the target region. The target region in the PDE's solution space refers to the region in the PDE's solution space where the numerical fluctuation of the solution is large, and the numerical fluctuation of the solution within a unit region corresponding to the aforementioned region exceeds a target threshold. For example, if the PDE aims to simulate the thermal field around a heating element on a chip, the target region can be a region on the chip with drastic temperature changes, or it can be understood as a region on the chip where the temperature change within a unit region exceeds a target threshold. As another example, if the PDE aims to simulate the deformation of a product or product component under pressure, the target region can be a region in the product or product component where deformation occurs, etc., and so on. This is not an exhaustive list. The second loss function term indicates the uniformity of the distribution of the N second grid points. The more uniform the distribution of the N second grid points, the smaller the value of the second loss function term.
[0018] In this implementation, the first and second loss function terms can guide the updated mesh to fit the target region as closely as possible while maintaining overall uniformity. This allows technicians to determine, based on their technical experience, the regions in the PDE solution space where the PDE value changes drastically (i.e., the target region in the PDE solution space). Since this method does not require solving the PDE, it can significantly shorten the training time of the first neural network and reduce the training cost of the first neural network.
[0019] In one possible implementation of the first aspect, the target region in the solution space of the PDE to be solved can represent one or more lines in the solution space of the PDE, or the target region can include one or more faces in the solution space of the PDE. For any one of the N predicted grid points (hereinafter referred to as the "target grid point" for convenience), optionally, the training device can determine the distance between the target grid point and the nearest point in the target region as the distance between the target grid point and the target region. Furthermore, the distance between the target grid point and the nearest point in the target region can specifically be any of the following distances: L1 distance, L2 distance, Euclidean distance, cosine distance, or other types of distance, etc.
[0020] In one possible implementation of the first aspect, the first neural network is trained based on a loss function, which includes a third loss function term. The updated grid is used to obtain the predicted solution of the PDE on the updated grid. The third loss function term indicates the similarity between the predicted solution of the PDE on the updated grid and the expected solution of the PDE on the updated grid. In this implementation, after obtaining the updated grid, the similarity between the predicted solution and the expected solution of the PDE on the updated grid is also obtained. Training the first neural network using the third loss function term can improve the tightness between the grid partitioning process and the PDE solving process, that is, it is beneficial to make the partitioned grid more compatible with the PDE solving stage, thereby helping the trained first neural network to obtain a better updated grid.
[0021] In one possible implementation of the first aspect, the first neural network is trained based on a loss function, which includes a fourth loss function term indicating the similarity between N second grid points and N desired grid points. The N desired grid points are obtained using any of the following methods: Monge-Ampère method, moving mesh finite element method, attraction and repulsion based r-adaptation, and moving mesh partial differential equation method (PDE). In this implementation, the first neural network learns the ability to mesh the solution space of the PDE using traditional methods. However, compared to the aforementioned traditional methods, using the first neural network to optimize the initial mesh eliminates the need for repeatedly solving the PDE, thus improving the efficiency of the mesh generation process and reducing the computer resources consumed in the mesh generation process.
[0022] In one possible implementation of the first aspect, the PDE is used to characterize any of the following: the thermal field generated by the heat-generating elements on the chip, the deformation generated when the product is under pressure, or the deformation generated when the product assembly is under pressure. This implementation provides various specific application scenarios for solving the PDE, improving the implementation flexibility of this solution.
[0023] Secondly, embodiments of this application provide a method for training a neural network, which can apply artificial intelligence technology to the field of simulation. The method includes: a training device acquiring first information, wherein the first information includes the constraints of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE corresponds to the simulated object, the shape of the initial grid is determined based on the simulated object, and the initial grid includes N first grid points, where N is a positive integer; the training device inputs the first information into a first neural network to update the initial grid through the first neural network, obtaining N predicted grid points output by the first neural network, the N predicted grid points belonging to the updated grid, the updated grid being used to solve the PDE, and the mapping relationship between the N predicted grid points and the N first grid points being invertible; and training the first neural network using a loss function to obtain the trained neural network, the value of which is obtained based on the N predicted grid points.
[0024] In one possible implementation of the second aspect, the loss function includes a third loss function term, and the training device trains the first neural network using the loss function, including: the training device generating a value of the loss function based on the value of the third loss function term, and training the first neural network based on the value of the loss function, wherein the third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
[0025] In one possible implementation of the second aspect, before the training device generates the value of the loss function based on the value of the third loss function term, the method further includes: the training device solving the PDE using a PDE solver based on the updated grid to obtain a predicted solution of the PDE on the updated grid, the predicted solution of the PDE on the updated grid being used to generate the value of the third loss function term; or, the training device inputting the updated grid and the PDE into a second neural network to obtain the difference between the predicted solution of the PDE generated by the second neural network on the updated grid and the expected solution.
[0026] In this implementation, two methods for generating the value of the third loss function term are provided, which helps to improve the implementation flexibility of the embodiments of this application; in addition, by using the trained second neural network to simulate the function of the PDE solver, the efficiency of the PDE solving process is improved, which in turn helps to improve the efficiency of the training process of the first neural network.
[0027] In the second aspect of this application, the training device can also be used to execute the steps of the first aspect and the various possible implementations of the first aspect. The specific implementation methods, the meanings of the terms, and the beneficial effects of the steps in the various possible implementations of the second aspect can all be found in the first aspect, and will not be repeated here.
[0028] Thirdly, embodiments of this application provide a method for training a neural network, which can apply artificial intelligence technology to the field of simulation. The method includes: a training device acquiring first information, wherein the first information includes the constraints of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE corresponding to the simulated object, the shape of the initial grid being determined based on the simulated object, and the initial grid including N first grid points, where N is a positive integer; the training device inputting the first information into a first neural network to update the initial grid through the first neural network, obtaining N predicted grid points output by the first neural network, the N predicted grid points belonging to the updated grid, and the updated grid being used to solve the PDE; the training device training the first neural network using a loss function to obtain the trained neural network, the value of which is obtained based on the N predicted grid points.
[0029] The loss function includes a first loss function term and a second loss function term. The training device uses the loss function to train the first neural network, including: generating the value of the first loss function term based on the distance between N predicted grid points and the target region. The first loss function term indicates the distance between the N predicted grid points and the target region. The closer the N predicted grid points are to the target region, the smaller the value of the first loss function term. Generating the value of the second loss function term based on the N predicted grid points. The second loss function term indicates the uniformity of the distribution of the N predicted grid points. The more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term. Generating the value of the loss function based on the values of the first and second loss function terms, and training the first neural network based on the value of the loss function.
[0030] In one possible implementation of the third aspect, the mapping relationship between the N predicted grid points and the N first grid points is invertible.
[0031] In the third aspect of this application, the training device can also be used to perform the steps performed by the training device in the second aspect and various possible implementations of the second aspect. The specific implementation methods, the meanings of the terms, and the beneficial effects of the steps in the various possible implementations of the third aspect can all be found in the second aspect, and will not be repeated here.
[0032] Fourthly, embodiments of this application provide a data processing apparatus that can apply artificial intelligence technology to the field of simulation. The data processing apparatus includes: an acquisition module for acquiring first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE is obtained based on the object to be simulated, the shape of the initial grid is determined based on the object to be simulated, and the initial grid includes N first grid points, where N is a positive integer; and an update module for inputting the first information into a first neural network to update the initial grid through the first neural network, obtaining N second grid points output by the first neural network, the N second grid points belonging to the updated grid, the updated grid being used to solve the PDE, and the mapping relationship between the N second grid points and the N first grid points being invertible.
[0033] In the fourth aspect of this application, the data processing apparatus can also be used to perform the steps of the execution device in the first aspect and various possible implementations of the first aspect. The specific implementation methods, the meanings of the terms, and the beneficial effects of the steps in the various possible implementations of the fourth aspect can be found in the fourth aspect, and will not be repeated here.
[0034] Fifthly, embodiments of this application provide a neural network training device that can apply artificial intelligence technology to the simulation field. The neural network training device includes: an acquisition module for acquiring first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE corresponds to the simulated object, the shape of the initial grid is determined based on the simulated object, and the initial grid includes N first grid points, where N is a positive integer; an update module for inputting the first information into a first neural network to update the initial grid through the first neural network, obtaining N predicted grid points output by the first neural network, the N predicted grid points belonging to the updated grid, the updated grid being used to solve the PDE, and the mapping relationship between the N predicted grid points and the N first grid points being invertible; and a training module for training the first neural network using a loss function to obtain the trained neural network, the value of which is obtained based on the N predicted grid points.
[0035] In the fifth aspect of this application, the training device for the neural network can also be used to execute the steps performed by the training device in the second aspect and various possible implementations of the second aspect. The specific implementation methods, the meanings of the terms, and the beneficial effects of the steps in the various possible implementations of the fifth aspect can all be found in the second aspect, and will not be repeated here.
[0036] Sixthly, embodiments of this application provide a computer program product, which includes a program that, when run on a computer, causes the computer to perform the data processing method described in the first aspect; or causes the computer to perform the neural network training method described in the second aspect.
[0037] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the data processing method described in the first aspect; or causes the computer to perform the neural network training method described in the second aspect.
[0038] Eighthly, embodiments of this application provide an execution device, including a processor and a memory, the processor being coupled to the memory, the memory being used to store a program; the processor being used to execute the program in the memory, causing the execution device to perform the data processing method described in the first aspect above.
[0039] Ninthly, embodiments of this application provide a training device, including a processor and a memory, wherein the processor is coupled to the memory, the memory is used to store a program, and the processor is used to execute the program in the memory, causing the training device to perform the neural network training method described in the second aspect above.
[0040] In a tenth aspect, this application provides a chip system including a processor for supporting an execution device or training device in implementing the functions involved in the foregoing aspects, such as transmitting or processing data and / or information involved in the foregoing methods. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the terminal device or communication device. This chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description
[0041] Figure 1a A schematic diagram of the main framework of artificial intelligence provided in the embodiments of this application;
[0042] Figure 1b A schematic diagram of the solution of the PDE in the solution space in the data processing method provided in the embodiments of this application;
[0043] Figure 2a A system architecture diagram of a grid processing system provided in an embodiment of this application;
[0044] Figure 2b A flowchart illustrating a data processing method provided in an embodiment of this application;
[0045] Figure 3A schematic flowchart illustrating a neural network training method provided in an embodiment of this application;
[0046] Figure 4 Two schematic diagrams of the initial grid in the data processing method provided in the embodiments of this application;
[0047] Figure 5 A schematic diagram of a first sub-neural network in the data processing method provided in the embodiments of this application;
[0048] Figure 6 A schematic diagram of the first neural network in the data processing method provided in the embodiments of this application;
[0049] Figure 7 A schematic diagram of the target area in the data processing method provided in the embodiments of this application;
[0050] Figure 8 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0051] Figure 9 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0052] Figure 10 A comparative schematic diagram of mesh updates using a first neural network and the Monge-Ampère method, provided for embodiments of this application;
[0053] Figure 11 A schematic diagram of a data processing apparatus provided in an embodiment of this application;
[0054] Figure 12 A schematic diagram of a neural network training device provided in an embodiment of this application;
[0055] Figure 13 A schematic diagram of the structure of the execution device provided in the embodiments of this application;
[0056] Figure 14 A schematic diagram of the structure of a training device provided in an embodiment of this application;
[0057] Figure 15 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation
[0058] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0059] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0060] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1a , Figure 1a The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.
[0061] (1) Infrastructure
[0062] The infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. Communication with the outside world is achieved through sensors; computing power is provided by intelligent chips, which can specifically employ hardware acceleration chips such as central processing units (CPUs), embedded neural network processing units (NPUs), graphics processing units (GPUs), application-specific integrated circuits (ASICs), or field-programmable gate arrays (FPGAs). The basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.
[0063] (2) Data
[0064] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0065] (3) Data processing
[0066] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.
[0067] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training of data by symbolizing and formalizing it.
[0068] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.
[0069] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.
[0070] (4) General ability
[0071] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0072] (5) Smart Products and Industry Applications
[0073] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They encapsulate overall artificial intelligence solutions, productize intelligent information decision-making, and realize practical applications. Their application areas mainly include: intelligent terminals, intelligent manufacturing, intelligent transportation, smart homes, intelligent healthcare, intelligent security, autonomous driving, and smart cities.
[0074] The embodiments of this application can apply artificial intelligence technology to the field of PDE solving. A large number of physical systems in the above-mentioned application fields of artificial intelligence technology can be described by PDE. For example, electromagnetic simulation, thermal simulation, electrostatic field simulation, semiconductor device simulation, fluid simulation or structural simulation can be performed by PDE. The PDE to be solved is obtained based on the object to be simulated.
[0075] Furthermore, as an example, in the field of intelligent manufacturing, during the chip manufacturing process, one or more heat-generating elements are disposed on the chip. To determine the location of these heat-generating elements on the chip, a Processed Energy (PDE) simulation can be performed. That is, given the location of at least one heat-generating element on the chip, the PDE is used to simulate the thermal field generated by that element. The PDE is then used to characterize the temperature in the solution space corresponding to the chip. During the solution process of the PDE, the solution space can be decomposed into small grids, and the solution of the PDE in each grid cell (i.e., the temperature corresponding to each grid cell) can be obtained. For a more intuitive understanding of this solution, please refer to [link to relevant documentation]. Figure 1b , Figure 1b This is a schematic diagram illustrating the solution of the PDE in the solution space within the data processing method provided in the embodiments of this application. It should be noted that... Figure 1b The solution of the PDE in the solution space is only visualized and displayed. In practical applications, the solution of the PDE can be displayed without using images. Figure 1b Taking the use of PDE for thermal simulation as an example, where the solution space is two-dimensional, as shown in the figure, the PDE solution space is a square two-dimensional space divided into multiple non-uniform mesh elements. Different mesh elements may have the same or different colors. Different colored mesh elements represent different temperatures, while mesh elements of the same color represent the same temperature. This should be understood... Figure 1b The examples in this document are for illustrative purposes only and are not intended to limit the scope of this solution.
[0076] As another example, in the field of intelligent manufacturing, when it is necessary to perform stress analysis on a product, a PDE can be used to perform structural simulation of the product. The boundary of the solution space of the PDE can be determined based on the shape of the product, so the solution space of the PDE can be a three-dimensional space. After dividing the solution space of the PDE into multiple grids (that is, dividing the entire product into multiple grid cells), each grid cell represents a small part of the product. The solution of the PDE in each grid cell can be obtained. The solution in each grid cell can represent the deformation of a small part of the product after applying pressure to the product.
[0077] As another example, in the field of smart homes, when path planning is required for a robotic vacuum cleaner, a Programmable Array Decomposition (PDE) can be used to simulate the robot's movement path. The boundary of the PDE's solution space can be determined based on the robot's movement range. After dividing the PDE's solution space into multiple grids (that is, dividing the robot's entire movement range into multiple grid cells), the solution of the PDE in each grid cell can be obtained. The solution of the PDE in each grid cell is used to indicate whether the robot has passed through the area represented by that grid cell, etc. It should be noted that the above description is only for the convenience of understanding the application scenario of this solution. The embodiments of this application can also be applied to other application scenarios, and the application scenarios of the embodiments of this application will not be exhaustively listed here.
[0078] In all the aforementioned application scenarios, before solving the PDE, it is necessary to decompose the solution space corresponding to the PDE into multiple grid cells. To reduce the computational overhead of the step of "obtaining the grid corresponding to the solution space of the PDE," this application provides a data processing method. The aforementioned method utilizes a trained first neural network to optimize the grid corresponding to the solution space of the PDE. Before introducing the data processing method provided in this application, please refer to... Figure 2a , Figure 2a A system architecture diagram of the grid processing system provided in this application embodiment is shown. Figure 2a In the grid processing system 200, there are training devices 210, databases 220, execution devices 230, data storage systems 240 and client devices 250. The execution devices 230 include computing modules 231.
[0079] The database 220 stores a training dataset. The training device 210 generates a first model / rule 201 and iteratively trains the first model / rule 201 using the training dataset to obtain the trained first model / rule 201. The first model / rule 201 can be specifically represented as a neural network or as a non-neural network model. In this embodiment, the example of the first model / rule 201 being represented as a neural network is used for illustration.
[0080] The execution device 230 can access data, code, etc., in the data storage system 240, and can also store data, instructions, etc., in the data storage system 240. The data storage system 240 can be located within the execution device 230, or it can be an external memory relative to the execution device 230.
[0081] The trained first model / rule 201 obtained by training device 210 can be deployed to execution device 230. Execution device 230 can optimize the initial mesh corresponding to the PDE using the first model / rule 201 to obtain the updated mesh corresponding to the PDE. For details, please refer to [link to relevant documentation]. Figure 2b , Figure 2b This is a flowchart illustrating a data processing method provided in an embodiment of this application. A1. The execution device acquires first information, which includes the constraints on the parameters of the PDE (partial differential equation) to be solved and the initial mesh corresponding to the PDE. The PDE is obtained based on the object to be simulated. The boundary of the initial mesh corresponds to the solution space of the PDE. The boundary of the initial mesh is determined based on the object to be simulated. The initial mesh includes N first mesh points, where N is a positive integer. A2. The execution device inputs the first information into a first model / rule 201 to update the initial mesh through the first model / rule 201, obtaining N second mesh points output by the first model / rule 201. The N second mesh points belong to the updated mesh, and the updated mesh is used to solve the PDE. The mapping relationship between the N second mesh points and the N first mesh points is invertible.
[0082] In this embodiment, the initial grid is updated directly through the first neural network, eliminating the need for repeated PDE solving, thus reducing time consumption and lowering computer resource consumption. Furthermore, since the mapping relationship between the N second grid points and the N first grid points is reversible, it largely ensures that the updated grid will not flip, which in turn largely ensures that the solution space corresponding to the PDE can be divided into multiple grids without overlap or omission. Since "dividing the solution space of the PDE into multiple grids without overlap or omission" is the basic principle of PDE numerical solution, it minimizes the possibility of obtaining meaningless numerical solutions.
[0083] In some embodiments of this application, please refer to Figure 2a The training device 210, the execution device 230, and the client device 250 can be independent devices. The execution device 230 is configured with an I / O interface to interact with the client device 250. The "user" can input the first information to the I / O interface of the execution device 230 through the client device 250, so that the execution device 230 generates an updated mesh through the configured first model / rule 201.
[0084] Furthermore, in one implementation, the execution device 230 can send the updated mesh to the client device 250 via an I / O interface. The client device 250 can solve the PDE based on the updated mesh and provide the solution of the PDE on the updated mesh to the user.
[0085] In another implementation, execution device 230 can solve the PDE based on the updated mesh and send the solution of the PDE on the updated mesh to client device 250, which then provides the solution of the PDE on the updated mesh to the user.
[0086] It is worth noting that Figure 2a This is merely a schematic diagram of the architecture of two mesh processing systems provided in the embodiments of the present invention. The positional relationships between the devices, components, modules, etc. shown in the figure do not constitute any limitation. For example, in some other embodiments of this application, the execution device 230 can be configured in the client device 250. As an example, when the client device is a mobile phone or tablet, the execution device 230 can be a module in the host CPU of the mobile phone or tablet used to optimize the mesh in the solution space of the PDE. The execution device 230 can also be a graphics processing unit (GPU) or neural network processor (NPU) in the mobile phone or tablet. The GPU or NPU is mounted on the host processor as a coprocessor, and the host processor allocates tasks.
[0087] In some other embodiments of this application, the training device 210 and the execution device 230 may specifically be the same device, that is, the training device 210 and the execution device 230 may be the server corresponding to the client device 250. In some other embodiments of this application, the training device 210, the execution device 230 and the client device 250 may be a single device, etc. The grid processing system 200 in the embodiments of this application can be flexibly constructed according to actual application scenarios, and is not limited here.
[0088] Based on the above description, the specific implementation process of the training and inference stages of the first neural network provided in the embodiments of this application will now be described.
[0089] I. Training Phase
[0090] In this embodiment, the training phase describes how the training device 210 uses the training data in the database 220 to obtain the trained first neural network. For details, please refer to [link to specific documentation]. Figure 3 , Figure 3 This is a flowchart illustrating a neural network training method provided in an embodiment of this application. The neural network training method provided in an embodiment of this application may include:
[0091] 301. The training device acquires first information, which includes the constraints of the parameters in the PDE to be solved and the initial mesh corresponding to the PDE. The PDE is obtained based on the object to be simulated, and the shape of the initial mesh is determined based on the object to be simulated. The initial mesh includes N first mesh points.
[0092] In this embodiment of the application, the training device may be configured with a training data set corresponding to a class of simulation problems. The training data set may include multiple sets of training data. Each set of training data includes at least first information, which includes the constraint conditions of the parameters in the PDE (partial differential equation) to be solved and the initial mesh corresponding to the PDE.
[0093] The PDE is derived from the object to be simulated, and the same type of simulation problem can be described using the same PDE. For example, a PDE can be used to characterize any of the following: the thermal field generated by a heat-generating element on a chip, the deformation of a product under pressure, the deformation of a product component under pressure, or other types of information, depending on the specific application scenario. This is not exhaustive. Multiple specific application scenarios for solving PDEs are provided, improving the flexibility of this solution.
[0094] For different simulation problems of the same type, any of the following elements may be different: the shape of the solution space corresponding to the PDE, the size of the solution space corresponding to the PDE, the constraint conditions of the parameters in the PDE, the density of the initial mesh corresponding to the PDE, or other elements, etc., which will not be listed here.
[0095] As an example, considering the shape of the solution space corresponding to a PDE, a certain type of simulation problem involves simulating the thermal field on a chip. In one solution, the solution space corresponding to this PDE can be a top view of the chip (i.e., the initial mesh can be two-dimensional). In another solution, the solution space corresponding to this PDE can also be the shape of the chip with thickness (i.e., the initial mesh can be three-dimensional). Both of the aforementioned solutions represent the same type of simulation problem. As another example, considering different constraints on the parameters in the PDE, for instance, in one solution, two heating elements are placed on the chip, and in another solution, three heating elements are placed on the chip. Both of the aforementioned solutions represent the same type of simulation problem. These examples are only for the convenience of understanding the same type of simulation problem and are not intended to limit this approach.
[0096] Furthermore, different types of simulation problems can be described using different types of PDEs. For example, if a PDE is used for simulations in thermodynamics, electricity, or other fields, the Poisson equation (an example of a PDE) can be chosen. The Poisson equation can describe the distribution of thermal fields, electromagnetic fields, or other objects to be simulated in a steady state in the solution space. As another example, when using a PDE for fluid simulation, the Burgers equation can be chosen. The specific types of PDEs used will not be exhaustively listed here.
[0097] The object to be simulated can be a visible object, such as an airplane, mobile phone, tablet, or reed. The object to be simulated can also be an invisible object, such as a thermal field, electromagnetic field, or the movement trajectory of wind. These are not exhaustive examples.
[0098] The shape of the initial mesh can also be called the shape of the solution space corresponding to the PDE. The shape of the initial mesh is determined based on the object to be simulated. For example, if the object to be simulated is a reed, the shape of the initial mesh can be the same as the shape of the reed. For example, if the object to be simulated is the thermal field around a heating element on a chip, the shape of the initial mesh can be a top view of the chip or the shape of the chip. For another example, if the object to be simulated is the electromagnetic field around a charge, the shape of the initial mesh can be a solid centered on that charge, and so on. The shapes of the initial mesh are not exhaustively listed here.
[0099] The initial mesh corresponding to the PDE is obtained by meshing the solution space (or solution domain) corresponding to the PDE. This initial mesh includes N first mesh points. Since the solution space (i.e., the initial mesh) corresponding to the PDE can be two-dimensional or three-dimensional, each mesh element in the initial mesh can be specifically represented as a two-dimensional or three-dimensional mesh element. For example, each mesh element can be represented as a triangle, quadrilateral, tetrahedron, hexahedron, or other shapes, etc., which are not exhaustively listed here.
[0100] Furthermore, the initial mesh corresponding to the PDE can be obtained by uniformly partitioning the solution space corresponding to the PDE, or the initial mesh corresponding to the PDE can be obtained by non-uniformly partitioning the solution space corresponding to the PDE.
[0101] Furthermore, the initial mesh corresponding to the PDE can be obtained by the training device through random decomposition of the solution space corresponding to the PDE, or the initial mesh corresponding to the PDE can be obtained by the training device through a traditional meshing method to perform a meshing of the solution space corresponding to the PDE. The traditional meshing method can be any of the following: Delaunay triangulation, advancing front, or other types of meshing methods, etc., which will not be listed here.
[0102] To understand this solution more directly, please refer to [link / reference]. Figure 4 , Figure 4Two schematic diagrams of the initial grid in the data processing method provided in the embodiments of this application. Figure 4 The example given is that the initial mesh corresponding to the PDE is two-dimensional. Figure 4 Includes two sub-diagrams, left and right. Figure 4 The initial grid shown in the left sub-schematic diagram consists of multiple uniformly distributed grid cells. Figure 4 The right sub-schematic diagram shows that the initial mesh consists of multiple non-uniformly distributed mesh cells. It should be understood that... Figure 4 The examples provided are for illustrative purposes only and are not intended to limit the scope of this solution.
[0103] Optionally, in order to improve the generalization ability of the first neural network after training, the training data in different groups in the training dataset can correspond to different simulation problems in the same category of simulation problems. For example, a certain category of simulation problems can be described by the Poisson equation. In one group of three different training data, the initial grid density is 15x15, the initial grid density in another group of training data can be 20x20, and the initial grid density in yet another group of training data can be 23x23, etc.
[0104] As another example, in fluid simulation using the Burgers equations, the initial grid density in the training dataset can range from 15x15 to 20x20. The Burgers equations can be used to simulate nine different fluid trajectories, each containing 60 time steps. Since the constraints on the parameters in the Burgers equations in fluid simulation include the fluid state in the previous time step, the fluid states in the previous time step can be the same or different for different time steps within the 60 time steps. It should be understood that this example is only for the convenience of understanding the diversity of training datasets corresponding to PDEs used to solve a class of simulation problems and is not intended to limit this approach.
[0105] 302. The training device inputs the first information into the first neural network to update the initial grid through the first neural network, and obtains N predicted grid points output by the first neural network. The N predicted grid points belong to the updated grid, and the mapping relationship between the N predicted grid points and the N first grid points is reversible.
[0106] In this embodiment, the training device inputs first information into a first neural network to update the initial grid, obtaining N predicted grid points output by the first neural network. These N predicted grid points belong to the updated grid, and the N predicted grid points output by the first neural network can specifically represent the position information of these N predicted grid points. For example, the position information of each grid point can specifically represent the coordinates of each grid point in the solution space of the PDE.
[0107] The mapping relationship between N predicted grid points and N first grid points is reversible. That is, after inputting N first grid points into the first neural network, N predicted grid points can be obtained from the output of the first neural network. Furthermore, N first grid points can be calculated based on the N predicted grid points.
[0108] Specifically, in one implementation, the first neural network may include a first sub-neural network and a second sub-neural network. The training device can input the constraints of the parameters in the PDE to be solved into the first sub-neural network to perform a feature extraction operation through the first sub-neural network to obtain the feature information of the constraint. Based on the feature information of the constraint and the initial grid corresponding to the PDE, the training device can update the initial grid through the second sub-neural network to obtain N predicted grid points.
[0109] The first sub-neural network can specifically be a convolutional neural network, a residual neural network, or other neural networks used for feature extraction, etc., which will not be listed exhaustively here. For a more intuitive understanding of this scheme, please refer to [the relevant documentation / reference]. Figure 5 , Figure 5 This is a schematic diagram of the first sub-neural network in the data processing method provided in the embodiments of this application. The constraint conditions of the parameters in the PDE to be solved are input into the first sub-neural network (i.e., the feature extraction network). After uniform sampling, convolution and pooling processing by the first sub-neural network, the feature information of the constraint conditions can be obtained. It should be understood that... Figure 5 The examples provided are for illustrative purposes only and are not intended to limit the scope of this solution.
[0110] More specifically, regarding the processing of the "second sub-neural network," in one implementation, the training device can input the feature information of the constraint and the position information of N first grid points into the second sub-neural network to obtain the position information of N predicted grid points output by the second sub-neural network. The training device generates an updated grid based on the position information of the N predicted grid points, the connection relationship between the N first grid points, and the correspondence between the N predicted grid points and the N first grid points.
[0111] The second sub-neural network can be a reversible neural network, or alternatively, it can be based on a spline neural network.
[0112] Furthermore, after the training device sequentially inputs the coordinates of each first grid point into the spline neural network, it can transform each dimension of the first grid point's coordinates through a monotonic spline function to obtain the updated coordinates of the first grid point (i.e., the predicted coordinates of the grid point). If the solution space of the PDE is two-dimensional, the coordinates of the first grid point can include coordinates in two dimensions; if the solution space of the PDE is three-dimensional, the coordinates of the first grid point can include coordinates in three dimensions.
[0113] In this embodiment, since the spline function in the spline neural network is used to process the N first grid points, the boundary between the updated grid and the initial grid remains unchanged, which helps to avoid solving meaningless numerical solutions. In addition, the spline neural network realizes the mapping between each grid point, that is, the spline neural network learns the mapping ability of PDE to continuous points in the entire solution space, so it can naturally generalize to initial grids of different densities, which helps to ensure the generalization ability of the first neural network to different grid densities.
[0114] In another implementation, the training device can input the constraints of the parameters in the PDE to be solved into a first sub-neural network to perform feature extraction and obtain the feature information of the constraints. The training device can obtain a first graph structure corresponding to the initial grid of the PDE. The vertices of the first graph structure represent the first grid points in the initial grid, and the edges of the first graph structure represent the connection relationships between different first grid points in the initial grid. The training device inputs the feature information of the constraints and the first graph structure into a second sub-neural network to obtain a second graph structure output by the second sub-neural network. The vertices of the second graph structure represent the predicted grid points in the updated grid, and the edges of the second graph structure represent the connection relationships between different predicted grid points. That is, the second graph structure is used to indicate the updated grid.
[0115] The second sub-neural network can be a reversible neural network. Optionally, the second sub-neural network can be based on a spline neural network, or it can be based on a graph attention network (GAT), or it can be based on other types of neural networks, etc., without limitation here.
[0116] To understand this solution more directly, in conjunction with Figure 6 The processing procedure of the first neural network in the embodiments of this application is described below, please refer to the following: Figure 6 , Figure 6A schematic diagram of the first neural network in the data processing method provided in the embodiments of this application. Figure 6 Taking fluid simulation using PDEs (Programmable Array Decomposition) as an example, where the solution space of the PDE is two-dimensional... Figure 6 The constraints and initial mesh used to describe the fluid state at the previous time step are visualized and displayed, such as... Figure 6 As shown, the constraints describing the fluid state at the previous time step and the constraints of other parameters in the PDE are input into the first sub-neural network for feature extraction; then, the feature information of the constraints and the initial mesh are input into the second sub-neural network to obtain the updated mesh. Figure 6 As shown, the distribution of multiple grid cells differs between the initial and updated grids. That is, the first neural network makes the grid cells denser in some regions of the PDE solution space and sparser in others. This should be understood. Figure 6 The examples provided are for illustrative purposes only and are not intended to limit the scope of this solution.
[0117] In this embodiment, the constraints of the parameters in the PDE are first extracted. Then, under the constraint of the feature information of the constraints, the initial input grid is updated using the second sub-neural network. This is beneficial to obtaining rich information about the constraints of the parameters in the PDE, which is also beneficial to improving the understanding of the constraints of the parameters in the PDE by the first neural network. This is beneficial to improving the fit between the distribution of multiple grid cells in the updated grid and the PDE to be solved, and is beneficial to obtaining a better updated grid.
[0118] In another implementation, the first neural network may also include only the second sub-neural network. In this case, step 302 may include: the training device updates the initial grid through the second sub-neural network based on the constraints of the parameters in the PDE and the initial grid corresponding to the PDE, to obtain N predicted grid points.
[0119] More specifically, in one implementation, the training device can input the constraint and the position information of N first grid points into the second sub-neural network to obtain the position information of N predicted grid points output by the second sub-neural network; the training device generates an updated grid based on the position information of the N predicted grid points, the connection relationship between the N first grid points, and the correspondence between the N predicted grid points and the N first grid points.
[0120] In another implementation, the training device can acquire a first graph structure corresponding to the initial grid of the PDE, input the constraints and the first graph structure into a second sub-neural network, and obtain a second graph structure output by the second sub-neural network. The second graph structure is used to indicate the updated grid.
[0121] It should be noted that the concepts of the second sub-neural network, the first graph structure, and the second graph structure can be found in the description of the previous implementation method, and will not be repeated here.
[0122] 303. The training device generates the value of the first loss function term based on the distance between the N predicted grid points and the target area. The first loss function term indicates the distance between the predicted grid points and the target area. The closer the N second grid points are to the target area, the smaller the value of the first loss function term.
[0123] In some embodiments of this application, if the target loss function includes a first loss function term and a second loss function term, then each set of training data may also include the location information of the target region in the solution space of the PDE. The location information of the target region in the solution space of the PDE can be the region in which the solution of the PDE changes drastically, as considered by those skilled in the art. The training device can generate the value of the first loss function term based on the distance between N predicted grid points and the target region in the solution space of the PDE to be solved. The first loss function term indicates the distance between the N predicted grid points and the target region. The closer the distance between the N second grid points and the target region, the smaller the value of the first loss function term. That is, the first loss function term is used to indicate the degree of fit between multiple grid cells in the updated grid and the target region.
[0124] Furthermore, the target region in the solution space of the PDE to be solved can also be called the target interface in the solution space of the PDE to be solved. The aforementioned target region can represent one or more lines in the solution space of the PDE, or the target region can include one or more faces in the solution space of the PDE.
[0125] In a PDE's solution space, the target region refers to the area where the numerical fluctuation of the solution is large. This region corresponds to a unit area where the numerical fluctuation of the solution exceeds a target threshold. For example, if the goal of PDE is to simulate the thermal field around a heat-generating element on a chip, the target region could be an area on the chip where the temperature changes drastically, or an area on the chip where the temperature change exceeds a target threshold. Another example is if the goal of PDE is to simulate the deformation of a product or component under pressure, the target region could be the area within the product or component where deformation occurs. The specific selection of the target region depends on the actual application scenario and is not exhaustive here.
[0126] For any one of the N predicted grid points (hereinafter referred to as the "target grid point" for ease of description), optionally, the training device can determine the distance between the target grid point and the nearest point in the target region as the distance between the target grid point and the target region.
[0127] Furthermore, the distance between the target grid point and the nearest point in the target area can be any of the following distances: L1 distance, L2 distance, Euclidean distance, cosine distance, or other types of distance between the target grid point and the nearest point in the target area, etc., without limitation here.
[0128] The training device iterates through each of the N predicted grid points to obtain the distance between each predicted grid point and the target region, and determines the value of the first loss function term as any of the following: the mean of the distances between the N predicted grid points and the target region, the sum of the distances between the N predicted grid points and the target region, the median of the distances between the N predicted grid points and the target region, or the value obtained after processing the distances between the N predicted grid points and the target region through other calculation methods, etc.
[0129] 304. The training device generates the value of the second loss function term based on N predicted grid points. The second loss function term indicates the uniformity of the distribution of the N predicted grid points. The more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term.
[0130] In some embodiments of this application, the training device may also generate a value for a second loss function term based on N predicted grid points, wherein the second loss function term indicates the uniformity of the distribution of the N predicted grid points, and the more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term.
[0131] Specifically, the training device can determine the value of the second loss function term by the mean of the L2 distance between each predicted grid point and its first-nearest neighbor predicted grid point, or by the mean of the L4 distance between each predicted grid point and its first-nearest neighbor predicted grid point, or by other calculations to represent the uniformity of the distribution of N predicted grid points in the solution space of the PDE, etc., which will not be exhaustively listed here.
[0132] To understand this solution more directly, please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of a target area in the data processing method provided in the embodiments of this application. Figure 7 Taking the PDE solution space as two-dimensional, the initial mesh corresponding to the PDE as including multiple uniform meshes, and the target region as multiple lines in the PDE solution space as an example. Figure 7 Includes two sub-diagrams, left and right. Figure 7 The left sub-diagram represents the initial grid of the PDE. Figure 7The right sub-diagram represents the updated grid, that is, the grid obtained after updating the initial grid using the first neural network trained with the first and second loss function terms, as shown below. Figure 7 As shown, the grid cells around the target area (i.e., the 6 bold lines) are denser, and the multiple grid cells included in the updated grid ensure overall uniformity. It should be understood that... Figure 7 The examples provided are for illustrative purposes only and are not intended to limit the scope of this solution.
[0133] 305. The training device uses the PDE solver to solve the PDE based on the updated grid, and obtains the predicted solution of the PDE on the updated grid.
[0134] In some embodiments of this application, after obtaining the updated mesh, the training device can input the updated mesh and the PDE to be solved into the PDE solver to solve the PDE and obtain the predicted solution of the PDE on the updated mesh. The predicted solution of the PDE on the updated mesh includes the predicted solution of the PDE on each mesh cell in the updated mesh.
[0135] 306. The training device generates the value of a third loss function term based on the predicted solution of the PDE on the updated grid and the expected solution of the PDE on the updated grid. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
[0136] In some embodiments of this application, if the target loss function includes a third loss function term, each set of training data may also include the expected solution of the PDE in the solution space (also referred to as the expected solution of the PDE on the updated grid). The expected solution of the PDE in the solution space includes the expected solution of the PDE on each grid cell in the updated grid. The training device can generate the value of the third loss function term, which indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid. The training objective corresponding to the third loss function term includes improving the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
[0137] In one implementation of obtaining the desired solution of the PDE in the solution space, a traditional grid partitioning method can be used to divide the PDE solution space into a grid of target density. The target density is much larger than the density of the updated grid. For example, if the updated grid contains 20 by 20 grid cells, the target density grid may contain 100 by 100 grid cells. The PDE solver is then used to obtain the solution of the PDE in the grid of target density (which can be regarded as the desired solution). Then, based on the positional correspondence between the grid of target density and the updated grid, the desired solution of the PDE on the updated grid can be obtained.
[0138] In another implementation, the actual simulation experiment can be performed directly on the simulation object to be solved, and the expected solution of PDE on the updated mesh can be measured. Here, we will not exhaustively list the ways to obtain the expected solution of PDE in the solution space.
[0139] 307. The training device inputs the updated grid and PDE into the second neural network, obtains the difference between the predicted solution and the expected solution of the PDE generated by the second neural network on the updated grid, and obtains the value of the third loss function term.
[0140] In some embodiments of this application, if the target loss function includes a third loss function term, a second neural network can also be configured on the training device. The training device inputs the updated grid and PDE into the second neural network to obtain the difference between the predicted solution and the expected solution of the PDE generated by the second neural network on the updated grid. The difference between the predicted solution and the expected solution of the PDE on the updated grid includes the difference between the predicted solution and the expected solution of the PDE in each grid cell of the updated grid.
[0141] The training device can generate the value of the third loss function term based on the difference between the predicted solution and the expected solution in each grid cell of the PDE in the updated grid. Specifically, the training device can determine the value of the third loss function term by the sum of the differences between the predicted solution and the expected solution in multiple grid cells of the PDE, or by the maximum value among the differences between the predicted solution and the expected solution in multiple grid cells of the PDE, or by the mean of the sum of the differences between the predicted solution and the expected solution in multiple grid cells of the PDE in the updated grid, and so on. The methods for determining the value of the third loss function term are not exhaustively listed here.
[0142] The second neural network is a trained neural network used to mimic the function of the PDE solver. For example, the second neural network can be a fully connected neural network (MLP), a convolutional neural network (CNN), a neural operator, or other types of neural networks.
[0143] In this embodiment, two methods for generating the value of the third loss function term are provided, which helps to improve the implementation flexibility of this embodiment. In addition, by using the trained second neural network to simulate the function of the PDE solver, the efficiency of the PDE solving process is improved, which in turn helps to improve the efficiency of the training process of the first neural network.
[0144] 308. The training device generates the value of a fourth loss function term based on the similarity between N predicted grid points and N expected grid points. The fourth loss function term indicates the similarity between the N predicted grid points and the N expected grid points, which are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, moving mesh method based on elasticity model, and moving mesh partial differential equation method.
[0145] In some embodiments of this application, if the target loss function includes a fourth loss function term, each set of training data may also include the position information of N expected grid points corresponding to the PDE. The N expected grid points are obtained by decomposing the solution space of the PDE based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion-based r-adaptation method, moving mesh partial differential equation method (moving mesh PDE) or other traditional mesh generation methods, etc., which are not exhaustively listed here.
[0146] After acquiring N predicted grid points, the training device can generate the value of a fourth loss function term based on the similarity between the N predicted grid points and the N expected grid points. The fourth loss function term indicates the similarity between the N predicted grid points and the N expected grid points. The training objective corresponding to the fourth loss function term includes improving the similarity between the N predicted grid points and the N expected grid points.
[0147] 309. The training device generates the value of the target loss function and trains the first neural network based on the value of the target loss function.
[0148] In this embodiment, after generating the value of the target loss function, the training device performs gradient differentiation on the value of the target loss function and updates the weight parameters in the first neural network through backpropagation, thereby completing one training iteration of the first neural network. The training device can repeat the above operation to iteratively train the first neural network until the convergence condition is met, thus obtaining the trained first neural network.
[0149] The convergence condition can be either a convergence condition that satisfies the target loss function, or a convergence condition that the number of iterations of training reaches a preset number.
[0150] Regarding the process of obtaining the value of the target loss function, steps 303 to 308 are optional, and steps 305 and 306 are mutually exclusive with step 307. If steps 305 and 306 are executed, step 307 does not need to be executed; if step 307 is executed, steps 305 and 306 do not need to be executed. In one implementation, if steps 303 and 304 are executed, and steps 305 to 308 are not executed, the target loss function may include a first loss function term and a second loss function term. The training device can obtain the value of the target loss function by weighted summing of the values of the first loss function term and the second loss function term.
[0151] In another implementation, if steps 305 and 306 are executed, but steps 303, 304, 307 and 308 are not executed; or if step 307 is executed, but steps 303, 304, 305, 306 and 308 are not executed, then the target loss function may include a third loss function term, and the training device may determine the value of the third loss function term as the value of the target loss function.
[0152] In another implementation, if steps 303 to 307 are not performed, and step 308 is performed, the target loss function may include a fourth loss function term, and the training device may determine the value of the fourth loss function term as the value of the target loss function.
[0153] In another implementation, if steps 303 to 306 are executed, but steps 307 and 308 are not executed; or if steps 303, 304, and 307 are executed, but steps 305, 306, and 308 are not executed, then the target loss function may include a first loss function term, a second loss function term, and a third loss function term. The training device can obtain the value of the target loss function by weighted summing of the values of the first loss function term, the second loss function term, and the third loss function term.
[0154] In another implementation, if steps 303, 304, and 308 are executed, but steps 305 to 307 are not executed, the target loss function may include a first loss function term, a second loss function term, and a fourth loss function term. The training device can obtain the value of the target loss function by weighted summing of the values of the first loss function term, the second loss function term, and the fourth loss function term.
[0155] In another implementation, if steps 305, 306, and 308 are executed, but steps 303, 304, and 307 are not executed; or if steps 307 and 308 are executed, but steps 303 to 306 are not executed, then the target loss function may include a third loss function term and a fourth loss function term. The training device can obtain the value of the target loss function by weighted summing of the values of the third loss function term and the fourth loss function term.
[0156] In another implementation, if steps 303 to 306 and 308 are executed, but step 307 is not executed; or if steps 303, 304, 307 and 308 are executed, but steps 305 and 306 are not executed, then the target loss function may include a first loss function term, a second loss function term, a third loss function term and a fourth loss function term. Then the training device can obtain the value of the target loss function by weighted summing of the values of the first loss function term, the second loss function term, the third loss function term and the fourth loss function term.
[0157] In this embodiment, the first loss function term and the second loss function term can guide the updated mesh to fit the target area as closely as possible while maintaining overall uniformity. Then, the technician can combine technical experience to determine the area in the solution space of PDE where the PDE value changes drastically (that is, determine the target area in the solution space of PDE). Since this method does not require solving PDE, it can greatly shorten the training time of the first neural network and reduce the training cost of the first neural network.
[0158] After obtaining the updated grid, the similarity between the predicted solution and the expected solution of the PDE on the updated grid is also obtained. The first neural network is trained using the third loss function term, which can improve the tightness between the grid partitioning process and the PDE solving process. In other words, it is beneficial to make the partitioned grid more compatible with the PDE solving stage, thereby helping the trained first neural network to obtain a better updated grid.
[0159] In other words, the first neural network learns the ability to mesh the solution space of the PDE in the traditional method. However, compared with the aforementioned traditional method, the method of using the first neural network to optimize the initial mesh no longer requires repeated solving of the PDE, which is beneficial to improving the efficiency of the mesh generation process and reducing the computer resources consumed in the mesh generation process.
[0160] This application also provides a data processing method in its embodiments. Please refer to [link / reference]. Figure 8 , Figure 8 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The data processing method provided in an embodiment of this application may include:
[0161] 801. The execution device acquires first information, which includes the constraints of the parameters in the PDE to be solved and the initial mesh corresponding to the PDE. The PDE is obtained based on the object to be simulated, and the shape of the initial mesh is determined based on the object to be simulated. The initial mesh includes N first mesh points, where N is a positive integer.
[0162] 802. The execution device inputs the first information into the first neural network to update the initial grid through the first neural network, and obtains N second grid points output by the first neural network. The N second grid points belong to the updated grid, and the updated grid is used to solve the PDE. The mapping relationship between the N second grid points and the N first grid points is reversible.
[0163] In this embodiment of the application, the specific implementation of steps 801 and 802 can be found in [reference needed]. Figure 3 Corresponding to the descriptions in steps 301 and 302 of the embodiment, the first neural network is through Figure 3 The meanings of the terms in steps 801 and 802 obtained from the neural network training method provided in the corresponding embodiment can be found in [reference needed]. Figure 3 The descriptions in the corresponding embodiments will not be repeated here.
[0164] Furthermore, in step 801, if the execution device and the user device that have deployed the trained first neural network are the same device, the execution device can receive the first information input by the user; if the execution device and the user device that have deployed the trained first neural network are different devices, the execution device can receive the first information sent by the user device.
[0165] 803. The execution device or user device inputs the updated mesh and PDE into the PDE solver to obtain the solution of the PDE generated by the PDE solver in the updated mesh.
[0166] In this embodiment of the application, if the execution device and the user device that deploy the trained first neural network are the same device, the execution device can directly input the updated mesh and PDE into the PDE solver to obtain the solution of the PDE generated by the PDE solver in the updated mesh.
[0167] If the execution device and the user device deploying the trained first neural network are different devices, the execution device can input the updated mesh and PDE into the PDE solver, obtain the solution of the PDE generated by the PDE solver in the updated mesh, and then send the solution of the PDE in the updated mesh to the user device. Alternatively, the execution device can also send the updated mesh corresponding to the PDE to the user device, and the user device can input the updated mesh and PDE into the PDE solver to obtain the solution of the PDE generated by the PDE solver in the updated mesh.
[0168] For a more intuitive understanding of this solution, please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic flowchart of a data processing method provided in an embodiment of this application. Figure 9 Taking the mesh optimization and PDE (Problem Analyzer) located on the same device, with the PDE used for thermal simulation, as an example... Figure 9 The constraints of the PDE parameters, the initial mesh, the updated mesh, and the PDE solution in the updated mesh are all visualized. As shown in the figure, the constraints of the PDE parameters and the corresponding initial mesh are input into the trained first neural network to obtain the updated mesh; the updated mesh and the PDE are then input into the PDE solver to obtain the solution of the PDE generated by the PDE solver in the updated mesh. It should be understood that... Figure 9 The examples provided are for illustrative purposes only and are not intended to limit the scope of this solution.
[0169] In this implementation, the initial mesh to be optimized and the constraints of the parameters in the PDE to be solved are input into the first neural network. The initial mesh is directly updated through the first neural network, resulting in N second mesh points output by the first neural network, which is the updated mesh. This eliminates the need for repeated PDE solving, reducing time consumption and lowering computer resource consumption. Furthermore, since the mapping relationship between the N second mesh points and the N first mesh points is reversible, meaning that any two different first mesh points cannot be updated to the same second mesh point, and the N first mesh points can be any N points within the boundary of the initial mesh, the first neural network needs to ensure that any two points at different positions within the boundary of the initial mesh will not be updated to the same position. This greatly ensures that the updated mesh will not be flipped, and that the solution space corresponding to the PDE can be divided into multiple meshes without overlap or omission. Since "dividing the solution space of the PDE into multiple meshes without overlap or omission" is the basic principle of PDE numerical solution, this approach minimizes the possibility of obtaining meaningless numerical solutions.
[0170] To provide a more intuitive understanding of the beneficial effects of the embodiments of this application, experimental data is used to illustrate these effects. First, taking the Poisson equation as an example for PDE, the trained first neural network, when processing data in the test set, generated an updated mesh without mesh flipping. Compared to a uniform mesh, using the updated mesh generated by the first neural network for PDE solving reduces the average PDE solution error by 20.82 ± 0.35%; in contrast, using the updated mesh obtained by the traditional Monge-Ampère method reduces the average PDE solution error by 23.11%. Furthermore, the average time for mesh updating using the Monge-Ampère method is 5220.99 ms, while the average time for mesh updating using the first neural network in this embodiment is 5.55 ± 0.01 ms. Therefore, using the first neural network in this embodiment for mesh updating can achieve a PDE solution gain close to that of the traditional Monge-Ampère method, while taking only one-thousandth the time.
[0171] Experiments were then conducted using PDE with the Burgers equation. When the trained first neural network processed the data in the test set, the updated mesh generated did not exhibit mesh flipping. Compared to a uniform mesh, using the updated mesh generated by the first neural network for PDE solving reduced the average PDE error by 48.92 ± 1.33%; in contrast, using the updated mesh obtained by the traditional Monge-Ampère method reduced the average PDE error by 60.24%. Furthermore, the average time for mesh updating using the Monge-Ampère method was 81590.64 ms, while the average time for mesh updating using the first neural network in this embodiment was 5.54 ± 0.02 ms. Therefore, using the first neural network in this embodiment for mesh updating can achieve PDE solution gains close to those of the traditional Monge-Ampère method, while taking only one-thousandth the time. For an example, please refer to... Figure 10 , Figure 10 This is a comparative schematic diagram illustrating mesh updates using a first neural network and the Monge-Ampère method, provided as an embodiment of this application. Figure 10 The two sub-schematic diagrams on the left both represent schematic diagrams of the updated mesh obtained using the Monge-Ampère method. Figure 10 The two sub-schematic diagrams on the right represent schematic diagrams of an updated mesh obtained using the first neural network provided in the embodiments of this application. As shown in the figure, the updated mesh obtained using the first neural network in the embodiments of this application and the traditional Monge-Ampère method is approximate.
[0172] In Figure 1 to Figure 10 Based on the corresponding embodiments, in order to better implement the above-described solutions of the embodiments of this application, related equipment for implementing the above solutions is also provided below. See details. Figure 11 , Figure 11 This is a schematic diagram of a data processing device provided in an embodiment of this application. The data processing device 1100 includes: an acquisition module 1101, used to acquire first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE is obtained based on the object to be simulated, the shape of the initial grid is determined based on the object to be simulated, and the initial grid includes N first grid points, where N is a positive integer; and an update module 1102, used to input the first information into a first neural network to update the initial grid through the first neural network, thereby obtaining N second grid points output by the first neural network, the N second grid points belonging to the updated grid, the updated grid being used to solve the PDE, and the mapping relationship between the N second grid points and the N first grid points being invertible.
[0173] In one possible design, the update module 1102 is specifically used to: input the constraint conditions of the parameters in the PDE to be solved into the first sub-neural network, so as to perform feature extraction operation through the first sub-neural network to obtain the feature information of the constraint conditions; based on the feature information of the constraint conditions and the initial grid corresponding to the PDE, update the initial grid through the second sub-neural network to obtain N second grid points, wherein the first sub-neural network and the second sub-neural network are included in the first neural network.
[0174] In one possible design, the second sub-neural network is derived from a spline neural network.
[0175] In one possible design, the first neural network is trained based on a loss function, which includes a first loss function term and a second loss function term. The first loss function term indicates the distance between the second grid points and the target region. The closer the N second grid points are to the target region, the smaller the value of the first loss function term. The second loss function term indicates the uniformity of the distribution of the N second grid points. The more uniform the distribution of the N second grid points, the smaller the value of the second loss function term.
[0176] In one possible design, the first neural network is trained based on a loss function, which includes a third loss function term. The updated grid is used to obtain the predicted solution of the PDE on the updated grid. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
[0177] In one possible design, the first neural network is trained based on a loss function, which includes a fourth loss function term indicating the similarity between N second grid points and N desired grid points. The N desired grid points are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion-based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE).
[0178] In one possible design, the PDE is used to characterize any of the following: the thermal field generated by the heat-generating elements on the chip, the deformation generated when the product is under pressure, or the deformation generated when the product assembly is under pressure.
[0179] It should be noted that the information interaction and execution process between the modules / units in the data processing device 1100 are different from those in this application. Figure 8 or Figure 9 The various method embodiments are based on the same concept, and the details can be found in the descriptions of the method embodiments shown above in this application, which will not be repeated here.
[0180] Please see Figure 12 , Figure 12 This is a schematic diagram of a neural network training device provided in an embodiment of this application. The neural network training device 1200 includes: an acquisition module 1201, used to acquire first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE corresponds to the simulated object, the shape of the initial grid is determined based on the simulated object, and the initial grid includes N first grid points, where N is a positive integer; an update module 1202, used to input the first information into a first neural network to update the initial grid through the first neural network, thereby obtaining N predicted grid points output by the first neural network, the N predicted grid points belonging to the updated grid, the updated grid being used to solve the PDE, and the mapping relationship between the N predicted grid points and the N first grid points being invertible; and a training module 1203, used to train the first neural network using a loss function to obtain the trained neural network, wherein the value of the loss function is obtained based on the N predicted grid points.
[0181] In one possible design, the loss function includes a first loss function term and a second loss function term. The training module 1203 is specifically used for: generating the value of the first loss function term based on the distance between N predicted grid points and the target region, wherein the first loss function term indicates the distance between the N predicted grid points and the target region, and the closer the N predicted grid points are to the target region, the smaller the value of the first loss function term; generating the value of the second loss function term based on the N predicted grid points, wherein the second loss function term indicates the uniformity of the distribution of the N predicted grid points, and the more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term; generating the value of the loss function based on the values of the first loss function term and the second loss function term, and training the first neural network based on the value of the loss function.
[0182] In one possible design, the loss function includes a third loss function term. The training module 1203 is specifically used to generate the value of the loss function based on the value of the third loss function term and to train the first neural network based on the value of the loss function. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
[0183] In one possible design, the training device 1200 of the neural network further includes: a solution module for solving the PDE using a PDE solver based on the updated grid to obtain a predicted solution of the PDE on the updated grid, the predicted solution of the PDE on the updated grid being used to generate the value of a third loss function term; or, an input module for inputting the updated grid and the PDE into a second neural network to obtain the difference between the predicted solution of the PDE generated by the second neural network on the updated grid and the expected solution.
[0184] In one possible design, the loss function includes a fourth loss function term. The training module 1203 is specifically used to: generate the value of the fourth loss function term based on the similarity between N predicted grid points and N expected grid points, wherein the fourth loss function term indicates the similarity between N second grid points and N expected grid points, and the N expected grid points are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE); generate the value of the loss function based on the value of the fourth loss function term, and train the first neural network based on the value of the loss function.
[0185] It should be noted that the information interaction and execution process between the modules / units in the neural network training device 1200 are different from those in this application. Figures 3 to 7 The various method embodiments are based on the same concept, and the details can be found in the descriptions of the method embodiments shown above in this application, which will not be repeated here.
[0186] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 13 , Figure 13 This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 1300 may be equipped with... Figure 11 The corresponding data processing apparatus 1100 described in the embodiment. Specifically, the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the execution device 1300 may have one or more processors 1303). Figure 13 (Taking a processor as an example), processor 1303 may include application processor 13031 and communication processor 13032. In some embodiments of this application, receiver 1301, transmitter 1302, processor 1303 and memory 1304 may be connected via bus or other means.
[0187] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0188] Processor 1303 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.
[0189] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1303. The processor 1303 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1303 or by instructions in software form. The processor 1303 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1303 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1304. Processor 1303 reads the information in memory 1304 and, in conjunction with its hardware, completes the steps of the above method.
[0190] Receiver 1301 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1302 can be used to output digital or character information through the first interface; transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1302 may also include a display device such as a display screen.
[0191] In this embodiment of the application, the application processor 13031 in the processor 1303 is used to execute... Figure 8 or Figure 9 The data processing method executed by the execution device in the corresponding embodiment. Specifically, the application processor 13031 is used to perform the following steps:
[0192] Obtain first information, which includes the constraint conditions of the parameters in the partial differential equation PDE to be solved and the initial mesh corresponding to the PDE. The PDE is obtained based on the object to be simulated, and the shape of the initial mesh is determined based on the object to be simulated. The initial mesh includes N first mesh points, where N is a positive integer.
[0193] The first information is input into the first neural network to update the initial grid, resulting in N second grid points output by the first neural network. These N second grid points belong to the updated grid, which is used to solve the PDE. The mapping relationship between the N second grid points and the N first grid points is invertible.
[0194] It should be noted that the specific manner in which the application processor 13031 executes the above steps is different from that in this application. Figure 8 or Figure 9 The various method embodiments are based on the same concept, and the technical effects they bring are the same as those in this application. Figure 8 or Figure 9 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0195] This application also provides a training device; please refer to [link / reference]. Figure 14 , Figure 14 This is a schematic diagram of a training device provided in an embodiment of this application. The training device 1400 can be equipped with... Figure 12Corresponding to the neural network training apparatus 1200 described in the embodiments, specifically, the training device 1400 is implemented by one or more servers. The training device 1400 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1422 (e.g., one or more processors) and memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for storing application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figures), each module may include a series of instruction operations on the training device. Furthermore, the CPU 1422 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the training device 1400.
[0196] The training device 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0197] In this embodiment of the application, the central processing unit 1422 is used to execute... Figure 12 The training method for the neural network executed by the training device in the corresponding embodiment. Specifically, the central processing unit 1422 is used to execute the following steps:
[0198] Obtain first information, which includes the constraint conditions of the parameters in the partial differential equation PDE to be solved and the initial mesh corresponding to the PDE. The PDE corresponds to the simulated object, the shape of the initial mesh is determined based on the simulated object, and the initial mesh includes N first mesh points, where N is a positive integer.
[0199] The first information is input into the first neural network to update the initial grid, resulting in N predicted grid points output by the first neural network. The N predicted grid points belong to the updated grid, which is used to solve the PDE. The mapping relationship between the N predicted grid points and the N first grid points is invertible.
[0200] The first neural network is trained using a loss function to obtain the trained neural network. The value of the loss function is obtained based on N prediction grid points.
[0201] It should be noted that the specific manner in which the central processing unit 1422 executes the above steps is different from that in this application. Figures 3 to 8 The various method embodiments are based on the same concept, and the technical effects they bring are the same as those in this application. Figures 3 to 8 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0202] This application also provides a computer program product, which includes a program that, when run on a computer, causes the computer to perform the aforementioned actions. Figures 3 to 7 The steps performed by the training device in the method described in the illustrated embodiment, or causing the computer to perform the steps as described above. Figure 8 or Figure 9 The steps performed by the execution device in the method described in the illustrated embodiment.
[0203] This application embodiment also provides a computer-readable storage medium storing a program for performing signal processing, which, when run on a computer, causes the computer to perform the aforementioned actions. Figures 3 to 7 The steps performed by the training device in the method described in the illustrated embodiment, or causing the computer to perform the steps as described above. Figure 8 or Figure 9 The steps performed by the execution device in the method described in the illustrated embodiment.
[0204] The data processing device, neural network training device, execution device, or training device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuitry. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip to perform the aforementioned operations. Figures 3 to 7 The neural network training method described in the illustrated embodiment, or, to cause the chip to perform the above... Figure 8 or Figure 9 The data processing method described in the illustrated embodiment. Optionally, the storage unit is a storage unit within the chip, such as a register, cache, etc. The storage unit can also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.
[0205] For details, please refer to Figure 15 , Figure 15This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 150. The NPU 150 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 150, which is controlled by the controller 1504 to extract matrix data from the memory and perform multiplication operations.
[0206] In some implementations, the arithmetic circuit 1503 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1503 is a two-dimensional pulsating array. The arithmetic circuit 1503 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1503 is a general-purpose matrix processor.
[0207] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is stored in the accumulator 1508.
[0208] Unified memory 1506 is used to store input and output data. Weight data is directly transferred to weight memory 1502 via Direct Memory Access Controller (DMAC) 1505. Input data is also transferred to unified memory 1506 via DMAC.
[0209] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1509.
[0210] The Bus Interface Unit (BIU) 1510 is used by the instruction fetch memory 1509 to fetch instructions from external memory, and also by the memory access controller 1505 to fetch the original data of the input matrix A or the weight matrix B from external memory.
[0211] The DMAC is mainly used to move input data from external memory DDR to unified memory 1506, or to weight data to weight memory 1502, or to input data to input memory 1501.
[0212] The vector computation unit 1507 includes multiple arithmetic processing units that further process the output of the computation circuit as needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.
[0213] In some implementations, the vector computation unit 1507 can store the processed output vector in the unified memory 1506. For example, the vector computation unit 1507 can apply linear and / or nonlinear functions to the output of the computation circuit 1503, such as performing linear interpolation on feature planes extracted by convolutional layers, or accumulating a vector of values to generate activation values. In some implementations, the vector computation unit 1507 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to the computation circuit 1503, for example, for use in subsequent layers of the neural network.
[0214] The instruction fetch buffer 1509 connected to the controller 1504 is used to store the instructions used by the controller 1504;
[0215] Unified memory 1506, input memory 1501, weighted memory 1502, and instruction fetch memory 1509 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.
[0216] In the above embodiments, the operations of each layer in the first neural network and the second neural network can be performed by the operation circuit 1503 or the vector calculation unit 1507.
[0217] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of a program in the first aspect of the method.
[0218] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0219] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0220] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0221] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A data processing method, characterized in that, The method includes: Obtain first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial mesh corresponding to the PDE, wherein the PDE is obtained based on the object to be simulated, the shape of the initial mesh is determined based on the object to be simulated, and the initial mesh includes N first mesh points, wherein N is a positive integer; The first information is input into a first neural network to update the initial grid, resulting in N second grid points output by the first neural network. The N second grid points belong to the updated grid, which is used to solve the PDE. The mapping relationship between the N second grid points and the N first grid points is invertible. The first neural network includes a first sub-neural network and a second sub-neural network. The first sub-neural network is used to perform feature extraction operations, and the second sub-neural network is used to obtain the N second grid points based on the feature information generated by the first sub-neural network. The second sub-neural network is a reversible neural network.
2. The method according to claim 1, characterized in that, The step of inputting the first information into a first neural network to update the initial grid through the first neural network and obtaining N second grid points output by the first neural network includes: The constraints of the parameters in the PDE to be solved are input into the first sub-neural network, so that feature extraction is performed through the first sub-neural network to obtain the feature information of the constraints. Based on the feature information of the constraints and the initial grid corresponding to the PDE, the initial grid is updated through the second sub-neural network to obtain the N second grid points, wherein the first sub-neural network and the second sub-neural network are included in the first neural network.
3. The method according to claim 2, characterized in that, The second sub-neural network is derived from a spline neural network.
4. The method according to any one of claims 1 to 3, characterized in that, The first neural network is trained based on a loss function, which includes a first loss function term and a second loss function term. The first loss function term indicates the distance between the second grid points and the target region. The closer the N second grid points are to the target region, the smaller the value of the first loss function term. The second loss function term indicates the uniformity of the distribution of the N second grid points. The more uniform the distribution of the N second grid points, the smaller the value of the second loss function term.
5. The method according to any one of claims 1 to 3, characterized in that, The first neural network is trained based on a loss function, which includes a third loss function term. The updated grid is used to obtain the predicted solution of the PDE on the updated grid. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
6. The method according to any one of claims 1 to 3, characterized in that, The first neural network is trained based on a loss function, which includes a fourth loss function term. The fourth loss function term indicates the similarity between the N second grid points and the N expected grid points. The N expected grid points are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE).
7. The method according to any one of claims 1 to 3, characterized in that, The PDE is used to characterize any of the following information: the thermal field generated by the heating element on the chip, the deformation generated when the product is under pressure, or the deformation generated when the product component is under pressure.
8. A method for training a neural network, characterized in that, The method includes: Obtain first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial mesh corresponding to the PDE, wherein the PDE corresponds to the simulated object, the shape of the initial mesh is determined based on the simulated object, and the initial mesh includes N first mesh points, wherein N is a positive integer; The first information is input into a first neural network to update the initial grid, resulting in N predicted grid points output by the first neural network. These N predicted grid points belong to the updated grid, which is used to solve the PDE. The mapping relationship between the N predicted grid points and the N first grid points is reversible. The first neural network includes a first sub-neural network and a second sub-neural network. The first sub-neural network is used to perform feature extraction operations, and the second sub-neural network is used to obtain the N predicted grid points based on the feature information generated by the first sub-neural network. The second sub-neural network is a reversible neural network. The first neural network is trained using a loss function to obtain a trained neural network, wherein the value of the loss function is obtained based on the N prediction grid points.
9. The method according to claim 8, characterized in that, The loss function includes a first loss function term and a second loss function term. Training the first neural network using the loss function includes: The value of a first loss function term is generated based on the distance between the N predicted grid points and the target area. The first loss function term indicates the distance between the N predicted grid points and the target area. The closer the N predicted grid points are to the target area, the smaller the value of the first loss function term. Based on the N predicted grid points, a value for a second loss function term is generated. The second loss function term indicates the uniformity of the distribution of the N predicted grid points. The more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term. The value of the loss function is generated based on the value of the first loss function term and the value of the second loss function term, and the first neural network is trained based on the value of the loss function.
10. The method according to claim 8 or 9, characterized in that, The loss function includes a third loss function term, and training the first neural network using the loss function includes: The value of the loss function is generated based on the value of the third loss function term, and the first neural network is trained based on the value of the loss function term, wherein the third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
11. The method according to claim 10, characterized in that, Before generating the value of the loss function based on the value of the third loss function term, the method further includes: Based on the updated grid, the PDE is solved using the PDE solver to obtain the predicted solution of the PDE on the updated grid. This predicted solution is used to generate the value of the third loss function term; or... The updated grid and the PDE are input into the second neural network to obtain the difference between the predicted solution and the expected solution of the PDE generated by the second neural network on the updated grid.
12. The method according to claim 8 or 9, characterized in that, The loss function includes a fourth loss function term, and training the first neural network using the loss function includes: The value of a fourth loss function term is generated based on the similarity between the N predicted grid points and the N expected grid points. The fourth loss function term indicates the similarity between the N predicted grid points and the N expected grid points, which are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion-based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE). The value of the loss function is generated based on the value of the fourth loss function term, and the first neural network is trained based on the value of the loss function.
13. A data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial mesh corresponding to the PDE, wherein the PDE is obtained based on the object to be simulated, the shape of the initial mesh is determined based on the object to be simulated, and the initial mesh includes N first mesh points, wherein N is a positive integer; An update module is used to input the first information into a first neural network to update the initial grid through the first neural network, thereby obtaining N second grid points output by the first neural network. The N second grid points belong to the updated grid, and the updated grid is used to solve the PDE. The mapping relationship between the N second grid points and the N first grid points is invertible. The first neural network includes a first sub-neural network and a second sub-neural network. The first sub-neural network is used to perform feature extraction operations, and the second sub-neural network is used to obtain the N second grid points based on the feature information generated by the first sub-neural network. The second sub-neural network is a reversible neural network.
14. The apparatus according to claim 13, characterized in that, The update module is specifically used for: The constraints of the parameters in the PDE to be solved are input into the first sub-neural network, so that feature extraction is performed through the first sub-neural network to obtain the feature information of the constraints. Based on the feature information of the constraints and the initial grid corresponding to the PDE, the initial grid is updated through the second sub-neural network to obtain the N second grid points, wherein the first sub-neural network and the second sub-neural network are included in the first neural network.
15. The apparatus according to claim 14, characterized in that, The second sub-neural network is derived from a spline neural network.
16. The apparatus according to any one of claims 13 to 15, characterized in that, The first neural network is trained based on a loss function, which includes a first loss function term and a second loss function term. The first loss function term indicates the distance between the second grid points and the target region. The closer the N second grid points are to the target region, the smaller the value of the first loss function term. The second loss function term indicates the uniformity of the distribution of the N second grid points. The more uniform the distribution of the N second grid points, the smaller the value of the second loss function term.
17. The apparatus according to any one of claims 13 to 15, characterized in that, The first neural network is trained based on a loss function, which includes a third loss function term. The updated grid is used to obtain the predicted solution of the PDE on the updated grid. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
18. The apparatus according to any one of claims 13 to 15, characterized in that, The first neural network is trained based on a loss function, which includes a fourth loss function term. The fourth loss function term indicates the similarity between the N second grid points and the N expected grid points. The N expected grid points are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE).
19. The apparatus according to any one of claims 13 to 15, characterized in that, The PDE is used to characterize any of the following information: the thermal field generated by the heating element on the chip, the deformation generated when the product is under pressure, or the deformation generated when the product component is under pressure.
20. A training device for a neural network, characterized in that, The device includes: The acquisition module is used to acquire first information, wherein the first information includes the constraint conditions of the parameters in the partial differential equation (PDE) to be solved and the initial grid corresponding to the PDE, the PDE corresponds to the simulated object, the shape of the initial grid is determined based on the simulated object, and the initial grid includes N first grid points, where N is a positive integer; An update module is used to input the first information into a first neural network to update the initial grid through the first neural network, thereby obtaining N predicted grid points output by the first neural network. The N predicted grid points belong to the updated grid, and the updated grid is used to solve the PDE. The mapping relationship between the N predicted grid points and the N first grid points is reversible. The first neural network includes a first sub-neural network and a second sub-neural network. The first sub-neural network is used to perform feature extraction operations, and the second sub-neural network is used to obtain the N predicted grid points based on the feature information generated by the first sub-neural network. The second sub-neural network is a reversible neural network. The training module is used to train the first neural network using a loss function to obtain the trained neural network, wherein the value of the loss function is obtained based on the N prediction grid points.
21. The apparatus according to claim 20, characterized in that, The loss function includes a first loss function term and a second loss function term. The training module is specifically used for: The value of a first loss function term is generated based on the distance between the N predicted grid points and the target area. The first loss function term indicates the distance between the N predicted grid points and the target area. The closer the N predicted grid points are to the target area, the smaller the value of the first loss function term. Based on the N predicted grid points, a value for a second loss function term is generated. The second loss function term indicates the uniformity of the distribution of the N predicted grid points. The more uniform the distribution of the N predicted grid points, the smaller the value of the second loss function term. The value of the loss function is generated based on the value of the first loss function term and the value of the second loss function term, and the first neural network is trained based on the value of the loss function.
22. The apparatus according to claim 20 or 21, characterized in that, The loss function includes a third loss function term. The training module is specifically used to generate the value of the loss function based on the value of the third loss function term, and to train the first neural network based on the value of the loss function. The third loss function term indicates the similarity between the predicted solution and the expected solution of the PDE on the updated grid.
23. The apparatus according to claim 22, characterized in that, The device further includes: The solution module is used to solve the PDE using a PDE solver based on the updated mesh, to obtain the predicted solution of the PDE on the updated mesh. The predicted solution of the PDE on the updated mesh is used to generate the value of the third loss function term; or... An input module is used to input the updated grid and the PDE into a second neural network to obtain the difference between the predicted solution and the expected solution of the PDE generated by the second neural network on the updated grid.
24. The apparatus according to claim 20 or 21, characterized in that, The loss function includes a fourth loss function term, and the training module is specifically used for: The value of a fourth loss function term is generated based on the similarity between the N predicted grid points and the N expected grid points. The fourth loss function term indicates the similarity between the N predicted grid points and the N expected grid points, which are obtained based on any of the following methods: Monge-Ampere method, moving mesh finite element method, attraction and repulsion-based r-adaptation method, and moving mesh partial differential equation method (moving mesh PDE). The value of the loss function is generated based on the value of the fourth loss function term, and the first neural network is trained based on the value of the loss function.
25. A computer program product, characterized in that, The computer program product includes a program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 7, or causes the computer to perform the method as described in any one of claims 8 to 12.
26. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 7, or causes the computer to perform the method as described in any one of claims 8 to 12.
27. An execution device, characterized in that, It includes a processor and a memory, wherein the processor is coupled to the memory. The memory is used to store programs; The processor is configured to execute a program in the memory, causing the execution device to perform the method as described in any one of claims 1 to 7.
28. A training device, characterized in that, It includes a processor and a memory, wherein the processor is coupled to the memory. The memory is used to store programs; The processor is configured to execute a program in the memory, causing the training device to perform the method as described in any one of claims 8 to 12.
Citation Information
Patent Citations
Grid adaptive method for high-precision flow field analysis
CN113221475A