An intelligent selection method and system for iterative methods for sparse linear systems
By combining multi-channel encoding and a diagonally enhanced Transformer module, the numerical distortion and global dependency ambiguity problems in the iterative selection of sparse linear systems are solved, achieving higher selection accuracy and robustness, and making it suitable for efficient solutions to complex engineering problems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 粤港澳大湾区(广东)国创中心
- Filing Date
- 2026-03-18
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies, when selecting iterative methods for sparse linear systems, suffer from numerical distortion caused by matrix encoding, incomplete representation due to ignoring right-hand terms, and global dependency ambiguity caused by convolution induction bias, which affect the accuracy and robustness of the selection of iterative methods.
Multi-channel encoding is used to generate matrix and right-hand side image data. Local features are extracted through convolutional network, and global interactive modeling is performed using diagonal enhancement Transformer module. Local and global features are fused to predict the optimal iterative method.
It improves the accuracy and robustness of iterative method selection, and is particularly suitable for solving complex engineering problems with global dominance characteristics, significantly improving computational efficiency and generalization ability.
Smart Images

Figure CN122451233A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to an iterative intelligent selection method and an iterative intelligent selection system for sparse linear systems. Background Technology
[0002] Solving sparse linear systems Ax = b plays an indispensable role in scientific and engineering fields such as structural analysis, fluid simulation, and thermal prediction. Solution algorithms are divided into direct methods and iterative methods. Direct methods are significantly limited in practical applications due to their high computational complexity and large storage requirements. In contrast, iterative methods have become the mainstream choice due to their superior computational efficiency and lower memory overhead.
[0003] However, the application of iterative methods faces serious challenges: their robustness is poor, and their solution efficiency (convergence speed) is highly coupled with the mathematical and physical characteristics of the problem to be solved. For a specific problem, choosing an appropriate iterative method can achieve rapid convergence; conversely, an inappropriate choice can lead to convergence stagnation or even divergence. This characteristic highlights the necessity of selecting an appropriate iterative method for a specific sparse linear system.
[0004] To achieve intelligent selection through iterative methods, existing technologies have undergone a leap from traditional machine learning to the emerging deep learning paradigm.
[0005] In the traditional machine learning phase, early work explored classifiers such as Support Vector Machines and AdaBoost, and extended to computationally efficient algorithms like nearest neighbor and decision trees. As research progressed, the focus gradually shifted to systematic ensemble frameworks, such as the Lighthouse framework, which optimizes solvers by integrating multiple machine learning algorithms. In recent years, advanced ensemble models like XGBoost and GBDT have established themselves as the mainstream in this phase due to their superior performance.
[0006] Deep learning's superior representation learning capabilities have driven paradigm shifts in this field. Early image-based methods encoded matrices as RGB images and used convolutional networks to extract structural features. Numerical methods input numerical features of matrices into fully connected networks to optimize the solver. Graph neural networks have broadened the research perspective by modeling the topological relationships between matrix elements. Current state-of-the-art multimodal strategies fuse image and numerical features, improving selection accuracy and robustness.
[0007] Despite some progress in existing technologies, image-based iterative selection methods still have the following fundamental limitations: 1. Numerical distortion caused by matrix encoding: Traditional RGB image encoding schemes compress the numerical distribution within a matrix block into a single scalar mean, thereby losing the dynamic range and distribution information of the values. For example, a matrix block with uniform values and a matrix block containing maximal outliers may have the same mean, making them indistinguishable under RGB encoding. This makes it difficult for the model to identify numerical differences that are crucial to the choice of method.
[0008] 2. Incomplete representation due to neglecting the right-hand side (RHS): Most existing techniques focus only on feature extraction from the coefficient matrix, completely ignoring the right-hand side vector. However, in linear systems, the choice of the optimal iterative method (especially for the Krylov subspace method) depends not only on the matrix but also significantly on the smoothness or oscillation of the RHS. Relying solely on matrix features leads to an ill-posed problem definition and fails to fully represent the system characteristics.
[0009] 3. Global Dependency Ambiguity Caused by Convolutional Induction Bias: Traditional pattern recognition methods based on convolutional neural networks (CNNs) are limited by the local receptive field of the convolutional kernel, tending to focus on local texture features and struggling to capture long-range dependencies. However, certain key properties of sparse linear systems (such as the global convection dominance in the convection-diffusion equation) belong to global structural features. The architectural limitations of CNNs make it difficult for them to effectively perceive this global contextual information that plays a decisive role in method selection. Summary of the Invention
[0010] In view of the above problems, the present invention is proposed to provide an iterative intelligent selection method for sparse linear systems and a corresponding iterative intelligent selection system for sparse linear systems that overcomes or at least partially solves the above problems.
[0011] This invention discloses an iterative intelligent selection method for sparse linear systems, the method comprising: Receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data; Local feature extraction is performed on the matrix image data and the right-end term image data respectively to obtain the matrix local feature map and the right-end term local feature map; Global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand term, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. Based on the refined matrix feature map and the refined right-hand side feature map, a target iterative method suitable for solving the sparse linear system is predicted.
[0012] This invention also discloses an iterative intelligent selection system for sparse linear systems, the system comprising: An extended channel encoding module is used to receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and to perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data. A feature extraction backbone network is used to extract local features from the matrix image data and the right-end term image data respectively, to obtain matrix local feature maps and right-end term local feature maps; The diagonal enhancement Transformer module is used to perform global interactive modeling on the local feature map of the matrix and the local feature map of the right-hand term, and to fuse the result of the global interactive modeling with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. The classification prediction head module is used to predict the target iterative method suitable for solving the sparse linear system based on the refined matrix feature map and the refined right-hand term feature map.
[0013] This invention has the following advantages: The present invention provides an intelligent iterative selection method and system for sparse linear systems. Upon receiving the coefficient matrix and right-hand side of the system to be solved, an extended multi-channel encoding strategy is used to encode the matrix into a two-dimensional image and the right-hand side into a one-dimensional image. Subsequently, features of the matrix and right-hand side are extracted using convolutional networks. The resulting feature maps are then tokenized, and a multi-head self-attention mechanism is used to explicitly capture the internal structure of the matrix, the characteristics of the right-hand side, and the dependencies between them, obtaining a global token. This global token is then integrated into the feature map. Finally, the feature map, incorporating global information, is classified to predict the optimal iterative method. This invention effectively improves the accuracy and robustness of iterative method selection through whole-system representation and global context modeling, making it particularly suitable for solving complex engineering problems with globally dominant characteristics. Attached Figure Description
[0014] Figure 1 This is a flowchart of the iterative intelligent selection method for sparse linear systems according to the present invention; Figure 2 This is a comparative diagram of the prior art and the method of the present invention; Figure 3 This is a schematic diagram of the extended channel encoding scheme of the present invention; Figure 4 This is a detailed structural diagram of the Diagonal Enhancement Transformer (DET) module of the present invention. Detailed Implementation
[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] The iterative intelligent selection method for sparse linear systems provided in this embodiment of the invention may specifically include the following steps: Receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data; Local feature extraction is performed on the matrix image data and the right-end term image data respectively to obtain the matrix local feature map and the right-end term local feature map; Global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand term, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. Based on the refined matrix feature map and the refined right-hand side feature map, a target iterative method suitable for solving the sparse linear system is predicted.
[0017] This invention proposes a framework called SPECTRA (Systemic Problem Encoding and Contextual TRansformer Architecture), which aims to select the optimal iterative solution method through system-wide representation and global context modeling.
[0018] Reference Figure 1 The overall process and logic of this invention are as follows: 1. Data Preprocessing and Encoding: Receive the coefficient matrix and right-hand side vector of the sparse linear system. Employ an extended five-channel encoding scheme to convert the matrix into a multi-channel two-dimensional image and the right-hand side vector into a corresponding multi-channel one-dimensional image.
[0019] 2. Local Feature Extraction: Convolutional neural networks are used to process the matrix image and RHS image respectively to extract the initial feature map containing local patterns.
[0020] 3. Global modeling with diagonal enhancement: Based on the initial feature map, a matrix token, an RHS token, and a diagonal token containing numerical priors are generated through a tokenizer; then, a global interactive modeling is performed through a Transformer encoder; finally, a projector maps the global context back to the feature space and fuses it with local features.
[0021] 4. Prediction and Selection. The fused features are flattened and stitched together. The probability distribution of each candidate iterative method (solver-preprocessor operator pair) is calculated using a multilayer perceptron (MLP), and the method with the highest probability is selected as the recommendation result.
[0022] Figure 2 This diagram illustrates a comparison between existing technologies and the present invention (SPECTRA). It explains the limitations of existing technologies in RGB encoding, ignoring RHS, and CNN locality, as well as the improvements of the present invention in extended channels, RHS awareness, and the global DET module.
[0023] In an optional embodiment of the present invention, multi-channel encoding is performed on the coefficient matrix and the right-hand side to generate matrix image data and right-hand side image data, including: The coefficient matrix is divided into multiple matrix blocks, and multi-channel encoded values, including at least RGB channels, peak channels, and valley channels, are calculated for each matrix block to generate two-dimensional matrix image data. The right-hand item is divided into multiple one-dimensional segments, and a multi-channel encoded value, including at least the mean channel, peak channel, and valley channel, is calculated for each one-dimensional segment to generate one-dimensional image data of the right-hand item.
[0024] In addition to performing traditional RGB channel encoding (encoding the average amplitude, density, and matrix size of non-zero elements respectively), this embodiment adds a peak channel (P) and a valley channel (V). Figure 3 This is a schematic diagram of an extended channel encoding scheme. It illustrates how a matrix and RHS are encoded into an image / vector containing five channels: R, G, B, P, and V.
[0025] P channel: Encodes the maximum value of the non-zero elements within the matrix block corresponding to each pixel.
[0026] V channel: Encodes the minimum non-zero element within the matrix block corresponding to each pixel.
[0027] RHS encoding: The right-hand side is encoded using a five-channel method similar to that of a matrix, dividing it into one-dimensional segments. The R, G, B, P, and V values of each segment are calculated to generate a one-dimensional five-channel image, thereby achieving full system representation and solving the problem of numerical distortion.
[0028] In an optional embodiment of the present invention, local feature extraction is performed on the matrix image data and the right-hand term image data respectively to obtain a matrix local feature map and a right-hand term local feature map, including: The matrix image data is processed by a first convolutional neural network to extract features, resulting in a local feature map of the matrix. The right-end item image data is processed by a second convolutional neural network to extract features, thereby obtaining the local feature map of the right-end item.
[0029] This embodiment provides a method for capturing local texture and high-frequency features of matrix image data and right-hand side image data using a feature extraction backbone network. The feature extraction backbone network includes a matrix branch (two-dimensional convolution) and an RHS branch (one-dimensional convolution). Through multi-layer convolution, ReLU activation, and max-pooling operations, high-resolution input is mapped to low-resolution, high-dimensional feature maps. and .
[0030] In an optional embodiment of the present invention, global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand side, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand side feature map, including: The local feature map of the matrix and the local feature map of the right-hand term are tokenized to generate matrix tokens and right-hand term tokens. A diagonal token is generated based on the local feature map of the matrix. The diagonal token is used to characterize the numerical prior information of the diagonal region in the coefficient matrix. The matrix token, the right-end term token, and the diagonal token are input into the Transformer encoder. The internal structure of the matrix, the characteristics of the right-end term, and the interaction between the matrix and the right-end term are explicitly modeled through a multi-head self-attention mechanism to obtain the global token. Based on the global token and the local feature map, the global context information in the global token is fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
[0031] In an optional embodiment of the present invention, generating diagonal tokens based on the local feature map of the matrix includes: Construct a diagonal mask, extract features corresponding to the diagonal region of the original matrix from the local feature map of the matrix based on the diagonal mask, input the extracted features into a multilayer perceptron for processing, and obtain the diagonal token.
[0032] This embodiment uses a diagonally-enhanced tokenizer to generate the matrix, RHS, and diagonal tokens. Specifically, the generation of the matrix and RHS tokens employs an attention-based mechanism, using a learnable projection matrix to transform the feature map... and Clustered into a compact sequence of semantic tokens. and The generation of diagonal tokens is based on numerical analysis priors (Gerschgöring's disk theorem), where the diagonal elements of the matrix dominate the eigenvalue distribution. Specifically, a diagonal mask is constructed, and feature maps are extracted. The features corresponding to the diagonal region of the original matrix are used to generate explicit diagonal tokens through MLP processing. This token serves as an inductive bias, guiding the model to focus on key structures.
[0033] Next, the concatenated token sequence [ ; ; The input is a Transformer encoder, which uses a multi-head self-attention mechanism to explicitly model the internal structure of the matrix, the RHS properties, and the interaction between the matrix and the RHS. It acts as an anchor point, strengthening the interaction between features and numerical priors.
[0034] Finally, a projector is used to map the global token back to the pixel-level feature space. Specifically, a reverse attention mechanism is employed, using the initial feature map... / For querying, the processed global token is used as the key to calculate weighted features and then fused back into the original feature map using residual connections to generate a refined feature map. and .
[0035] In an optional embodiment of the present invention, based on the refined matrix feature map and the refined right-hand side feature map, a target iterative method suitable for solving the sparse linear system is predicted, including: The refined matrix feature map and the refined right-hand term feature map are flattened and then concatenated to generate a comprehensive feature vector. The comprehensive feature vector is input into a multilayer perceptron to calculate the probability distribution of each candidate iterative method; The candidate iteration method with the highest probability is determined as the target iteration method.
[0036] This embodiment maps refined features, which integrate global context and local details, to the predicted probabilities of each candidate iterative method, thereby determining the optimal solution strategy. The specific structure and processing flow are as follows: Feature flattening and concatenation: First, the refined two-dimensional matrix feature map is flattened and concatenated. And one-dimensional refined right-hand term feature map Each feature vector is flattened and converted into a one-dimensional feature vector. Then, the two feature vectors are concatenated along the channel dimension to form a comprehensive feature vector containing information about the entire system.
[0037] Multilayer Perceptron (MLP) processing: The concatenated feature vectors are input into a multilayer perceptron network. This network specifically includes: The first fully connected layer maps high-dimensional integrated features to a low-dimensional hidden space to compress features and extract higher-order semantics.
[0038] Activation function: The ReLU activation function is used to introduce nonlinear factors.
[0039] Regularization layer: Sets the dropout rate to prevent overfitting and enhance generalization ability.
[0040] Output layer: Maps the hidden layer features to a dimension of 1. The output vector of , where The total number of predefined candidate iterative methods (solver-preprocessor operator pairs).
[0041] Output: Output one A vector representing the probability distribution (or confidence score) that each candidate iterative method becomes the optimal solution for the current sparse linear system. The system selects the iterative method corresponding to the index with the highest probability value as the final recommendation.
[0042] In an alternative embodiment of the present invention, the first convolutional neural network and / or the second convolutional neural network are variants of residual networks or efficient networks.
[0043] This invention can replace and enhance the feature extraction backbone network, that is, the original CNN backbone can be replaced with a variant of ResNet or EfficientNet to extract deeper local features without significantly increasing the computational cost.
[0044] In an optional embodiment of the present invention, the multi-head self-attention mechanism is a standard multi-head self-attention mechanism, a linear attention mechanism, or a window-based attention mechanism.
[0045] This embodiment can optimize the Transformer attention mechanism. To reduce computational complexity, the standard multi-head self-attention can be replaced with linear attention or window-based attention.
[0046] In an optional embodiment of the present invention, global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand side, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand side feature map, further comprising: Obtain tokens from at least two different layers in the Transformer encoder, fuse the tokens from the at least two different layers, and generate a multi-scale token; Based on the multi-scale token, the global token, and the local feature map, the context information of the multi-scale token and the global context information in the global token are fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
[0047] In addition to fusing global and local features, this invention can also perform multi-scale feature fusion. In the projector stage, besides fusing the output of the last Transformer layer, it can also fuse token features from intermediate layers to form a structure similar to a Feature Pyramid Network (FPN), thereby utilizing both low-level and high-level semantic information simultaneously.
[0048] The present invention has the following technical effects: 1. This invention introduces a five-channel image encoding of the right-hand side (RHS) for the first time in image-based iterative method selection, and proposes an extended channel encoding scheme that includes peaks and valleys, achieving full system representation. This scheme overcomes the deficiency of existing technologies that ignore the RHS. By jointly analyzing the matrix and the RHS, the model can distinguish the optimal solution strategy for the same matrix under different RHSs (such as smoothing and oscillation). At the same time, the P and V channels retain the numerical extremum information within the matrix block, solving the numerical distortion problem of RGB encoding, enabling the model to distinguish matrix blocks with the same mean but different distributions. Experimental data shows that in real-world scenarios with varying RHS, this scheme improves the selection accuracy by approximately 18.7% compared to traditional CNN methods.
[0049] 2. This invention proposes a Diagonal Enhancement Transformer (DET) architecture based on numerical priors. This architecture combines local features of CNNs with global features of Transformers and includes a specially designed tokenizer containing explicit diagonal tokens. This architecture solves the problem of global dependency ambiguity in CNNs, enabling the attention mechanism to capture global features of the matrix (such as convection dominance). Simultaneously, by utilizing the numerical prior of the Gellshgorin disk theorem, the diagonal tokens guide the model to focus on key regions that determine the system's feature values, significantly improving the model's generalization ability and robustness. Data support shows that, compared to using CNNs alone, introducing the DET module improves selection accuracy by approximately 3.7% under fixed RHS settings.
[0050] Combining the above advantages, this invention achieves significant computational speedup and improved generalization ability in practical applications. On the variable RHS dataset, the computational speedup reaches 7.36 times, far exceeding the 4.58 times of the current state-of-the-art methods. Furthermore, when dealing with large-scale sparse linear systems outside the training data distribution, this invention exhibits superior generalization stability.
[0051] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0052] An iterative intelligent selection system for sparse linear systems provided in this embodiment of the invention may specifically include: An extended channel encoding module is used to receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and to perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data. A feature extraction backbone network is used to extract local features from the matrix image data and the right-end term image data respectively, to obtain matrix local feature maps and right-end term local feature maps; The diagonal enhancement Transformer module is used to perform global interactive modeling on the local feature map of the matrix and the local feature map of the right-hand term, and to fuse the result of the global interactive modeling with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. The classification prediction head module is used to predict the target iterative method suitable for solving the sparse linear system based on the refined matrix feature map and the refined right-hand term feature map.
[0053] In an optional embodiment of the present invention, the extended channel encoding module is further configured to: The coefficient matrix is divided into multiple matrix blocks, and multi-channel encoded values, including at least RGB channels, peak channels, and valley channels, are calculated for each matrix block to generate two-dimensional matrix image data. The right-hand item is divided into multiple one-dimensional segments, and a multi-channel encoded value, including at least the mean channel, peak channel, and valley channel, is calculated for each one-dimensional segment to generate one-dimensional image data of the right-hand item.
[0054] In an optional embodiment of the present invention, the feature extraction backbone network is further used for: The matrix image data is processed by a first convolutional neural network to extract features, resulting in a local feature map of the matrix. The right-end item image data is processed by a second convolutional neural network to extract features, thereby obtaining the local feature map of the right-end item.
[0055] In an optional embodiment of the invention, the diagonally enhanced Transformer module is further configured to: The local feature map of the matrix and the local feature map of the right-hand term are tokenized to generate matrix tokens and right-hand term tokens. A diagonal token is generated based on the local feature map of the matrix. The diagonal token is used to characterize the numerical prior information of the diagonal region in the coefficient matrix. The matrix token, the right-end term token, and the diagonal token are input into the Transformer encoder. The internal structure of the matrix, the characteristics of the right-end term, and the interaction between the matrix and the right-end term are explicitly modeled through a multi-head self-attention mechanism to obtain the global token. Based on the global token and the local feature map, the global context information in the global token is fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
[0056] In an optional embodiment of the present invention, the classification prediction head module is further configured to: The refined matrix feature map and the refined right-hand term feature map are flattened and then concatenated to generate a comprehensive feature vector. The comprehensive feature vector is input into a multilayer perceptron to calculate the probability distribution of each candidate iterative method; The candidate iteration method with the highest probability is determined as the target iteration method.
[0057] In an alternative embodiment of the present invention, the first convolutional neural network and / or the second convolutional neural network are variants of residual networks or efficient networks.
[0058] In an optional embodiment of the present invention, the multi-head self-attention mechanism is a standard multi-head self-attention mechanism, a linear attention mechanism, or a window-based attention mechanism.
[0059] In an optional embodiment of the invention, the diagonally enhanced Transformer module is further configured to: Obtain tokens from at least two different layers in the Transformer encoder, fuse the tokens from the at least two different layers, and generate a multi-scale token; Based on the multi-scale token, the global token, and the local feature map, the context information of the multi-scale token and the global context information in the global token are fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
[0060] In an optional embodiment of the invention, the diagonally enhanced Transformer module is further configured to: Construct a diagonal mask, extract features corresponding to the diagonal region of the original matrix from the local feature map of the matrix based on the diagonal mask, input the extracted features into a multilayer perceptron for processing, and obtain the diagonal token.
[0061] The modular architecture and module functions of the iterative intelligent selection system for sparse linear systems are as follows: 1. Expanded-Channel Encoding Module: Function: Resolves numerical distortion problems.
[0062] Implementation: In addition to the traditional RGB channels (which encode the average magnitude, density, and matrix size of non-zero elements respectively), a peak channel (P) and a valley channel (V) are added.
[0063] P channel: Encodes the maximum value of the non-zero elements within the matrix block corresponding to each pixel.
[0064] V channel: Encodes the minimum non-zero element within the matrix block corresponding to each pixel.
[0065] RHS encoding: The right-hand side is encoded using a five-channel method similar to that of a matrix, dividing it into one-dimensional segments. The R, G, B, P, and V values of each segment are calculated to generate a one-dimensional five-channel image, thus achieving full system representation.
[0066] 2. Feature Extraction Backbone Network (CNN Backbone): Function: Capture local textures and high-frequency features.
[0067] Implementation: Includes matrix branches (2D convolution) and RHS branches (1D convolution). Through multiple convolutional layers, ReLU activation, and max pooling operations, high-resolution inputs are mapped to low-resolution, high-dimensional feature maps. and .
[0068] 3. Diagonal Enhancement Transformer Module (DET Module): Figure 4 This is a detailed structural diagram of the Diagonal Enhanced Transformer (DET) module. (a) shows how the Diagonal Enhanced Tokenizer generates matrix tokens, RHS tokens, and diagonal tokens; (b) shows how the projector fuses features through a reverse attention mechanism.
[0069] (1) Diagonally-Enhanced Tokenizer: Matrix / RHS token generation: Employs an attention-based mechanism, using a learnable projection matrix to generate feature maps. and Clustered into a compact sequence of semantic tokens and .
[0070] Diagonal Token Generation: Based on numerical analysis priors (Gerschgöring's disk theorem), the diagonal elements of the matrix dominate the eigenvalue distribution. A diagonal mask is constructed to extract the feature map. The features corresponding to the diagonal region of the original matrix are used to generate explicit diagonal tokens through MLP processing. This token serves as an inductive bias, guiding the model to focus on key structures.
[0071] (2) Transformer encoder: Input: The concatenated token sequence [ ; ; ].
[0072] Mechanism: Utilizing a multi-head self-attention mechanism, the internal structure of the matrix, RHS properties, and the interaction between the matrix and RHS are explicitly modeled. It acts as an anchor point, strengthening the interaction between features and numerical priors.
[0073] (3) Projector: Function: Maps global tokens back to pixel-level feature space.
[0074] Implementation: A reverse attention mechanism is used, with the initial feature map... / For querying, the processed global token is used as the key to calculate weighted features and then fused back into the original feature map using residual connections to generate a refined feature map. and .
[0075] 4. Classification Head Module: Function: The refined features output by the DET module, which integrate global context and local details, are mapped to the predicted probabilities of each candidate iterative method, thereby determining the optimal solution strategy.
[0076] Input: Refined matrix feature map from the projector output. And refined right-end feature map .
[0077] Structure and processing flow: Feature flattening and concatenation: First, the refined two-dimensional matrix feature map is flattened and concatenated. And a one-dimensional refined right-hand term feature map Each feature vector is flattened and converted into a one-dimensional feature vector. Then, the two feature vectors are concatenated along the channel dimension to form a comprehensive feature vector containing information about the entire system.
[0078] Multilayer Perceptron (MLP) processing: The concatenated feature vectors are input into a multilayer perceptron network. This network specifically includes: The first fully connected layer maps high-dimensional integrated features to a low-dimensional hidden space to compress features and extract higher-order semantics.
[0079] Activation function: The ReLU activation function is used to introduce nonlinear factors.
[0080] Regularization layer: Sets the dropout rate to prevent overfitting and enhance generalization ability.
[0081] Output layer: Maps the hidden layer features to a dimension of 1. The output vector of , where The total number of predefined candidate iterative methods (solver-preprocessor operator pairs).
[0082] Output: Output one A vector representing the probability distribution (or confidence score) of each candidate iterative method becoming the optimal solution for the current sparse linear system. The system selects the iterative method corresponding to the index with the highest probability value as the final recommendation.
[0083] As the system implementation is basically similar to the method implementation, it is described in a relatively simple way. For relevant details, please refer to the description of the method implementation.
[0084] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0085] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0086] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. An iterative intelligent selection method for sparse linear systems, characterized in that, The method includes: Receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data; Local feature extraction is performed on the matrix image data and the right-end term image data respectively to obtain the matrix local feature map and the right-end term local feature map; Global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand term, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. Based on the refined matrix feature map and the refined right-hand side feature map, a target iterative method suitable for solving the sparse linear system is predicted.
2. The method according to claim 1, characterized in that, Multi-channel encoding is performed on the coefficient matrix and the right-hand side to generate matrix image data and right-hand side image data, including: The coefficient matrix is divided into multiple matrix blocks, and multi-channel encoded values, including at least RGB channels, peak channels, and valley channels, are calculated for each matrix block to generate two-dimensional matrix image data. The right-hand item is divided into multiple one-dimensional segments, and a multi-channel encoded value, including at least the mean channel, peak channel, and valley channel, is calculated for each one-dimensional segment to generate one-dimensional image data of the right-hand item.
3. The method according to claim 1, characterized in that, Local feature extraction is performed on the matrix image data and the right-hand term image data respectively to obtain matrix local feature maps and right-hand term local feature maps, including: The matrix image data is processed by a first convolutional neural network to extract features, resulting in a local feature map of the matrix. The right-end item image data is processed by a second convolutional neural network to extract features, thereby obtaining the local feature map of the right-end item.
4. The method according to claim 1, characterized in that, Global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand side, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand side feature map, including: The local feature map of the matrix and the local feature map of the right-hand term are tokenized to generate matrix tokens and right-hand term tokens. A diagonal token is generated based on the local feature map of the matrix. The diagonal token is used to characterize the numerical prior information of the diagonal region in the coefficient matrix. The matrix token, the right-end term token, and the diagonal token are input into the Transformer encoder. The internal structure of the matrix, the characteristics of the right-end term, and the interaction between the matrix and the right-end term are explicitly modeled through a multi-head self-attention mechanism to obtain the global token. Based on the global token and the local feature map, the global context information in the global token is fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
5. The method according to claim 1, characterized in that, Based on the refined matrix feature map and the refined right-hand side feature map, a target iterative method suitable for solving the sparse linear system is predicted, including: The refined matrix feature map and the refined right-hand term feature map are flattened and then concatenated to generate a comprehensive feature vector. The comprehensive feature vector is input into a multilayer perceptron to calculate the probability distribution of each candidate iterative method; The candidate iteration method with the highest probability is determined as the target iteration method.
6. The method according to claim 3, characterized in that, The first convolutional neural network and / or the second convolutional neural network are variants of residual networks or efficient networks.
7. The method according to claim 4, characterized in that, The multi-head self-attention mechanism can be a standard multi-head self-attention mechanism, a linear attention mechanism, or a window-based attention mechanism.
8. The method according to claim 4, characterized in that, Global interactive modeling is performed on the local feature map of the matrix and the local feature map of the right-hand side, and the result of the global interactive modeling is fused with the local feature map to obtain a refined matrix feature map and a refined right-hand side feature map, which also includes: Obtain tokens from at least two different layers in the Transformer encoder, fuse the tokens from the at least two different layers, and generate a multi-scale token; Based on the multi-scale token, the global token, and the local feature map, the context information of the multi-scale token and the global context information in the global token are fused back into the pixel-level local feature map through a reverse attention mechanism to obtain the refined matrix feature map and the refined right-hand term feature map.
9. The method according to claim 1, characterized in that, Generate diagonal tokens based on the local feature map of the matrix, including: Construct a diagonal mask, extract features corresponding to the diagonal region of the original matrix from the local feature map of the matrix based on the diagonal mask, input the extracted features into a multilayer perceptron for processing, and obtain the diagonal token.
10. An iterative intelligent selection system for sparse linear systems, characterized in that, The system includes: An extended channel encoding module is used to receive the coefficient matrix and right-hand side terms of the sparse linear system to be solved, and to perform multi-channel encoding on the coefficient matrix and the right-hand side terms to generate matrix image data and right-hand side term image data. A feature extraction backbone network is used to extract local features from the matrix image data and the right-end term image data respectively, to obtain matrix local feature maps and right-end term local feature maps; The diagonal enhancement Transformer module is used to perform global interactive modeling on the local feature map of the matrix and the local feature map of the right-hand term, and to fuse the result of the global interactive modeling with the local feature map to obtain a refined matrix feature map and a refined right-hand term feature map. The classification prediction head module is used to predict the target iterative method suitable for solving the sparse linear system based on the refined matrix feature map and the refined right-hand term feature map.