A method, device, medium and equipment for decentralized optimization of column stochastic communication network
By introducing gradient tracking, normalization, and push-sum weight correction mechanisms into the column random communication network, the estimation bias and parameter instability problems of decentralized optimization in the column random communication network are solved, and more efficient parameter updates and optimization accuracy are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PAZHOU LAB (HUANGPU)
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-10
AI Technical Summary
Existing technologies struggle to effectively apply decentralized optimization methods in stochastic communication networks, leading to estimation bias and convergence errors. Furthermore, traditional stochastic gradient descent methods suffer from unstable parameter updates, reduced convergence speed, and even divergence in non-convex models.
We introduce gradient tracking, gradient normalization, and push-sum weight correction mechanisms, and combine them with local stochastic gradient calculation and communication matrix to optimize the parameter update process.
It improves the accuracy and stability of decentralized optimization in column random communication networks, reduces the impact of estimation bias and heavy-tailed stochastic gradients, and enhances the stability and convergence speed of parameter updates.
Smart Images

Figure CN122372441A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a decentralized optimization method, apparatus, medium, and device for a random communication network. Background Technology
[0002] With the increasing demand for large-scale data processing, distributed machine learning and decentralized optimization technologies are widely used in scenarios such as federated learning, edge computing, wireless sensor networks, and smart manufacturing. In these scenarios, data is typically stored across multiple computing nodes, which collaborate through communication networks to complete model training or optimization tasks, thereby reducing the privacy risks and communication bottlenecks associated with centralized processing.
[0003] However, existing technologies still have the following problems. First, actual communication networks are usually directed topologies, and their corresponding communication weight matrices are mostly column random matrices or row random matrices, rather than double random matrices. This makes it difficult to directly apply traditional decentralized optimization methods based on double random matrices, which are prone to estimation bias and convergence error. Second, the stochastic gradients obtained by sampling small batches of data during machine learning training are often affected by factors such as data heterogeneity, non-independent and identically distributed, and non-convex model structures. As a result, traditional decentralized stochastic gradient descent methods suffer from unstable parameter updates, reduced convergence speed, and even divergence. Summary of the Invention
[0004] The purpose of this invention is to propose a decentralized optimization method, apparatus, medium, and device for column random communication networks. By introducing a gradient tracking mechanism, a gradient normalization processing mechanism, and a push-sum weight correction mechanism into the decentralized optimization method, the optimization accuracy and stability of the decentralized optimization method in column random communication networks and stochastic gradient heavy-tailed distribution scenarios are improved.
[0005] To achieve the above objectives, a first aspect of the present invention provides a decentralized optimization method for a column random communication network, the method comprising: S1: Based on the preset optimization accuracy of the objective function, calculate the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node required to optimize the objective function in the target communication network; and initialize the local model parameters of each communication node in the target communication network to obtain the current model parameters of each communication node. S2: Based on the number of sample samplings, random sampling is performed from the local dataset of each communication node, and based on the sampling results of each communication node and the current model parameters of each communication node, the local stochastic gradient of each communication node is calculated accordingly. S3: Update the gradient tracking variable based on the local stochastic gradient, and normalize the updated gradient tracking variable to obtain the normalized gradient direction; S4: Based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix, update the current model parameters of each communication node; S5: Based on the Push-sum weight update mechanism, correct the current model parameters of each of the communication nodes after the update; S6: Repeat S2 to S5 until the current iteration reaches the total number of iterations.
[0006] In this embodiment, by combining local stochastic gradient calculation, gradient tracking, normalized update, and push-sum correction, a decentralized optimization process suitable for column-random communication networks is constructed. This reduces the estimation bias caused by column-random communication in decentralized optimization schemes and suppresses update fluctuations caused by heavy-tailed stochastic gradients, thereby improving the accuracy and stability of non-convex optimization in complex network environments.
[0007] Furthermore, the step of calculating the fixed step size, the number of communication rounds per iteration, the total number of iterations, and the number of sample samplings at each communication node required to optimize the objective function based on the preset optimization accuracy of the objective function includes: Based on the optimization accuracy and the smoothness coefficient of the objective function, calculate the fixed step size required to optimize the objective function; The number of sample samplings for each communication node is calculated based on the number of communication nodes, the upper bound constant of the stochastic gradient noise, the order of the moments, and the optimization accuracy. The total number of iterations is calculated based on the optimization accuracy, the smoothness coefficient, and the initial optimality gap of the objective function. The number of communication rounds in a single iteration is calculated based on the spectral gaps of the communication matrix corresponding to the target communication network.
[0008] In this embodiment, the fixed step size, number of sample samplings, total number of iterations, and number of communication rounds are associated with optimization accuracy, smoothness coefficient, noise intensity, initial optimality gap, and communication matrix spectrum gap, respectively. This achieves a balance between computational overhead, sampling overhead, and communication overhead, improves the rationality of parameter settings, and thus accelerates the optimization convergence speed and improves optimization accuracy.
[0009] Further, the decentralized optimization method for a stochastic communication network as described in claim 1, characterized in that, based on the number of sample samplings, random sampling is performed from the local datasets of each of the communication nodes, and based on the sampling results of each of the communication nodes and the current model parameters of each of the communication nodes, the local stochastic gradient of each communication node is calculated accordingly, including: S21: Randomly select a preset number of samples from the local dataset of each of the communication nodes to obtain the sample set corresponding to each of the communication nodes; S22: Calculate the sample stochastic gradient corresponding to each communication node based on the current model parameters of each communication node and each sample in the corresponding sample set; Repeat S21~S22 until the number of executions reaches the number of sample samplings, and each execution corresponds to a set of sample random gradients for each of the communication nodes; The local stochastic gradient of each communication node is obtained by averaging the stochastic gradients of all samples corresponding to each communication node.
[0010] In this embodiment, by performing multiple random samplings and averaging the sample stochastic gradients, the impact of single sampling fluctuations and outliers on local gradient estimation can be reduced, improving the stability of local stochastic gradients and providing reliable gradient inputs for subsequent gradient tracking and parameter updates.
[0011] Further, the step of updating the gradient tracking variable based on the local stochastic gradient and normalizing the updated gradient tracking variable to obtain the normalized gradient direction includes: Obtain the first local stochastic gradient corresponding to the current round and the second local stochastic gradient corresponding to the previous round for each of the communication nodes; Calculate the gradient difference between the first local stochastic gradient and the second local stochastic gradient; Based on the gradient difference and the gradient tracking variables received by each communication node from other communication nodes, the gradient tracking variables of each communication node are updated. The gradient tracking variables of each of the communication nodes are normalized to obtain the normalized gradient direction of each communication node.
[0012] In this embodiment, by combining the difference between the local stochastic gradients of the current round and the previous round, as well as gradient tracking variables transmitted from other communication nodes, the global gradient change trend can be continuously tracked. At the same time, normalization processing is used to weaken the impact of abnormally large gradients on the update amplitude, thereby improving the gradient tracking accuracy and the parameter update speed.
[0013] Further, updating the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix includes: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters of each communication node after multiple rounds of communication, the fixed step size, and the normalized gradient direction, the current model parameters of each communication node are updated to obtain the updated current model parameters.
[0014] In this embodiment, by performing multiple rounds of weighted fusion based on the communication matrix before parameter updates, the propagation and mixing of model information between nodes can be enhanced, the dispersion of parameters of each node can be reduced, and parameter updates can be based on more sufficient network interaction, thereby improving the consistency and applicability of decentralized optimization.
[0015] Furthermore, the step of correcting the current model parameters of each communication node based on the Push-sum weight update mechanism includes: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters, the weight variables of each communication node are summed in a weighted manner to obtain the updated weight variables of each communication node. Based on the updated weight variables of each communication node, the updated current model parameters of each communication node are corrected.
[0016] In this embodiment, by introducing a Push-sum weight update and parameter correction mechanism, the asymmetric influence introduced by the column random communication matrix is compensated, which can reduce the estimation bias under the directed communication topology and make the model parameters of each node closer to the unbiased global optimization direction, thereby improving the convergence accuracy and stability under the column random communication network.
[0017] To achieve the above objectives, a second aspect of the present invention further provides a decentralized optimization apparatus for a column random communication network, used to implement the decentralized optimization method for a column random communication network as described in any of the first aspects, the apparatus comprising: The parameter initialization module is used to calculate, based on the preset optimization accuracy of the objective function, the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node in the target communication network; and to initialize the local model parameters of each communication node in the target communication network to obtain the current model parameters of each communication node. The sampling gradient calculation module is used to randomly sample from the local dataset of each of the communication nodes based on the number of sample samplings, and calculate the local stochastic gradient of each communication node based on the sampling results of each communication node and the current model parameters of each communication node. The normalized gradient direction calculation module is used to update the gradient tracking variable based on the local stochastic gradient and normalize the updated gradient tracking variable to obtain the normalized gradient direction. The model parameter update module is used to update the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix. The model parameter correction module is used to correct the current model parameters of each of the communication nodes after the update based on the Push-sum weight update mechanism.
[0018] A third aspect of the present invention also provides a computer-readable storage medium comprising a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform a decentralized optimization method for a random communication network as described in any of the first aspects.
[0019] A fourth aspect of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a decentralized optimization method for a random communication network as described in any of the first aspects above.
[0020] The fifth aspect of the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a decentralized optimization method for a random communication network as described in any of the first aspects above. Attached Figure Description
[0021] Figure 1 This is a flowchart of a preferred embodiment of a decentralized optimization method for a random communication network provided in the first aspect of the present invention; Figure 2 This is a structural block diagram of a preferred embodiment of a decentralized optimization device for a random communication network provided in the second aspect of the present invention; Figure 3 This is a structural block diagram of a preferred embodiment of a terminal device provided in the fourth aspect of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] It should be noted that the data involved in this invention (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0024] In this embodiment of the invention, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplarily" or "for example" in this invention should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.
[0025] In this invention description, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In this invention description, unless otherwise stated, "a plurality of" means two or more. In this invention description, the term "comprising" and its variations are open-ended, meaning "including but not limited to." The term "based on" means "at least partially based on." The term "according to" means "at least partially according to." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments."
[0026] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0027] In the description of this invention, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0028] A first aspect of this invention provides a decentralized optimization method for a column random communication network, see below. Figure 1 The diagram shown is a flowchart of a preferred embodiment of a decentralized optimization method for a random communication network provided in the first aspect of the present invention. The method includes steps S1 to S6, as follows: S1: Based on the preset optimization accuracy of the objective function, calculate the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node required to optimize the objective function in the target communication network; and initialize the local model parameters of each communication node in the target communication network to obtain the current model parameters of each communication node. S2: Based on the number of sample samplings, random sampling is performed from the local dataset of each communication node, and based on the sampling results of each communication node and the current model parameters of each communication node, the local stochastic gradient of each communication node is calculated accordingly. S3: Update the gradient tracking variable based on the local stochastic gradient, and normalize the updated gradient tracking variable to obtain the normalized gradient direction; S4: Based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix, update the current model parameters of each communication node; S5: Based on the Push-sum weight update mechanism, correct the current model parameters of each of the communication nodes after the update; S6: Repeat S2 to S5 until the current iteration reaches the total number of iterations.
[0029] In one example, the target communication network includes multiple communication nodes that interact with each other via directed communication links, forming a stochastic communication network. Each communication node can correspond to a server, edge computing device, terminal device, computing board, virtual computing instance, or other node with data processing and communication capabilities. Data from each communication node is stored in a local database, and the local processing unit samples, calculates, and updates the parameters of the local data.
[0030] Specifically, the server determines the fixed step size, the number of communication rounds per iteration, the total number of iterations, and the number of sample samplings based on the optimization accuracy of the preset objective function, the network characteristics of the target communication network, and the optimization requirements of the objective function, according to the processors in each communication node. Then, each communication node initializes its corresponding local model parameters to obtain the initial model parameters for each communication node.
[0031] Furthermore, each communication node randomly samples from its local dataset according to the stated number of sample samplings, obtaining its own corresponding sampling result. Then, each communication node calculates its corresponding local stochastic gradient based on its current model parameters and its sampling result. Further, each communication node updates its gradient tracking variable based on its corresponding local stochastic gradient, combining this with the local stochastic gradient information from the current round. After the update, each communication node further normalizes its corresponding gradient tracking variable to obtain its corresponding normalized gradient direction. In this way, each communication node can generate direction information more suitable for subsequent parameter updates while only performing inter-node variable interactions.
[0032] Furthermore, each communication node updates its current model parameters based on the normalized gradient direction, fixed step size, communication rounds, and a preset communication matrix. Specifically, each communication node interacts with other communication nodes according to the weight relationships between nodes represented by the communication matrix, and performs sub-parameter fusion for each communication round to obtain the corresponding weighted model parameters. Then, each communication node updates its current model parameters based on its corresponding weighted model parameters, fixed step size, and normalized gradient direction.
[0033] Furthermore, each communication node further modifies the updated current model parameters based on the Push-sum weight update mechanism. Then, each communication node modifies its own updated current model parameters according to the updated weight variables to reduce the parameter bias caused by asymmetric information propagation in the column random communication network.
[0034] In each iteration, each communication node resamples samples, calculates local stochastic gradients, updates gradient tracking variables, constructs normalized gradient directions, updates model parameters, and corrects push-sum weights until the current iteration reaches the total number of iterations, and then outputs the optimization result that meets the preset conditions.
[0035] It should be noted that the local dataset can be structured data, unstructured data, sensor-collected data, log data, or other data sets suitable for participating in optimization calculations, and the present invention does not limit it in this regard.
[0036] It should be noted that the random sampling can be sampling with replacement, sampling without replacement, uniform sampling, stratified sampling, or other random selection methods. The number of sampling times and the number of samples selected in each sampling can be flexibly set according to application requirements, and the present invention does not limit this.
[0037] It should be noted that the communication matrix can be a column random matrix, and the weight coefficients in the communication matrix are used to characterize the information transmission relationship and information fusion ratio between each communication node. The communication matrix can be a fixed matrix or a matrix that changes over time, and the present invention does not limit it in this regard.
[0038] It is understood that the gradient tracking variable is used to fuse local gradient information among various communication nodes in order to approximate the global gradient change trend; the normalization process is used to reduce the impact of abnormal fluctuations in gradient magnitude on parameter updates, so that model parameter updates depend more on gradient direction information.
[0039] It is understood that the Push-sum weight update mechanism can be used to correct the accumulated bias caused by directed topology and asymmetric information interaction in column random communication networks, so that the updated model parameters of each communication node are closer to the target optimization direction.
[0040] In this embodiment, by combining local stochastic gradient calculation, gradient tracking variable update, normalized gradient direction construction, model parameter update based on the communication matrix, and push-sum weight correction in a column stochastic communication network, collaborative optimization among multiple communication nodes can be achieved under the condition of no central node. This reduces the estimation bias introduced by the column stochastic communication matrix and reduces the impact of stochastic gradient fluctuations, especially heavy-tailed stochastic gradients, on the stability of parameter updates. As a result, the convergence speed and optimization accuracy of decentralized optimization methods in complex directed communication network environments are improved.
[0041] In another preferred embodiment, the step of calculating the fixed step size, the number of communication rounds per iteration, the total number of iterations, and the number of sample samplings at each communication node required to optimize the objective function based on the preset optimization accuracy of the objective function includes: Based on the optimization accuracy and the smoothness coefficient of the objective function, calculate the fixed step size required to optimize the objective function; The number of sample samplings for each communication node is calculated based on the number of communication nodes, the upper bound constant of the stochastic gradient noise, the order of the moments, and the optimization accuracy. The total number of iterations is calculated based on the optimization accuracy, the smoothness coefficient, and the initial optimality gap of the objective function. The number of communication rounds in a single iteration is calculated based on the spectral gaps of the communication matrix corresponding to the target communication network.
[0042] In one example, the target communication network includes There are 1 communication node, and the communication weight matrix corresponding to the communication network is: ,in Let be a columnar random matrix. Suppose the objective function is a distributed non-convex stochastic optimization problem: in, Let ] be the local objective function of node i, defined in random variable Under the induced distribution, it may be a non-convex function; This represents the vector of model parameters to be optimized. The dimension of the parameter space; The global objective function is the average of the local functions of all nodes. This represents the total number of nodes participating in distributed optimization. Indicates the node index. ; Indicates the first The local objective function of each node; Represents the relationship between random variables Mathematical expectation operation; Represents a node random variables; Represents a node Given a random sample The corresponding random loss function; Represents a node The local objective function is its random loss function in random variables. The expected value under the corresponding distribution.
[0043] In this example, accuracy can be optimized based on a preset objective function. Determine the fixed step size respectively Number of sample samplings Total number of iterations and the number of communication rounds in a single iteration : in, To maintain a fixed step size, The smoothness coefficient, To optimize the accuracy of problem solving, For the initial optimality gap, This is an upper bound constant for the random gradient noise. Let be the order of the moment. For the spectral gaps of the communication matrix, For the number of nodes, This represents the total number of iterations. This refers to the number of communication rounds in a single iteration.
[0044] In some implementations, the convergence of the algorithm corresponding to the above parameter configuration can be verified under the above preset conditions to obtain the upper bound of sampling complexity and the upper bound of communication complexity.
[0045] Optionally, under preset conditions, the convergence of the sampling method is verified to obtain an upper bound on the sampling complexity and an upper bound on the communication complexity; wherein, the upper bound on the sampling complexity is... The upper bound of the communication complexity is .
[0046] The detailed derivation process for obtaining the upper bounds of the sampling complexity and communication complexity is as follows: make The parameter variable represents the average. Let uppercase letters denote matrices formed by stacking the corresponding vectors, for example, , Define Lyapunov functions. ,in, and Represents the consistency error term. It is a weight vector.
[0047] According to f - Smoothness, for any 1. The following inequalities hold: .
[0048] We consider the second term in the above formula. Given an upper bound, the following inequality holds: For the third term in the above formula ,because The modulus of is 1, so the upper bound of the third term is . In summary, we have: Next, we will examine the error between the gradient tracking variable and the true global gradient. Given an upper bound estimate, we have Next, we will examine the consistency error term. Give an upper bound estimate. Let ,in It refers to the degree of imbalance in a balanced distribution. Furthermore, we examine the consistency error term of the gradient tracking variable. Given an upper bound: We can The recurrence relation is estimated as follows: The number of communications is satisfied in each iteration. There will be For ,have: From the Lyapunov function recurrence relation described above, we can estimate the average gradient norm: The Lyapunov function difference in the above formula It can be controlled by the following upper bounds: in, For the last item, we have: The validity of the inequality sign is determined by the following parameter selection method: .
[0049] Therefore, the expected value of the average gradient norm is: Ultimately, the sampling complexity of the algorithm has an upper bound: The complexity of communication has an upper bound: It should be noted that the fixed step size Number of sample samplings Total number of iterations and communication rounds The expression is not limited to the specific order of magnitude mentioned above, and can be adaptively adjusted according to different task scenarios, computing resource constraints, or network bandwidth conditions. This invention does not limit this.
[0050] It is understandable that by associating the fixed step size with the smoothness coefficient and optimization accuracy, associating the number of sample samplings with the number of nodes, noise intensity and moment order, associating the total number of iterations with the initial optimality gap, and associating the number of communication rounds with the spectral gap, various operating parameters can be adapted to the characteristics of the objective function, the characteristics of stochastic gradient noise and the characteristics of the communication network.
[0051] In this embodiment, the fixed step size, number of sample samplings, total number of iterations, and number of communication rounds are associated with optimization accuracy, smoothness coefficient, noise intensity, initial optimality gap, and communication matrix spectrum gap, respectively. This achieves a balance between computational overhead, sampling overhead, and communication overhead, improves the rationality of parameter settings, and thus accelerates the optimization convergence speed and improves optimization accuracy.
[0052] In another preferred embodiment, the step of randomly sampling from the local dataset of each communication node based on the number of sample samplings, and calculating the local stochastic gradient of each communication node based on the sampling results of each communication node and the current model parameters of each communication node, includes: S21: Randomly select a preset number of samples from the local dataset of each of the communication nodes to obtain the sample set corresponding to each of the communication nodes; S22: Calculate the sample stochastic gradient corresponding to each communication node based on the current model parameters of each communication node and each sample in the corresponding sample set; Repeat S21~S22 until the number of executions reaches the number of sample samplings, and each execution corresponds to a set of sample random gradients for each of the communication nodes; The local stochastic gradient of each communication node is obtained by averaging the stochastic gradients of all samples corresponding to each communication node.
[0053] In one example, the first During each round of iteration, each communication node constructs a batch stochastic gradient matrix for all nodes based on its current model parameters and random samples in its local dataset. : in, For the first The gradient of the random loss function for each communication node with respect to the model parameters. For the first In the first iteration Each communication node is used for model parameters in gradient calculation. For sampling batch size, For the first During the first iteration The selected communication node is the first A random sample.
[0054] Specifically, no. In a single sampling, each communication node can first randomly select a preset number of samples from its local dataset to form a sample set; then, it can set the current model parameters... Input random loss function to each sample in the sample set The stochastic gradients of the corresponding samples are calculated for each sample. Finally, the stochastic gradients of the samples obtained in this sampling are averaged to obtain a set of stochastic gradient estimates for the node in this sampling. Then, the above sampling process is repeated until the number of times the sample sampling is reached, and the stochastic gradient estimates obtained in each sampling are averaged to obtain the local stochastic gradient of the node.
[0055] It should be noted that the number of samples in the sample set can be multiple samples or small batches of samples.
[0056] It is understandable that by performing multiple random samplings and averaging the corresponding sample stochastic gradients, the impact of random fluctuations in a single sampling result on local stochastic gradient estimation can be reduced.
[0057] In this embodiment, by performing multiple random samplings at each communication node and averaging the corresponding sample stochastic gradients, the stability of local stochastic gradient estimation can be improved, the interference of abnormal samples and local data heterogeneity on single-round gradient estimation can be reduced, and more reliable gradient input can be provided for subsequent gradient tracking variable updates.
[0058] In yet another preferred embodiment, the step of updating the gradient tracking variable based on the local stochastic gradient and normalizing the updated gradient tracking variable to obtain the normalized gradient direction includes: The first local stochastic gradient corresponding to the current round and the second local stochastic gradient corresponding to the previous round are obtained for each of the communication nodes respectively; Calculate the gradient difference between the first local stochastic gradient and the second local stochastic gradient; Based on the gradient difference and the gradient tracking variables received by each communication node from other communication nodes, the gradient tracking variables of each communication node are updated. The gradient tracking variables of each of the communication nodes are normalized to obtain the normalized gradient direction of each communication node.
[0059] In one example, each communication node at the 1st During round iteration, based on the batch stochastic gradient of the current round The previous round of batch stochastic gradients and the gradient tracking variables from the previous round Update the gradient tracking variables for the current round. : in, The communication matrix corresponding to the target communication network. For a single iteration of communication rounds, For the first Gradient tracking variables in rounds of iterations, This represents the difference between the current batch stochastic gradient and the previous batch stochastic gradient.
[0060] After updating, obtain the gradient tracking variable. Then, it is further normalized to obtain the normalized gradient direction. For the th... There are 1 communication node, and its local gradient tracking vector is denoted as . Then the corresponding normalized gradient direction can be expressed as: in, Represents the vector norm.
[0061] It should be noted that the normalization process is not limited to the form of direct division of vector norms; any method that can achieve scaling of gradient magnitude is acceptable, and this invention does not impose any limitations on this.
[0062] It should be noted that the above Represents the communication matrix in a single iteration. Continuously acted This corresponds to the execution between each communication node. Local information interaction.
[0063] In this embodiment, by combining the difference between the local stochastic gradients of the current round and the previous round, as well as gradient tracking variables transmitted from other communication nodes, the global gradient change trend can be continuously tracked. At the same time, normalization processing is used to weaken the impact of abnormally large gradients on the update amplitude, thereby improving the gradient tracking accuracy and the parameter update speed.
[0064] In yet another preferred embodiment, updating the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix includes: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters of each communication node after multiple rounds of communication, the fixed step size, and the normalized gradient direction, the current model parameters of each communication node are updated to obtain the updated current model parameters.
[0065] In one example, the local model parameters are updated using the following formula: Among them are The model parameters for the t-th iteration are given, where A is the communication weight matrix and K is the number of communications in a single iteration. For fixed step size.
[0066] It should be noted that the fixed step size It can be a preset constant or a fixed value pre-calculated based on the current optimization accuracy requirements; the present invention does not limit this.
[0067] It is understandable that by performing K rounds of weighted fusion before executing parameter updates, the model parameters of each communication node can obtain more sufficient information propagation and mixing in the network. Then, the parameter updates are completed by combining the normalized gradient direction, thereby reducing the update deviation caused by the dispersion of model parameters between nodes.
[0068] In this embodiment, by introducing a multi-round communication weighted fusion mechanism before parameter updates, the consistency of model information between nodes can be enhanced, and the updating of the normalized gradient direction can be based on more sufficient network interaction, thereby improving the parameter update effect and the consistency and accuracy of decentralized optimization in the column random communication network.
[0069] In yet another preferred embodiment, the step of correcting the updated current model parameters of each communication node based on the Push-sum weight update mechanism includes: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters, the weight variables of each communication node are summed in a weighted manner to obtain the updated weight variables of each communication node. Based on the updated weight variables of each communication node, the updated current model parameters of each communication node are corrected.
[0070] In one example, each communication node at the 1st During round iteration, the weight vector is maintained synchronously. Based on communication matrix and communication rounds The weight vector can be updated as follows: Then, based on the updated weight vector Construct a diagonal matrix: in, This represents the construction operation of a diagonal matrix with vector elements as diagonal elements and the remaining elements being zero. Furthermore, the updated model parameters are corrected using this diagonal matrix: in, These are the uncorrected model parameters. These are the model parameters after being corrected by the weight update mechanism.
[0071] It is understandable that in a column-random communication network, the communication matrix... Since it only satisfies column randomness but not double randomness, if the model parameters are not further modified, systematic bias may occur between nodes due to the asymmetry of information inflow and outflow. The Push-sum weight update mechanism, by explicitly maintaining the weight variables and using them to normalize the model parameters, can compensate for this bias.
[0072] In this embodiment, by introducing the Push-sum weight variable update and parameter normalization correction process, the asymmetric effects brought about by the column random communication matrix and the directed communication topology can be effectively weakened, so that the model parameters of each communication node are close to the unbiased global optimization direction, thereby improving the convergence accuracy and stability in the column random communication network scenario.
[0073] A second aspect of the present invention provides a decentralized optimization apparatus for a column random communication network, used to implement the decentralized optimization method for a column random communication network described in any of the first aspects above. See also... Figure 2 The diagram shown is a structural block diagram of a preferred embodiment of a decentralized optimization device for a random communication network provided in the second aspect of the present invention. The device includes: The parameter initialization module 11 is used to calculate, based on the preset optimization accuracy of the objective function, the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node in the target communication network; and to initialize the local model parameters of each communication node in the target communication network to obtain the current model parameters of each communication node. The sampling gradient calculation module 12 is used to randomly sample from the local dataset of each of the communication nodes based on the number of sample samplings, and calculate the local stochastic gradient of each communication node based on the sampling results of each communication node and the current model parameters of each communication node. The normalized gradient direction calculation module 13 is used to update the gradient tracking variable based on the local stochastic gradient and normalize the updated gradient tracking variable to obtain the normalized gradient direction. The model parameter update module is used to update the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix. The model parameter correction module 14 is used to correct the current model parameters of each of the communication nodes after the update based on the Push-sum weight update mechanism.
[0074] A third aspect of the present invention also provides a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a routing data plane forwarding table multiplexing method as described in any of the first aspects of the present invention.
[0075] The fourth aspect of the present invention also provides a terminal device, see [link to documentation]. Figure 3 The diagram shown is a structural block diagram of a preferred embodiment of a terminal device provided in the fourth aspect of the present invention. The terminal device includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10. When executing the computer program, the processor 10 implements a decentralized optimization method for a random communication network as described in any of the above embodiments.
[0076] Preferably, the computer program can be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 20 and executed by the processor 10 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0077] The processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor 10 may be any conventional processor. The processor 10 is the control center of the terminal device, connecting various parts of the terminal device through various interfaces and lines.
[0078] The memory 20 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., while the data storage area can store related data, etc. Furthermore, the memory 20 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard drive, a smart media card (SMC), a secure digital card (SD), and a flash card, or other volatile solid-state storage devices.
[0079] It should be noted that the aforementioned terminal device may include, but is not limited to, processors and memory. Those skilled in the art will understand that the above content is merely an example describing the structure of the terminal device and does not constitute a limitation on the structure of the aforementioned terminal device. The aforementioned terminal device may include more or fewer components than those described above, or combine certain components, or different components.
[0080] A fifth aspect embodiment of the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a decentralized optimization method for a random communication network as described in any of the first aspects embodiments above.
[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary hardware platforms, and of course, it can also be implemented entirely by hardware. Based on this understanding, all or part of the technical solution of the present invention that contributes to the background technology can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0082] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A decentralized optimization method for a random communication network, characterized in that, include: S1: Based on the preset optimization accuracy of the objective function, calculate the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node required to optimize the objective function in the target communication network; The local model parameters of each communication node in the target communication network are initialized to obtain the current model parameters of each communication node. S2: Based on the number of sample samplings, random sampling is performed from the local dataset of each communication node, and based on the sampling results of each communication node and the current model parameters of each communication node, the local stochastic gradient of each communication node is calculated accordingly. S3: Update the gradient tracking variable based on the local stochastic gradient, and normalize the updated gradient tracking variable to obtain the normalized gradient direction; S4: Based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix, update the current model parameters of each communication node; S5: Based on the Push-sum weight update mechanism, correct the current model parameters of each of the communication nodes after the update; S6: Repeat S2 to S5 until the current iteration reaches the total number of iterations.
2. The decentralized optimization method for a random communication network as described in claim 1, characterized in that, The step of calculating the fixed step size, the number of communication rounds per iteration, the total number of iterations, and the number of sample samplings at each communication node required to optimize the objective function based on the preset optimization accuracy includes: Based on the optimization accuracy and the smoothness coefficient of the objective function, calculate the fixed step size required to optimize the objective function; The number of sample samplings for each communication node is calculated based on the number of communication nodes, the upper bound constant of the stochastic gradient noise, the order of the moments, and the optimization accuracy. The total number of iterations is calculated based on the optimization accuracy, the smoothness coefficient, and the initial optimality gap of the objective function. The number of communication rounds in a single iteration is calculated based on the spectral gaps of the communication matrix corresponding to the target communication network.
3. The decentralized optimization method for a random communication network as described in claim 1, characterized in that, The step of randomly sampling from the local dataset of each communication node based on the number of sample samplings, and calculating the local stochastic gradient of each communication node based on the sampling results and the current model parameters of each communication node, includes: S21: Randomly select a preset number of samples from the local dataset of each of the communication nodes to obtain the sample set corresponding to each of the communication nodes; S22: Calculate the sample stochastic gradient corresponding to each communication node based on the current model parameters of each communication node and each sample in the corresponding sample set; Repeat S21~S22 until the number of executions reaches the number of sample samplings, and each execution corresponds to a set of sample random gradients for each of the communication nodes; The local stochastic gradient of each communication node is obtained by averaging the stochastic gradients of all samples corresponding to each communication node.
4. The decentralized optimization method for a random communication network as described in claim 1, characterized in that, The step of updating the gradient tracking variable based on the local stochastic gradient and normalizing the updated gradient tracking variable to obtain the normalized gradient direction includes: The first local stochastic gradient corresponding to the current round and the second local stochastic gradient corresponding to the previous round are obtained for each of the communication nodes respectively; Calculate the gradient difference between the first local stochastic gradient and the second local stochastic gradient; Based on the gradient difference and the gradient tracking variables received by each communication node from other communication nodes, the gradient tracking variables of each communication node are updated. The gradient tracking variables of each of the communication nodes are normalized to obtain the normalized gradient direction of each communication node.
5. The decentralized optimization method for a random communication network as described in claim 1, characterized in that, The step of updating the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix includes: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters of each communication node after multiple rounds of communication, the fixed step size, and the normalized gradient direction, the current model parameters of each communication node are updated to obtain the updated current model parameters.
6. The decentralized optimization method for a random communication network as described in claim 1, characterized in that, The Push-sum weight update mechanism corrects the current model parameters of each communication node after the update, including: Based on the communication matrix, the current model parameters of each communication node are weighted and fused in each communication round to obtain the weighted model parameters of each communication node after multiple rounds of communication. Based on the weighted model parameters, the weight variables of each communication node are summed in a weighted manner to obtain the updated weight variables of each communication node. Based on the updated weight variables of each communication node, the updated current model parameters of each communication node are corrected.
7. A decentralized optimization apparatus for a column-based random communication network, used to implement the decentralized optimization method for a column-based random communication network as described in any one of claims 1 to 6, the apparatus comprising: The parameter initialization module is used to calculate, based on the preset optimization accuracy of the objective function, the fixed step size, the number of communication rounds in a single iteration, the total number of iterations, and the number of sample samplings for each communication node required to optimize the objective function in the target communication network. The local model parameters of each communication node in the target communication network are initialized to obtain the current model parameters of each communication node. The sampling gradient calculation module is used to randomly sample from the local dataset of each of the communication nodes based on the number of sample samplings, and calculate the local stochastic gradient of each communication node based on the sampling results of each communication node and the current model parameters of each communication node. The normalized gradient direction calculation module is used to update the gradient tracking variable based on the local stochastic gradient and normalize the updated gradient tracking variable to obtain the normalized gradient direction. The model parameter update module is used to update the current model parameters of each communication node based on the normalized gradient direction, the fixed step size, the number of communication rounds, and the preset communication matrix. The model parameter correction module is used to correct the current model parameters of each of the communication nodes after the update based on the Push-sum weight update mechanism.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a decentralized optimization method for a random communication network as described in any one of claims 1 to 6.
9. A terminal device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements a decentralized optimization method for a random communication network as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements a decentralized optimization method for a random communication network as described in any one of claims 1 to 6.