Symbol regression method and device based on minimum description length, equipment and medium
By combining the minimum description length (MDL) with the symbolic regression method of Monte Carlo tree search, a search tree is created and nodes are updated, which solves the problem of the inability to efficiently and accurately fit the target formula in the existing technology and achieves accurate fitting of the target system parameter relationship.
Patent Information
- Application Number
- CN202510524785.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-09-05
AI Technical Summary
Existing symbolic regression methods find it difficult to efficiently and accurately find the target formula with the correct mathematical form for fitting given data, especially when the symbolic space is highly nonlinear, which makes it impossible to understand the underlying mechanism of the model and discover new scientific knowledge.
A symbolic regression method combining minimum description length (MDL) and Monte Carlo tree search is adopted. By creating a search tree and updating nodes according to the minimum description length, the similarity of candidate formulas is determined and the target formula is finally obtained.
It achieves accurate fitting of the relationship between parameters based on the real data of multiple parameters in the target system, solves the problem of being unable to obtain the correct target formula in the existing technology, and improves the accuracy and efficiency of the search process.
Smart Images

Figure CN120596522A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a symbolic regression method, apparatus, device, and medium based on minimum description length. Background Art
[0002] Symbolic regression uses computers to automatically find the optimal mathematical formula to model given data. It is widely used in fields such as dynamics, materials science, and physical chemistry to assist experts in modeling scientific phenomena and accelerate scientific discovery. Unlike traditional methods, where experts manually construct mathematical formulas based on domain knowledge to explain experimental results, symbolic regression searches for the optimal combination of mathematical symbols, such as arithmetic operations, trigonometric functions, exponential logarithms, numerical constants, and independent variables, to find the best formula that describes a given experimental result with the shortest formula length and the highest goodness of fit. This allows symbolic regression to discover mathematical models in fields lacking prior knowledge of the underlying mechanisms, and observing the specific mathematical form of the discovered models can facilitate the discovery of new scientific knowledge.
[0003] Current symbolic regression methods are primarily based on search algorithms, using heuristic search to find the optimal mathematical formula with the best goodness of fit. Commonly used traditional methods include genetic algorithms (GPAs), Monte Carlo tree search (MTS), and deep reinforcement learning (DL). These methods maintain a set of candidate formulas, using their goodness of fit on the given data as their value. Formulas with similar forms to high-value formulas are then identified and added to the candidate set, thereby continuously improving the goodness of fit of the candidate set, ultimately obtaining the target formula with the best goodness of fit. However, due to the highly nonlinear nature of the symbolic space in which mathematical formulas reside, formulas with similar mathematical forms can have completely different function shapes, and formulas with similar function shapes can have completely different mathematical forms. As a result, these methods often fail to discover the target formula with the correct mathematical form, even when directly generated from known mathematical formulas. Instead, they can only discover formulas with high accuracy, and the mathematical form of the discovered formulas differs significantly from the target formula. This hinders the practice of understanding the underlying model mechanisms through formula form and thus discovering new scientific knowledge. While methods such as AI Feynman and DGSR-MCTS utilize pre-trained neural networks to assist in the search process, these methods also optimize for goodness of fit and therefore face the challenge of finding the target formula. In addition to guided search, generative methods such as NeuralSR, E2ESR, and SNIP treat the target formula as a mathematical language. Using pre-trained language models, they generate a symbolic sequence representing the target formula directly from observed data. While this approach is significantly faster than search algorithms, the accuracy of finding the target formula is relatively poor. Regression-based methods such as FFX design multi-layer, fully connected neural networks with mathematical functions such as multiplication, division, trigonometric functions, and exponential logarithms as activation layers. These methods obtain the hidden functional form of the data by fitting network weights to the given data. However, due to the use of functions such as exponentials and logarithms as activation layers, these methods often face numerical instability. Therefore, heuristic search-based algorithms remain the dominant approach for symbolic regression. However, finding a suitable target for the search algorithm, so that the search process optimizing this target can efficiently and accurately find the target formula with the correct mathematical form, remains an urgent challenge. Summary of the Invention
[0004] This application provides a symbolic regression method, apparatus, device, and medium based on minimum description length to address the existing art's inability to efficiently and accurately find a target formula with the correct mathematical form for fitting given data. By applying minimum description length (MDL) to a symbolic regression method based on Monte Carlo tree search, this application can obtain an optimal target formula that accurately fits the relationship between multiple parameters based on real data generated by multiple parameters in a target system.
[0005] This application provides a symbolic regression method based on minimum description length, comprising the following steps: Determine a target system for symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; A search tree is created by a symbolic regression method based on Monte Carlo tree search, and when a node in the search tree is expanded, a minimum description length of a candidate formula corresponding to the node is determined based on the first real data, the second real data, and a pre-trained prediction model, and the search tree is updated based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula is constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data, and the value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula; After completing the creation of the search tree, the target candidate formula with the shortest description length in the search tree is obtained, and the target formula is determined based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0006] According to a symbolic regression method based on minimum description length provided by the present application, determining a target formula based on the target candidate formula includes: The target candidate formula is adjusted using the first real data and the second real data through a linear regression method to obtain the target formula.
[0007] According to a symbolic regression method based on minimum description length provided in this application, the prediction model is obtained by training through the following steps: Get multiple random sample symbol formulas; Acquire multiple groups of different sample observation data according to the multiple sample symbolic formulas, wherein one group of the sample observation data corresponds to one sample symbolic formula, and each row in each group of the sample observation data includes a value corresponding to at least one independent variable and a value corresponding to a dependent variable; According to the plurality of sample symbol formulas and the plurality of groups of sample observation data, a preset neural network model is trained to obtain the prediction model.
[0008] According to a symbolic regression method based on minimum description length provided by the present application, the preset neural network model includes a first network module and a second network module, the first network module includes at least a first attention pooling module and a read head module, and the second network module includes at least a second attention pooling module; the preset neural network model is trained according to multiple sample symbolic formulas and multiple groups of sample observation data to obtain the prediction model, including: Inputting the plurality of groups of sample observation data into the first network module, and processing the sample observation data through the first attention pooling module to obtain a first embedding vector; Inputting a plurality of the sample symbolic formulas into the second network module, and processing the sample symbolic formulas through the second attention pooling module to obtain a second embedding vector; Inputting the first embedding vector and the second embedding vector into a first objective loss function to obtain a first loss value; If the first loss value satisfies a first preset condition, processing the first embedding vector by the read head module to obtain a predicted value of the minimum description length; Determining the length values of prefix expressions of a plurality of the sample symbolic formulas; Inputting the predicted value and the length value into a second objective loss function to obtain a second loss value; If the second loss value satisfies a second preset condition, it is determined that the training is completed, and the first network module when the training is completed is the prediction model; The first objective loss function is: The second objective loss function is: in, Indicates the number of groups of sample observation data or the number of sample symbolic formulas, represents the first embedding vector, represents the second embedding vector, represents the predicted value of the minimum description length, The length value of the prefix expression representing the sample symbolic formula.
[0009] According to a symbolic regression method based on minimum description length provided by the present application, the first network module further includes an embedding module and an encoding module, wherein the plurality of groups of sample observation data are input into the first network module, and the sample observation data are processed by the first attention pooling module to obtain a first embedding vector, including: Performing characterization processing on the sample observation data to obtain sample observation data in a characterized sequence format; Processing the dimension of the sample observation data in the characterized sequence format by the embedding module to obtain a first vector; Encoding the first vector by the encoding module to obtain a second vector; Input the second vector into the first attention pooling module, obtain the weight corresponding to each row element in the second vector through the first attention pooling module, and perform weighted summation on each row element in the second vector according to the weight corresponding to each row element in the second vector to obtain the first embedding vector; The weights corresponding to the elements in each row of the second vector are calculated using the following formula: in, Indicates the first row elements, Indicates the first The weight corresponding to the row elements, represents the pre-trained attention vector.
[0010] According to a symbolic regression method based on minimum description length provided by the present application, the method of obtaining multiple random sample symbolic formulas includes: Randomly determine a target value within a preset value range as the dimension of the independent variable in the sample symbol formula; randomly selecting at least one binary operator from all binary operators, and obtaining a first expression according to the at least one binary operator and the independent variable, wherein the number of the at least one binary operator is not greater than the target value; Randomly select at least one unary operator from all unary operators, and insert the at least one unary operator into the first expression to obtain a second expression; randomly inserting a numerical constant into the second expression by multiplication or addition to obtain a sample symbolic formula; Repeat the above steps to obtain multiple sample symbol formulas.
[0011] According to a symbolic regression method based on minimum description length provided by the present application, the multiple sample symbolic formulas include a target sample symbolic formula, and the target sample symbolic formula is any one of the multiple sample symbolic formulas. Acquiring multiple groups of different sample observation data according to the multiple sample symbolic formulas includes: According to the dimension of the independent variable corresponding to the target sample symbol formula, a plurality of groups of sample points are obtained by sampling using a Gaussian mixture distribution with a preset number of cluster centers, where a group of the sample points represents a set of values of the independent variable; For each group of sample points, substitute the sample points into the independent variables in the target sample symbol formula to obtain the value of the dependent variable in the target sample symbol formula; A set of sample observation data corresponding to the target sample symbol formula is obtained according to the multiple groups of sample points and the values of the dependent variable.
[0012] This application also provides a symbolic regression device based on minimum description length, including the following modules: a first determination module, configured to determine a target system to be subjected to symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; a creation module, configured to create a search tree using a symbolic regression method based on Monte Carlo tree search, and when expanding a node in the search tree, determine a minimum description length of a candidate formula corresponding to the node based on the first real data, the second real data, and a pre-trained prediction model, and update the search tree based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula being constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length representing a distance between a value of the dependent variable in the candidate formula and the second real data, the value of the dependent variable being obtained by substituting the first real data into the corresponding independent variable in the candidate formula; The second determination module is used to obtain the target candidate formula with the shortest description length in the search tree after completing the creation of the search tree, and determine the target formula based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0013] The present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a symbolic regression method based on minimum description length as described above is implemented.
[0014] The present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements any of the above-described symbolic regression methods based on minimum description length.
[0015] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements any one of the above-described symbolic regression methods based on minimum description length.
[0016] By implementing the method of this application, applying the minimum description length (MDL) to a symbolic regression method based on Monte Carlo tree search, it is possible to obtain an optimal formula (target formula) that accurately fits the relationships between multiple parameters based on the real data of multiple parameters generated in the target system. Because the minimum description length is determined by a pre-trained prediction model and can accurately reflect the degree of similarity between each candidate formula in the search tree and the target formula, the target candidate formula in the final search tree can be as close to the target formula as possible. Therefore, the target formula obtained by processing the target candidate formula can accurately fit the relationships between the various parameters in the target system, effectively resolving the problem in related technologies of being unable to obtain a target formula in the correct form for fitting the relationships between multiple parameters in the target system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 This is a flowchart of a symbolic regression method based on minimum description length shown in one embodiment of the present application; Figure 2 This is a schematic diagram of an implementation process of a symbolic regression method shown in an embodiment of the present application; Figure 3 This is a schematic diagram of the structure of a preset neural network model shown in one embodiment of the present application; Figure 4This is a schematic diagram of a process for training a preset neural network model according to an embodiment of the present application; Figure 5 This is a schematic diagram of a process for obtaining a target formula according to an embodiment of the present application; Figure 6 This is a structural block diagram of a symbol regression device based on minimum description length shown in one embodiment of the present application; Figure 7 This is a schematic diagram of the physical structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] The method for symbolic regression based on minimum description length of the present application can be implemented by a symbolic regression device based on minimum description length or an electronic device. The method of the present application will be described in detail below, using the symbolic regression device based on minimum description length as an example.
[0021] Figure 1 This is a flowchart of a symbolic regression method based on minimum description length shown in one embodiment of the present application. Figure 1 , the method of the present application comprises the following steps: Step 101: Determine a target system for symbolic regression, and obtain first real data corresponding to multiple first parameters and second real data corresponding to one second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the multiple first parameters are input parameters of the target system, and the second parameter is an output parameter of the target system, and the multiple first parameters control the second parameter through coupling interaction.
[0022] In this application, the target system can be any type of system, for example, a weather forecast system, an economic forecast system, a circuit system, a chemical reaction system, etc. This application does not limit the type of the target system.
[0023] The target system includes multiple parameters. For example, when the target system is a circuit system, the multiple parameters may include resistance, capacitance, voltage, current, etc. For another example, when the target system is a chemical reaction system, the multiple parameters may include reactant concentration, reaction rate, temperature, etc.
[0024] When the goal of symbolic regression is to determine the relationship between a certain parameter and the remaining parameters in the target system, that is, when the goal of symbolic regression is to obtain a target formula that can accurately fit the relationship between a parameter and the remaining parameters in the target system, the one parameter can be used as the second parameter and the remaining parameters can be used as the first parameter.
[0025] Step 101 is executed to obtain first real data corresponding to each first parameter in the target system and real data for each second parameter pair. For example, if the target system is a circuit system, the first parameters are resistance, capacitance, and current, and the second parameter is voltage. In this case, it is necessary to obtain resistance values, capacitance values, current values, and voltage values at multiple different moments. The resistance values, capacitance values, current values, and voltage values at a single moment constitute a set of parameter values.
[0026] Step 102: Create a search tree using a symbolic regression method based on Monte Carlo tree search, and when expanding a node in the search tree, determine the minimum description length (MDL) of the candidate formula corresponding to the node based on the first real data, the second real data, and the pre-trained prediction model, and update the search tree based on the minimum description length. A single node in the search tree represents a single candidate formula. The candidate formula is constructed with the first parameter as the independent variable and the second parameter as the dependent variable. The minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data. The value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula.
[0027] In this application, the symbolic regression method based on Monte Carlo tree search adds new nodes to the search tree by iteratively running four steps of selection, expansion, simulation and update, such as Figure 2 As shown, the whole process includes the following steps 1 to 4. Figure 2 This is a schematic diagram of the implementation process of a symbolic regression method shown in an embodiment of the present application.
[0028] Step 1: Selection. The algorithm starts from the root node of the search tree and selects the node with high evaluation and low visit count among its child nodes. This process is repeated until a leaf node with no child nodes is reached. The "high evaluation and low visit count" can be measured using the Upper Confidence Bound (UCB) indicator. When selecting, the child node with the largest UCB is selected. The calculation method of the UCB of a child node is as follows: in, For algorithm access The number of subtrees whose child nodes are root nodes, For the first Evaluation of each node in the subtree with child nodes as the root node the sum of and The initial value of is zero and is updated in the subsequent step 4 as the algorithm runs.
[0029] Step 2: Expand. For the selected child node, consider the formula in the child node ,right Perform any transformation, such as Equal symbols act on To obtain a new candidate formula ,Will As The child nodes of are added to the search tree and initialized The corresponding node .
[0030] Step 3: Simulation. For the expanded ,Will Acts on the first real data corresponding to the first parameter ,get ,Will The second real data corresponding to the second parameter Input the pre-trained prediction model and get The corresponding minimum description length value, which is used Expressed as: .by As a pair evaluation, among which , For the formula length, for The standard deviation of For the formula The corresponding minimum description length value.
[0031] Step 4: Update. Add to the search tree Affects all its ancestor nodes (all nodes from the parent node to the root node) and , which in turn affects their Specifically, these ancestor nodes Increase by 1, indicating that their corresponding subtrees increase by 1, and the ancestor nodes Increase , indicating that the evaluation of their corresponding subtrees increases , and then calculate their new For example, the target system is a circuit system, the first parameters are resistance, capacitance, and current, and the second parameter is voltage. Then a candidate formula constructed can be ,in, Represents resistance, Indicates current, Represents voltage. Substituting a set of resistance, capacitance, and current values into the corresponding independent variables, we can get a value, will The voltage value Y corresponding to the resistance value, capacitance value, and current value of the group is input into the prediction model. It can be determined The corresponding minimum description length value. Only as a candidate formula An example, not a real one form of expression.
[0032] In this application, the minimum description length (MDL) refers to the minimum length required to model given data (first real data and second real data). Specifically in the field of symbolic regression, it refers to the total number of mathematical operators, numerical constants, and independent variables contained in a candidate formula that can fit the given data, that is, the sequence length of the symbol sequence corresponding to the candidate formula. If each symbol in the candidate formula is considered a one-step transformation, the candidate formula's MDL reflects the total number of transformations required to get from the independent variable of the formula to its dependent variable. Therefore, applying the candidate formula to the independent variable values in the given data (first real data) yields the value of the dependent variable. The MDL between this resulting dependent variable value and the standard dependent variable value in the given data (second real data) can be used to measure the number of remaining transformations required to get from the candidate formula to the target formula. In other words, a smaller MDL for a candidate formula indicates a higher degree of similarity between the candidate formula and the target formula, and a smaller number of transformations are required to get from the candidate formula to the target formula. A larger MDL for a candidate formula indicates a lower degree of similarity between the candidate formula and the target formula, and a larger number of transformations are required to get from the candidate formula to the target formula.
[0033] In this application, to minimize As the goal, by continuously repeating steps 1 to 4 above, new nodes can be continuously added to the search tree until the creation of the search tree is completed.
[0034] Step 103: After the search tree is created, a target candidate formula with the shortest description length in the search tree is obtained, and a target formula is determined based on the target candidate formula, where the target formula represents the relationship between each first parameter and second parameter in the target system.
[0035] When the pre-set algorithm stop condition is reached, the search tree creation can be determined to be complete. At this time, the candidate formula with the smallest description length in the search tree can be determined and used as the target candidate formula, and then the target formula can be further obtained based on the target candidate formula. Figure 2 In , the formula corresponding to the optimal node obtained is the target candidate formula.
[0036] In this application, the target formula refers to the best formula that can accurately fit the relationship between the first parameter and the second parameter in the target system. Figure 2 In , the symbolic regression result is the target formula.
[0037] By implementing the method of the present application and applying the minimum description length to a symbolic regression method based on Monte Carlo tree search, it is possible to obtain an optimal formula that can accurately fit the relationship between multiple parameters based on the real data of multiple parameters generated in the target system. Since the minimum description length is determined by a pre-trained prediction model, it can accurately reflect the degree of similarity between each candidate formula in the search tree and the target formula, so the target candidate formula in the search tree that is finally created can be as close to the target formula as possible. Therefore, the target formula obtained by processing the target candidate formula can accurately fit the relationship between the various parameters in the target system, effectively solving the problem in the related art that it is impossible to obtain a target formula in the correct form for fitting the relationship between multiple parameters in the target system.
[0038] In combination with the above embodiments, in one implementation, the prediction model is trained through the following steps: Step 201: Obtain multiple random sample symbol formulas.
[0039] Specifically, step 201 may include: Randomly determine a target value within a preset value range as the dimension of the independent variable in the sample symbol formula; Randomly selecting at least one binary operator from all binary operators, and obtaining a first expression based on the at least one binary operator and an independent variable, wherein the number of the at least one binary operator is not greater than a target value; Randomly select at least one unary operator from all unary operators, and insert the at least one unary operator into the first expression to obtain a second expression; A sample symbolic formula is obtained by randomly inserting a numerical constant into the second expression by multiplication or addition; Repeat the above steps to obtain multiple sample symbol formulas.
[0040] The following will explain in detail the process of obtaining a random sample symbol formula through the following steps 2011 to 2014: Step 2011: From 1 to (i.e., the preset value range) uniformly randomly samples a value as (i.e. target value), Represents the dimension of the independent variable in the observation data. is a pre-given value. For example, assume , if we obtain , then the sample symbolic formula generated subsequently will be constructed based on 3 independent variables.
[0041] Step 2012: Randomly sample 0 to D operators from all available binary operators (such as addition, subtraction, multiplication, division, and exponentiation), and use the sampled operators to combine D independent variables into an expression (i.e., the first expression). For example, assume that the three independent variables are 、 、 , if we sample two binary operators “+” and “*”, then the first expression can be .
[0042] Step 2013: Randomly sample 0 to 4 unary operators from all available unary operators (such as square, root, exponential, logarithmic, and trigonometric functions) and insert them into the first expression. For example, in the obtained Based on , if we sample and get two unary operators "sin" and "sqrt", then the second expression after insertion can be .
[0043] Step 2014: randomly insert numerical constants into the second expression by multiplication or addition. For example, , if we randomly select the addition operation to insert the numerical constant 3, then the final symbolic formula is , if we select multiplication by random operation to insert the numerical constant 2, then the final sample symbol formula is .
[0044] One sample symbol formula may be obtained by executing the above steps 2011 to 2014 once, and multiple sample symbol formulas may be obtained by repeating the above steps 2011 to 2014 multiple times.
[0045] Step 202: Acquire multiple groups of different sample observation data according to multiple sample symbolic formulas. One group of sample observation data corresponds to one sample symbolic formula. Each row in each group of sample observation data includes a value corresponding to at least one independent variable and a value corresponding to one dependent variable.
[0046] Specifically, the multiple sample symbol formulas include a target sample symbol formula, and the target sample symbol formula is any one of the multiple sample symbol formulas. Taking the acquisition of sample observation data corresponding to the target sample symbol formula as an example, step 202 may specifically include: According to the dimension of the independent variable corresponding to the target sample symbol formula, multiple groups of sample points are obtained by sampling with a Gaussian mixture distribution with a preset number of cluster centers, and a group of sample points represents a group of values of the independent variable; For each set of sample points, substitute them into the independent variable in the target sample symbol formula to obtain the value of the dependent variable in the target sample symbol formula (i.e., the dependent variable sample point); According to the values of multiple groups of sample points and dependent variables, a group of sample observation data corresponding to the target sample symbol formula is obtained.
[0047] The following will explain in detail the process of obtaining the sample observation data corresponding to the target sample symbol formula through steps 21 to 23: Step 221: If the target sample symbol formula contains D independent variables, sample 100 to 300 groups of sample points from a Gaussian mixture distribution with 1 to 10 cluster centers in D-dimensional space, and use these sample points to form a matrix , where N represents the number of sample points (between 100 and 300), and D represents the dimension of the independent variable. For example, suppose there is a symbolic formula , where D=2 (there are 2 independent variables and ), if 200 groups of sample points are sampled from a two-dimensional Gaussian mixture distribution with 3 cluster centers, a matrix can be obtained ,matrix Each row in represents a set of sample points, and a set of sample points represents and A set of specific values.
[0048] Step 2022: For each set of sample points obtained by sampling , substitute it into the independent variable of the target sample symbol formula and calculate the corresponding Value, all Composition vector ,vector That is, the dependent variable sample point. Continuing with the example in step 2021, if the target sample symbol formula is , N=200, for the matrix The first set of sample points in [ ], substitute into the formula Can get , similarly, for the matrix The second set of sample points in [ ], substituting into the formula we can get By analogy, we can calculate 200 y values and then get the vector .
[0049] Step 2023: To ensure numerical stability, Normalize to make the mean 0 and the standard deviation 1. Continuing with the example in step 2022, assume The mean is μ, the standard deviation is σ, Each element in Normalize, the new The value is .
[0050] The above steps 2021 to 2023 are to obtain a sample symbol formula and For example, in actual implementation, there are usually multiple sample symbol formulas, and it is necessary to obtain a set of corresponding sample symbol formulas according to the above steps 21-23. and , a group and That is, a set of sample observation data, so multiple sets of sample observation data can be obtained. If the number of sample observation data groups is represented by B, then multiple sets of sample observation data can be expressed as .
[0051] Step 203: Train the preset neural network model based on multiple sample symbol formulas and multiple groups of sample observation data to obtain a prediction model.
[0052] In the present application, the preset neural network model includes a first network module and a second network module. The first network module includes at least a first attention pooling module and a read head module, and the second network module includes at least a second attention pooling module. Accordingly, step 203 may include: Inputting multiple groups of sample observation data into the first network module, processing the sample observation data through the first attention pooling module to obtain a first embedding vector; Inputting multiple sample symbolic formulas into the second network module, processing the sample symbolic formulas through the second attention pooling module to obtain a second embedding vector; Inputting the first embedding vector and the second embedding vector into a first objective loss function to obtain a first loss value; If the first loss value satisfies a first preset condition, the first embedding vector is processed by a read head module to obtain a predicted value of a minimum description length; Determine the length value of the prefix expression of multiple sample symbolic formulas; Input the predicted value and the length value into the second objective loss function to obtain a second loss value; If the second loss value satisfies the second preset condition, it is determined that the training is completed, and the first network module when the training is completed is a prediction model; The first objective loss function is: The second objective loss function is: in, Indicates the number of groups of sample observation data or the number of sample symbolic formulas, represents the first embedding vector, represents the second embedding vector, represents the predicted value of the minimum description length, The length value of the prefix expression representing the sample symbolic formula.
[0053] In the present application, the first network module further includes an embedding module and an encoding module. Multiple sets of sample observation data are input into the first network module, and the sample observation data are processed by the first attention pooling module to obtain a first embedding vector, which may include: Performing characterization processing on the sample observation data to obtain the sample observation data in a characterized sequence format; Processing the dimension of the sample observation data in the character sequence format through the embedding module to obtain a first vector; Encoding the first vector by an encoding module to obtain a second vector; Input the second vector into the first attention pooling module, obtain the weights corresponding to the elements in each row of the second vector through the first attention pooling module, and perform weighted summation on the elements in each row of the second vector according to the weights corresponding to the elements in each row of the second vector to obtain the first embedding vector; The weights corresponding to the elements in each row of the second vector are calculated using the following formula: in, Indicates the first row elements, Indicates the first The weight corresponding to the row elements, represents the pre-trained attention vector.
[0054] The following is a detailed introduction to the training process of the prediction model, which includes the following steps: Step 1: Encode the sample symbolic formula into data in a character sequence format suitable for processing by the preset neural network model.
[0055] First, convert the sample symbolic formula into its prefix expression. This expression allows you to ignore the brackets in the sample symbolic formula and only retain the unary or binary operators, numerical constants, and independent variables in the sample symbolic formula. The key to converting the sample symbolic formula into a prefix expression is to process it in the order of operators first and operands second, starting from the outermost operator. For example, for the sample symbolic formula , starting from the outer operator " / ", the two operands are and , first Convert, the prefix expression of "2+1" is "+2 1", then The prefix expression is "* 3 + 2 1", The prefix expression is " 4", then The prefix expression is "- sin 4 5", and finally, the prefix expression of the entire symbolic formula is " / * 3 + 2 1 - sin 4 5".
[0056] Next, convert the numerical constants in the expression into a triple containing the sign, exponent, and mantissa, thus obtaining the sequence ,in is the set of all operators, arguments, numerical constant symbols, numerical constant exponents, and numerical constant mantissas, is the sequence length. For example, for a numerical constant 2, it can be expressed as (+ θ 2), where “+” represents the numerical constant sign and “θ” represents the numerical constant exponent (here For example, "2" represents the mantissa of a numerical constant. For example, replacing the numerical constants 3, 2, 1, 4, and 5 in " / *3 + 2 1 - sin 4 5" with their corresponding triplets yields " / * (+ θ 3) + (+ θ 2) (+ θ 1) - sin (+ θ 4) (+ θ 5)".
[0057] In actual implementation, there are multiple sample symbol formulas. For each sample symbol formula, the corresponding sequence must be obtained according to the above method. If the number of sample symbolic formulas is represented by B, then the sequence corresponding to B sample symbolic formulas can be expressed as .
[0058] Step 2: Observe multiple groups of sample data in continuous space Perform characterization processing to obtain sample observation data in a character sequence format to adapt to the architecture of the preset neural network model. The following describes the process of characterization processing of a set of sample observation data: First, fill the independent variables in the observation data with 0 The variable dimension , so that it expands to the specified width ,get , to accommodate different dimensions various problems.
[0059] Next, fill in the result The dependent variable in the sample observation data Splice along the variable dimension to get the matrix .
[0060] Next, based on floating point representation, the matrix Each element in is converted to include the symbol ( ),index( ) and the mantissa ( ) triples, such as can be represented as a triple ( , ,1.234). In this way, the observation data originally in the continuous space Encoded as a tensor in discrete space ,in is a set of all signs, exponents, and mantissas.
[0061] In actual implementation, each set of sample observation data must be characterized according to the above process.
[0062] Step 3: Characterize the observation data (That is, the tensor obtained in Step 2 ) Input the preset neural network model. Figure 3 This is a schematic diagram of the structure of a preset neural network model shown in an embodiment of the present application. Figure 3 As shown, the preset neural network model of the present application specifically includes a first network module and a second network module. The first network module includes a first embedding module, a first encoding module, a first attention pooling module and a read head module, and the second network module includes a second embedding module, a second encoding module and a second attention pooling module. Among them, the second embedding module is similar in structure to the first embedding module, the second encoding module is similar in structure to the first encoding module, and the second attention pooling module is similar in structure to the first attention pooling module.
[0063] First, convert the sample observation data in character sequence format (That is, the tensor obtained in Step 2 ) Input the first embedding module in the preset neural network model, the first embedding module first maps each element into a vector in the high-dimensional space, that is, , The value can be set according to actual needs, and a three-layer fully connected neural network is used to reduce the dimension of the mapping result to obtain the embedding of the sample observation data , the first vector is the embedding .
[0064] Next, the first encoding module (eight-layer transformer encoding module without position encoding) is used to embed Encode and get the encoded embedding , since the observation data is not sensitive to the order of arrangement, the transformer encoding module does not use position encoding. The second vector is embedded .
[0065] Next, to encode the result Compressed into observation data embedding with fixed shape, the first attention pooling module Specifically, we use the trainable attention vector The encoding result Each line Calculate the weights separately: And according to , weighted sum of each row into observation data embedding with fixed shape , the first embedding vector is .
[0066] Finally, a three-layer fully connected neural network is used as the read head module to embed The dimension is reduced to a scalar as the predicted value of the minimum description length MDL of the sample observation data.
[0067] in, is a dimensional vector, through Calculated is a scalar. For example ,So , so we get Also a -dimensional vector, where the first element is , the value of the second element is .
[0068] In this application, a two-stage training method can be used to train the preset neural network model. Figure 4 This is a flow chart of a training process for a preset neural network model according to an embodiment of the present application. Figure 4In the first stage, the preset neural network model is first trained to align the symbol space and the numerical space. Specifically, the sample observation data of group B is first transformed into the Encoded as the first embedding vector Then, use the second network module to convert the encoded B group symbol sequence Encoded as the second embedding vector , then, use the following first objective loss function To align: The second network module is used to convert the encoded B group symbol sequence Encoded as the second embedding vector In the process, the working principles of the second embedding module, the second encoding module and the second attention pooling module are the same as those of the first embedding module, the first encoding module and the first attention pooling module, and are not repeated in this application.
[0069] Based on After training to convergence, the second stage begins, where the preset neural network model is trained to predict the value of the minimum description length MDL of the symbolic formula from the aligned numerical space.
[0070] Specifically, the first network module is used to transform the sample observation data of group B into Encoded as the first embedding vector , then use the read head module to obtain the predicted value of the minimum description length MDL , then based on the sample symbol formula of group B Calculate the length of its prefix expression ,Will as the true value and use the following second objective loss function To train: Based on After training to convergence, the preset neural network model training is completed, and the first network module can be used as a prediction model for predicting MDL. The prediction model can predict the given observation data Corresponding formula The minimum description length is: and use A value indicating the minimum description length.
[0071] This application can apply the trained prediction model to the symbolic regression method based on Monte Carlo tree search to improve the accuracy of the target formula obtained. Specifically, MCTS is a heuristic search algorithm that maintains a search tree, where each node represents a candidate formula. ,in The elements in are all The independent variables are mapped to The symbolic function of the dependent variable. For a candidate formula , we can use the prediction model to estimate is the independent variable, The minimum description length when it is the dependent variable : in, Indicates that from the formula To the target formula The transformations that need to be undergone are , ,in Represents a compound operation. Approximately estimated from the candidate formula To the target formula Still need to go through the transformation , so it can be considered as With the target formula Therefore, this application can use Search as an optimization target and Small enough to find by specific methods In the specific operation, the linear regression method is used, that is, , given the observation data Based on , and then get The best form of For the formula No. Components. Among them, is a preset value determined based on the dependent variable value in the given observation data. In this application, the given observation data includes the first real data and the second real data. is the first real data, The second real data.
[0072] In combination with the above embodiments, in one implementation, determining a target formula based on candidate target formulas includes: The target candidate formula is adjusted using the first real data and the second real data through a linear regression method to obtain a target formula.
[0073] In this application, based on the given observation data , the goal of linear regression is to find a set of , making Fit the observed data Y as much as possible. In this application, a set of , and then determine , and finally according to The target formula can be determined , is the target candidate formula.
[0074] In one embodiment, given the observation data in the target system , the goal is to obtain a symbolic function that describes this observation data ,in represents N sets of observations of D independent variables, is the N sets of observations of a single dependent variable. , first generate a large number of formula-value pairs, and use Figure 4 The two-stage training method shown in the figure pre-trains the preset neural network model. After training, the preset neural network model has the ability to estimate the length of the symbolic formula between the independent variable and the dependent variable in the observation data. Therefore, the trained neural network model is applied to the symbolic regression method based on Monte Carlo tree search to obtain the equation for fitting the given observation data. The best formula for The whole process is as follows Figure 5 shown. Figure 5 This is a schematic diagram of a process for obtaining a target formula shown in an embodiment of the present application.
[0075] In summary, in this application, a large number of sample symbol formulas and corresponding sample observation data are first generated, and then the sample symbol formulas and sample observation data are used to train the preset neural network model. The trained preset neural network model is used to generate a large number of sample symbol formulas and corresponding sample observation data. As input, output a scalar As the length of the real symbol formula Estimation of . Considering that this is a cross-modal prediction task across two different modalities, data and symbols, this application uses a two-stage training method to improve the training effect. In the first stage, the preset neural network model is aligned with the embedding space of the observation data and the symbolic formula through the contrast learning method, and in the second stage, it is learned how to extract the length of the symbolic formula from the embedding of the observation data. The trained preset neural network model can be used to guide the symbolic regression search without further training. Specifically, for given observation data, the Monte Carlo tree search method is used to find the formula To minimize , this value reflects With the target formula The remaining transformations required The length of With the target formula When the distance is small enough, it means that it can be transformed by a simple enough Acts on To obtain the target formula Specifically, we can use the linear regression method to calculate , and then return as the searched target formula.
[0076] In another embodiment, after the training of the neural network model is completed, its estimation performance is tested as follows. First, generate formula-data pairs. As input to the preset neural network model, calculate the output Finally, calculate the length of the prefix expression of the formula as the truth value , and use this to evaluate the output of the preset neural network model. The comparison can be based on two dimensions: 1) Prediction value and truth value 2) Prediction value Relative size and true value The relative size of the closeness. For this purpose, the first dimension can be used The second dimension can be measured using Measured as follows: The results show an RMSE of 3.9, only 15% of the average formula length of 25. The AUC is 0.8859, very close to 1.0. This indicates that the trained neural network model accurately predicts the complexity of the formula, and the relative size of the predicted values is very consistent with the relative size of the true values.
[0077] In summary, the following three problems exist in the related art: (1) For search-based methods, it is difficult to find a target formula with an accurate form because the search goal is to achieve fitting accuracy rather than to restore the correct form of the target formula; (2) For generation-based methods, it is difficult to obtain a target formula with a correct form due to the high nonlinearity of the symbol space; (3) For regression-based methods, it is difficult to achieve stable and accurate fitting on any given data due to numerical instability. In this application, the minimum description length is applied to the symbolic regression method based on Monte Carlo tree search, which can achieve the optimal formula (target formula) with the correct form for fitting the relationship between multiple parameters based on the real data of multiple parameters generated in the target system, effectively solving the three problems mentioned in the related art.
[0078] The following describes a symbol regression device based on minimum description length provided in the present application. The symbol regression device based on minimum description length described below and the symbol regression method based on minimum description length described above can refer to each other.
[0079] Figure 6 This is a structural block diagram of a symbol regression device based on minimum description length shown in an embodiment of the present application. Figure 6 , the symbol regression device based on minimum description length of the present application includes: A first determination module 601 is configured to determine a target system to be subjected to symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; a creation module 602, configured to create a search tree using a symbolic regression method based on Monte Carlo tree search, and when expanding a node in the search tree, determine a minimum description length of a candidate formula corresponding to the node based on the first real data, the second real data, and a pre-trained prediction model, and update the search tree based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula being constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length representing the distance between the value of the dependent variable in the candidate formula and the second real data, the value of the dependent variable being obtained by substituting the first real data into the corresponding independent variable in the candidate formula; The second determination module 603 is used to obtain the target candidate formula with the shortest description length in the search tree after completing the creation of the search tree, and determine the target formula based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0080] According to a symbol regression device based on minimum description length provided by the present application, the second determination module 603 includes: An adjustment submodule is configured to adjust the target candidate formula using the first real data and the second real data through a linear regression method to obtain the target formula.
[0081] A symbolic regression device based on minimum description length provided by the present application further includes a training module, wherein the training module includes: A first acquisition submodule is used to acquire multiple random sample symbol formulas; A second acquisition submodule is configured to acquire multiple groups of different sample observation data according to the multiple sample symbolic formulas, wherein each group of the sample observation data corresponds to one sample symbolic formula, and each row in each group of the sample observation data includes a value corresponding to at least one independent variable and a value corresponding to a dependent variable; The training submodule is used to train the preset neural network model according to the multiple sample symbol formulas and multiple groups of sample observation data to obtain the prediction model.
[0082] According to a symbolic regression device based on minimum description length provided by the present application, the preset neural network model includes a first network module and a second network module, the first network module includes at least a first attention pooling module and a read head module, and the second network module includes at least a second attention pooling module; the training submodule is specifically used to: Inputting the plurality of groups of sample observation data into the first network module, and processing the sample observation data through the first attention pooling module to obtain a first embedding vector; Inputting a plurality of the sample symbolic formulas into the second network module, and processing the sample symbolic formulas through the second attention pooling module to obtain a second embedding vector; Inputting the first embedding vector and the second embedding vector into a first objective loss function to obtain a first loss value; If the first loss value satisfies a first preset condition, processing the first embedding vector by the read head module to obtain a predicted value of the minimum description length; Determining the length values of prefix expressions of a plurality of the sample symbolic formulas; Inputting the predicted value and the length value into a second objective loss function to obtain a second loss value; If the second loss value satisfies a second preset condition, it is determined that the training is completed, and the first network module when the training is completed is the prediction model; The first objective loss function is: The second objective loss function is: in, Indicates the number of groups of sample observation data or the number of sample symbolic formulas, represents the first embedding vector, represents the second embedding vector, represents the predicted value of the minimum description length, The length value of the prefix expression representing the sample symbolic formula.
[0083] According to a symbolic regression device based on minimum description length provided by the present application, the first network module further includes an embedding module and an encoding module, and the training submodule is further configured to: Performing characterization processing on the sample observation data to obtain sample observation data in a characterized sequence format; Processing the dimension of the sample observation data in the characterized sequence format by the embedding module to obtain a first vector; Encoding the first vector by the encoding module to obtain a second vector; Input the second vector into the first attention pooling module, obtain the weight corresponding to each row element in the second vector through the first attention pooling module, and perform weighted summation on each row element in the second vector according to the weight corresponding to each row element in the second vector to obtain the first embedding vector; The weights corresponding to the elements in each row of the second vector are calculated using the following formula: in, Indicates the first row elements, Indicates the first The weight corresponding to the row elements, represents the pre-trained attention vector.
[0084] According to a symbol regression device based on minimum description length provided by the present application, the first acquisition submodule is specifically used for: Randomly determine a target value within a preset value range as the dimension of the independent variable in the sample symbol formula; randomly selecting at least one binary operator from all binary operators, and obtaining a first expression according to the at least one binary operator and the independent variable, wherein the number of the at least one binary operator is not greater than the target value; Randomly select at least one unary operator from all unary operators, and insert the at least one unary operator into the first expression to obtain a second expression; randomly inserting a numerical constant into the second expression by multiplication or addition to obtain a sample symbolic formula; Repeat the above steps to obtain multiple sample symbol formulas.
[0085] According to a symbol regression device based on minimum description length provided by the present application, the multiple sample symbol formulas include a target sample symbol formula, and the target sample symbol formula is any one of the multiple sample symbol formulas. The second acquisition submodule is specifically configured to: According to the dimension of the independent variable corresponding to the target sample symbol formula, a plurality of groups of sample points are obtained by sampling using a Gaussian mixture distribution with a preset number of cluster centers, where a group of the sample points represents a set of values of the independent variable; For each group of sample points, substitute the sample points into the independent variables in the target sample symbol formula to obtain the value of the dependent variable in the target sample symbol formula; A set of sample observation data corresponding to the target sample symbol formula is obtained according to the multiple groups of sample points and the values of the dependent variable.
[0086] Figure 7 This is a schematic diagram of the physical structure of an electronic device shown in an embodiment of the present application. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the symbolic regression method based on the minimum description length, which includes: Determine a target system for symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; A search tree is created by a symbolic regression method based on Monte Carlo tree search, and when a node in the search tree is expanded, a minimum description length of a candidate formula corresponding to the node is determined based on the first real data, the second real data, and a pre-trained prediction model, and the search tree is updated based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula is constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data, and the value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula; After completing the creation of the search tree, the target candidate formula with the shortest description length in the search tree is obtained, and the target formula is determined based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0087] In addition, the logical instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the existing technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0088] On the other hand, the present application also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the symbolic regression method based on minimum description length provided by the above methods, which includes: Determine a target system for symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; A search tree is created by a symbolic regression method based on Monte Carlo tree search, and when a node in the search tree is expanded, a minimum description length of a candidate formula corresponding to the node is determined based on the first real data, the second real data, and a pre-trained prediction model, and the search tree is updated based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula is constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data, and the value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula; After completing the creation of the search tree, the target candidate formula with the shortest description length in the search tree is obtained, and the target formula is determined based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0089] In another aspect, the present application further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program is implemented to perform the symbolic regression method based on minimum description length provided by the above methods, the method comprising: Determine a target system for symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; A search tree is created by a symbolic regression method based on Monte Carlo tree search, and when a node in the search tree is expanded, a minimum description length of a candidate formula corresponding to the node is determined based on the first real data, the second real data, and a pre-trained prediction model, and the search tree is updated based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula is constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data, and the value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula; After completing the creation of the search tree, the target candidate formula with the shortest description length in the search tree is obtained, and the target formula is determined based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
[0090] 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, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0091] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A symbolic regression method based on minimum description length, characterized in that: include: Determine a target system for symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; A search tree is created by a symbolic regression method based on Monte Carlo tree search, and when a node in the search tree is expanded, a minimum description length of a candidate formula corresponding to the node is determined based on the first real data, the second real data, and a pre-trained prediction model, and the search tree is updated based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula is constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length represents the distance between the value of the dependent variable in the candidate formula and the second real data, and the value of the dependent variable is obtained by substituting the first real data into the corresponding independent variable in the candidate formula; After completing the creation of the search tree, the target candidate formula with the shortest description length in the search tree is obtained, and the target formula is determined based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
2. The method according to claim 1, characterized in that The determining of the target formula according to the target candidate formula includes: The target candidate formula is adjusted using the first real data and the second real data through a linear regression method to obtain the target formula.
3. The method according to claim 1, characterized in that The prediction model is trained through the following steps: Get multiple random sample symbol formulas; Acquire multiple groups of different sample observation data according to the multiple sample symbolic formulas, wherein one group of the sample observation data corresponds to one sample symbolic formula, and each row in each group of the sample observation data includes a value corresponding to at least one independent variable and a value corresponding to a dependent variable; According to the plurality of sample symbol formulas and the plurality of groups of sample observation data, a preset neural network model is trained to obtain the prediction model.
4. The method according to claim 3, characterized in that The preset neural network model includes a first network module and a second network module, the first network module includes at least a first attention pooling module and a reading head module, and the second network module includes at least a second attention pooling module; The method of training a preset neural network model based on the plurality of sample symbol formulas and the plurality of groups of sample observation data to obtain the prediction model includes: Inputting the plurality of groups of sample observation data into the first network module, and processing the sample observation data through the first attention pooling module to obtain a first embedding vector; Inputting a plurality of the sample symbolic formulas into the second network module, and processing the sample symbolic formulas through the second attention pooling module to obtain a second embedding vector; Inputting the first embedding vector and the second embedding vector into a first objective loss function to obtain a first loss value; If the first loss value satisfies a first preset condition, processing the first embedding vector by the read head module to obtain a predicted value of the minimum description length; Determining the length values of prefix expressions of a plurality of the sample symbolic formulas; Inputting the predicted value and the length value into a second objective loss function to obtain a second loss value; If the second loss value satisfies a second preset condition, it is determined that the training is completed, and the first network module when the training is completed is the prediction model; The first objective loss function is: The second objective loss function is: in, Indicates the number of groups of sample observation data or the number of sample symbolic formulas, represents the first embedding vector, represents the second embedding vector, represents the predicted value of the minimum description length, The length value of the prefix expression representing the sample symbolic formula.
5. The method according to claim 4, characterized in that The first network module further includes an embedding module and an encoding module. The plurality of groups of sample observation data are input into the first network module, and the sample observation data are processed by the first attention pooling module to obtain a first embedding vector, including: Performing characterization processing on the sample observation data to obtain sample observation data in a characterized sequence format; Processing the dimension of the sample observation data in the characterized sequence format by the embedding module to obtain a first vector; Encoding the first vector by the encoding module to obtain a second vector; Input the second vector into the first attention pooling module, obtain the weight corresponding to each row element in the second vector through the first attention pooling module, and perform weighted summation on each row element in the second vector according to the weight corresponding to each row element in the second vector to obtain the first embedding vector; The weights corresponding to the elements in each row of the second vector are calculated using the following formula: in, Indicates the first row elements, Indicates the first The weight corresponding to the row elements, represents the pre-trained attention vector.
6. The method according to claim 3, characterized in that The formula for obtaining multiple random sample symbols includes: Randomly determine a target value within a preset value range as the dimension of the independent variable in the sample symbol formula; randomly selecting at least one binary operator from all binary operators, and obtaining a first expression according to the at least one binary operator and the independent variable, wherein the number of the at least one binary operator is not greater than the target value; Randomly select at least one unary operator from all unary operators, and insert the at least one unary operator into the first expression to obtain a second expression; randomly inserting a numerical constant into the second expression by multiplication or addition to obtain a sample symbolic formula; Repeat the above steps to obtain multiple sample symbol formulas.
7. The method according to claim 3, characterized in that The multiple sample symbol formulas include a target sample symbol formula, where the target sample symbol formula is any one of the multiple sample symbol formulas. The acquiring multiple groups of different sample observation data according to the multiple sample symbol formulas includes: According to the dimension of the independent variable corresponding to the target sample symbol formula, a plurality of groups of sample points are obtained by sampling using a Gaussian mixture distribution with a preset number of cluster centers, where a group of the sample points represents a set of values of the independent variable; For each group of sample points, substitute the sample points into the independent variables in the target sample symbol formula to obtain the value of the dependent variable in the target sample symbol formula; A set of sample observation data corresponding to the target sample symbol formula is obtained according to the multiple groups of sample points and the values of the dependent variable.
8. A symbolic regression device based on minimum description length, characterized in that: include: a first determination module, configured to determine a target system to be subjected to symbolic regression, and obtain first real data corresponding to a plurality of first parameters and second real data corresponding to a second parameter generated in the target system, wherein the first parameters and the second parameters are different from each other, the plurality of first parameters are input parameters of the target system, the second parameter is an output parameter of the target system, and the plurality of first parameters control the second parameter through coupling interaction; a creation module, configured to create a search tree using a symbolic regression method based on Monte Carlo tree search, and when expanding a node in the search tree, determine a minimum description length of a candidate formula corresponding to the node based on the first real data, the second real data, and a pre-trained prediction model, and update the search tree based on the minimum description length, wherein a single node in the search tree represents a single candidate formula, the candidate formula being constructed with the first parameter as an independent variable and the second parameter as a dependent variable, the minimum description length representing a distance between a value of the dependent variable in the candidate formula and the second real data, the value of the dependent variable being obtained by substituting the first real data into the corresponding independent variable in the candidate formula; The second determination module is used to obtain the target candidate formula with the shortest description length in the search tree after completing the creation of the search tree, and determine the target formula based on the target candidate formula, where the target formula represents the relationship between each of the first parameters and the second parameters in the target system.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the symbolic regression method based on minimum description length as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the symbolic regression method based on minimum description length according to any one of claims 1 to 7.