A distributed stochastic gradient optimization method and system based on an event triggering mechanism
By introducing an event-triggered mechanism into the distributed optimization algorithm, the agent communicates with neighboring nodes only when specific conditions are met, solving the problem of low efficiency in real-time communication, achieving efficient distributed optimization, and improving the robustness and communication efficiency of the system.
Patent Information
- Application Number
- CN202310737415.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-21
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-06-21
AI Technical Summary
Existing distributed optimization algorithms consume a lot of time and resources in real-time communication, resulting in high communication costs and insufficient system robustness, especially inefficient in large-scale data and complex computing environments.
An event-triggered mechanism is adopted, which enables the agent to communicate with neighboring nodes only when specific conditions are met, avoiding real-time communication. By constructing an undirected strongly connected network and setting trigger parameters, the efficiency and robustness of communication between nodes are ensured.
It improves communication efficiency, saves communication costs, enhances the robustness and fault tolerance of the system, and achieves efficient distributed optimization in large-scale data environments.
Smart Images

Figure CN116702925B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine learning and data processing technology, and relates to a distributed stochastic gradient optimization method and system based on an event-triggered mechanism. Background Technology
[0002] In the early days, industrial data was relatively small in quantity and low in dimensionality, with low data scale and computational complexity. Data was often stored on a single agent, and centralized optimization could quickly solve problems. However, with the rapid growth of data volume and the increasing complexity of computational problems, large amounts of data require more computing resources and longer computation times. The performance bottleneck of centralized optimization gradually became apparent, and the corresponding solution efficiency decreased. In practical applications, centralized systems also have the risk of single points of failure; if the central node or computer fails, the entire system may fail. To address these issues, researchers began to turn to distributed optimization algorithms.
[0003] Distributed optimization was proposed to address the increasing scale and computational complexity of data. It leverages the advantages of distributed computing and storage technologies to meet the needs of collaboration and resource sharing in distributed systems, supporting real-time and interactive application scenarios. It provides an efficient, scalable, and parallelizable method for solving large-scale problems. Compared to centralized optimization algorithms that utilize a single node to store and process all data, distributed optimization algorithms rely on communication with neighboring agents to process data, update optimization coefficients, and ultimately obtain the optimization result. This means that each agent in the network only exchanges information with its neighboring agents and only uses its local cost function to process data. In this way, distributed optimization algorithms can avoid the need for large amounts of storage and computation by a single agent. Therefore, distributed optimization algorithms can achieve the same goals as centralized optimization methods in multi-agent networks at a lower cost. Furthermore, nodes do not directly broadcast their raw data but share their processed information, thus distributed optimization also protects information security.
[0004] In recent years, distributed optimization has become an important research area due to its wide range of applications, such as machine learning, control systems, and resource allocation, leading to the proposal of numerous distributed optimization methods. Among these, the most popular is Distributed Gradient Descent (DGD), which, with a decaying step size, can converge to the exact global minimum. Meanwhile, a technique called Gradient Tracking has also attracted significant attention. This technique uses previous gradient information to track the current global gradient, ensuring the stable convergence of the optimization function. Due to its efficiency and ease of use, Gradient Tracking is used in many scenarios. To improve computational efficiency and simulate the state of real networks, distributed stochastic gradient optimization algorithms that incorporate random noise into the gradient have also been proposed. However, these algorithms also have a significant problem: they are all based on real-time communication, meaning communication between nodes occurs in real time. First, this leads to increased communication costs. Second, in real-world networks, real-time communication is difficult to achieve due to differences in the computational capabilities and data flows of individual nodes. Finally, the efficiency of distributed optimization algorithms depends primarily on communication efficiency, not computational efficiency, because in multi-agent networks, exchanging information takes more time than computing it.
[0005] Therefore, there is an urgent need for an efficient distributed optimization method. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide a distributed stochastic gradient optimization method and system based on an event-triggered mechanism. The method and system adopt an event-triggered mechanism, that is, each agent only communicates with its neighboring agents at the triggering time, and there is no Zeno behavior, thereby avoiding real-time communication between agents, improving communication efficiency, saving communication costs, and having stronger robustness and fault tolerance for actual network systems.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A distributed stochastic gradient optimization method based on an event-triggered mechanism includes the following steps: S1, constructing an undirected strongly connected network; S2, initializing the agent variables; S3, performing distributed stochastic gradient optimization using an event-triggered mechanism.
[0009] Furthermore, in step S1, an undirected strongly connected network containing N agents is used. in, Represents a set of agent nodes. Represents the set of edges; This represents the weight matrix of the network, if w ij >0 means that agents i and j are connected, if w ij=0 indicates that agents i and j are not connected; the weight matrix also has the property of non-negative double randomness, i.e., W1 N =1, In addition, N i ={j|w ij >0} represents all neighboring nodes of node i.
[0010] Furthermore, step S2 specifically includes: for all agents Initialize all variables and set all intelligent agents. Set the number of iterations t to 0, and then set a maximum number of iterations t. max This serves as a criterion for stopping the algorithm's iterative updates.
[0011] Furthermore, in step S3, the event triggering mechanism includes: when the t-th iteration arrives, the following conditions must be met for agent i to communicate with neighboring agents, and this iteration t is denoted as...
[0012]
[0013] in and These are the optimization estimates and gradient estimates transmitted by agent i to neighboring agents at the previous trigger moment;
[0014] According to the event triggering mechanism, agent i will first calculate its own estimated value and compare it with the estimated value previously transmitted to the neighboring agent. Only when the difference meets the triggering condition will agent i transmit the estimated value to the neighboring agent. When the selection of the triggering parameter C meets certain conditions, the algorithm can guarantee that the triggering time of the node is not continuous.
[0015] Furthermore, the specific steps of this method are as follows:
[0016] 1) Build an undirected strongly connected network according to The adjacency matrix is used to obtain the doubly random matrix W = [w ij ];
[0017] 2) For all intelligent agents Initialize and set all variables;
[0018] 3) Put all intelligent agents Set the number of iterations t to 0, and then set a maximum number of iterations t. max As a criterion for stopping the algorithm's iterative updates;
[0019] 4) Based on the strong convexity of the global function, set the step size coefficient / learning rate coefficient a > 2N / μ; N is the total number of nodes, and μ is the strong convexity coefficient of the global function;
[0020] 5) Based on this formula, parameter D is set as: in U1 is the variance of the stochastic gradient and the true gradient. I represents the weight matrix of the network; d Let I be a d×d dimensional identity matrix. Nd It is an Nd×Nd dimensional identity matrix; 1 N Let be an N-dimensional vector of all 1s. Let C be its transpose vector; C is the trigger parameter;
[0021] 6) Calculate the correlation coefficients A and B according to the following formulas, where U2 needs to be calculated from... We get x t Let y be the optimal value estimated at time t. t Let be the gradient of the function at time t. and According to Calculations show that c3 is the correlation coefficient, with a range of 0 < c3 < 1 / 4; U3 needs to be determined by... We obtain, where α t Step size: A = max{4U2a 2 +6U2a 2 ,4U3a 2 +6U2a 2}, B = max{4U2a 2 +12L 2 U3a 2 ,4U3a 2 +12L 2 U3a 2};
[0022] 7) Select a trigger parameter C such that C satisfies the condition: C≥2A-(A+B) 2 / 4D
[0023] 8) When the number of iterations is less than t max Then, update according to steps 9)-14):
[0024] 9) Agent i first calculates the step size / learning rate α. t = a / (t+1);
[0025] 10) Each agent updates its own variables.
[0026]
[0027] 11) Each agent updates its own variables. Since the gradient of each agent is random, its gradient is set to... in For an N-dimensional random vector:
[0028]
[0029] 12) Each agent according to Calculate
[0030] 13) Each agent will Substitute the following formulas to determine whether the event triggering mechanism is satisfied:
[0031]
[0032] 14) If the condition in 13) is met, then the variable... and Transmitted to neighboring agents and the trigger time updated.
[0033] Conversely, variables are not transmitted.
[0034] 15) Determine if t has reached the maximum number of iterations t. max When the optimal point is reached, the algorithm update ends, and the global function's optimal point is also obtained.
[0035] The present invention also provides a distributed stochastic gradient optimization system based on an event-triggered mechanism.
[0036] The beneficial effects of this invention are as follows:
[0037] The distributed stochastic gradient optimization method and system based on event triggering mechanism provided by this invention adopts an event triggering mechanism, that is, each agent only communicates with its neighboring agents at its triggering time, and there is no Zeno behavior, thereby avoiding real-time communication between agents, improving communication efficiency, saving communication costs, and having stronger robustness and fault tolerance for actual network systems, and has broad application prospects.
[0038] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0039] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0040] Figure 1 This is a flowchart illustrating the method described in this invention;
[0041] Figure 2 This is a convergence effect diagram for three random dimensions in the embodiment;
[0042] Figure 3 This is a schematic diagram showing the number of triggers for the five nodes in the embodiment;
[0043] Figure 4 This is a schematic diagram comparing the method of the present invention with other algorithms;
[0044] Figure 5 This is a diagram showing the convergence effect of the present invention on the signal source localization problem;
[0045] Figure 6 This is a trajectory diagram of nine randomly selected agents searching for a signal source. Detailed Implementation
[0046] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.
[0047] Figure 1 The flowchart of the method described in this invention is shown in the figure. The distributed stochastic gradient optimization method based on the event triggering mechanism provided by this invention includes the following steps: S1, building an undirected strongly connected network; S2, initializing the agent variables; S3, performing distributed stochastic gradient optimization using the event triggering mechanism.
[0048] Specifically, in the technical solution of this invention, the following communication network model is established:
[0049] An undirected strongly connected network with N agents is adopted. in, Represents a set of agent nodes. Represents the set of edges. This represents the weight matrix of the network, if w ij >0 means that agents i and j are connected, if w ij =0 indicates that agents i and j are not connected. This weight matrix also possesses the property of non-negative double randomness, i.e., W1 N =1, In addition, N i ={j|w ij >0} represents all neighboring nodes of node i.
[0050] The technical solution of this invention mainly solves the following distributed optimization problems:
[0051]
[0052] Among them, the data on the intelligent agent Furthermore, any intelligent agent only knows the local objective function. Here The variation is noise that changes continuously over time.
[0053] In this problem, the global objective function is strongly convex, and the gradient of the local objective function is continuous, i.e.
[0054] At the same time, the gradient on each agent also needs to satisfy: (1) the variance between the noisy stochastic gradient and the true gradient has an upper limit, i.e. Where p > 0, U1 > 0; (2) The stochastic gradient also satisfies continuity, that is And we assume that the maximum value of this continuity coefficient is L0, that is...
[0055] The event triggering mechanism designed in the technical solution of this invention is as follows:
[0056] When the t-th iteration arrives, the following conditions must be met for agent i to communicate with neighboring agents, and this iteration t is denoted as .
[0057]
[0058] in and These are the optimization estimates and gradient estimates transmitted by agent i to neighboring agents at the previous trigger moment.
[0059] Based on this event triggering mechanism, agent i will first calculate its own estimate and compare it with the estimate previously transmitted to neighboring agents. Only when the difference meets the triggering condition will agent i transmit the estimate to its neighboring agents. The triggering parameter C is selected to satisfy: C ≥ 2A - (A + B) 2 / 4D, this algorithm can guarantee that the triggering time of nodes is not continuous.
[0060] In this embodiment, the specific steps of the method provided by the present invention are as follows:
[0061] (1) For all intelligent agents All variables are initialized as follows:
[0062]
[0063] (2) All agents Set the number of iterations t to 0, and then set a maximum number of iterations t. max As a criterion for stopping the algorithm's iterative updates;
[0064] (3) Construct an undirected strongly connected network according to From the adjacency matrix, we can obtain the doubly random matrix W = [w ij ], and set the connectivity of the matrix to p c =0.8.
[0065] (4) Based on the strong convexity of the global function, set the step size coefficient / learning rate coefficient a = 0.08.
[0066] (5) Select the value of the trigger parameter C according to the formula: C = 6000
[0067] (6) In each iteration, agent i first calculates the step size / learning rate α. t = a / (t+1).
[0068] (7) Each agent updates its own variables.
[0069]
[0070] (8) Each agent updates its own variables.
[0071]
[0072] (9) Each agent according to Calculate
[0073] (10) Each agent will Substitute the following formulas to determine whether the event triggering mechanism is satisfied:
[0074]
[0075] (11) If the condition in (9) is met, then the variable will be... and Transmit to neighboring nodes and update the trigger time. Conversely, variables are not transmitted.
[0076] (12) When the number of iterations reaches the maximum number of iterations t max Once the algorithm update is complete, the global function's optimal point will also be obtained.
[0077] In the above embodiments, the present invention uses the logistic regression problem, a popular problem in machine learning, to test the effectiveness of the proposed algorithm. First, the problem is described as follows:
[0078]
[0079] In this problem, the network connectivity rate p c =0.8, the number of agents is N=10, and the local objective function is:
[0080]
[0081] Among them, v i,h For data, w i,h ∈{-1,1} are the labels of the data, h∈{1,...,m} i} represents the h-th data sample of node i.
[0082] In this experiment, the present invention used two datasets to verify the effectiveness of the algorithm. The first dataset is a breast cancer dataset from UCI Machine Learning Data, with m = 200 samples and a data dimension of 9. The second dataset is also a mushroom dataset from UCI Machine Learning Data, with m = 6000 samples and a data dimension of 112. The optimal estimate x was randomly selected. i In 3 of the 9 dimensions, it was found that the globally optimal estimate x decreases over time. i It will converge to a stable state. The convergence verification results are as follows: Figure 2 As shown.
[0083] Triggering mechanism verification: In this embodiment, 5 agents were randomly selected, and the number of triggers was observed. The experimental results are as follows: Figure 3 As shown. From Figure 3 It can be seen that when using the technical solution of this invention, the communication between agents is not continuous. That is, this invention can achieve the same convergence effect as other algorithms with less communication cost.
[0084] Comparison with other algorithms: In this embodiment, the convergence performance of the present invention and other algorithms is compared. The comparison results, wherein the difference from the optimal point is expressed as... To measure, where x * This is the optimal value. For example... Figure 4 .from Figure 4 As can be seen, the algorithm without stochastic gradients has higher accuracy. However, the algorithm proposed in this invention can achieve the same convergence effect as other distributed stochastic algorithms with less communication cost.
[0085] In this embodiment, the signal source localization problem in signal control is also used to test the effectiveness of the proposed algorithm.
[0086] First, the problem is described as follows:
[0087]
[0088] in, Indicates the position of agent i, n i This indicates the information it collects. This is a signal propagation model used to measure the h-th signal received by agent i. c is a positive constant representing the signal strength. λ is the signal attenuation coefficient. Additionally... And q i,h The sample noise follows a Gaussian distribution. In this experiment, it is assumed that there are 50 agents distributed within a 100*100 area. (Signal source) At position (60, 60), a signal with intensity c = 100 is released, and the amount of data on each agent is n. i =100. In this embodiment, the objective is to find the signal source using the technical solution of this invention. The corresponding experimental results are as follows. Figure 5 and Figure 6 The difference from the optimal point is expressed as To measure, where x * The location of the signal source is shown. It can be seen that the technical solution of this invention can converge successfully and ultimately locate the signal source.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications should be covered within the scope of the claims of the present invention.
Claims
1. A distributed stochastic gradient optimization method based on an event-triggered mechanism applied to machine learning and distributed systems, characterized in that: The method includes the following steps: S1. Construct an undirected strongly connected network; S2. Initialize the agent variables; S3. Distributed stochastic gradient optimization is performed using an event-triggered mechanism; In step S1, an undirected strongly connected network G = {V, E, W} with N agents is used, where V = {1, 2, 3, ..., N} represents the set of agent nodes. Represents the set of edges; This represents the weight matrix of the network, if w ij >0 means that agents i and j are connected, if w ij =0 indicates that agents i and j are not connected; the weight matrix also has the property of non-negative double randomness, i.e., W1 N =1, In addition, N i ={j|w ij >0} represents all neighboring nodes of node i; Step S2 specifically includes: initializing all variables for all agents i∈V, setting the iteration count t for all agents i∈V to 0, and setting a maximum iteration count t. max As a criterion for stopping the algorithm's iterative updates; In step S3, the event triggering mechanism includes: when the t-th iteration arrives, the following conditions must be met for agent i to communicate with neighboring agents, and this iteration t is denoted as ti. in and These are the optimization estimates and gradient estimates transmitted by agent i to neighboring agents at the previous trigger moment; According to this event triggering mechanism, agent i will first calculate its own estimated value and compare it with the estimated value previously transmitted to the neighboring agent. Only when the difference meets the triggering condition will agent i transmit the estimated value to the neighboring agent. When the selection of the triggering parameter C meets certain conditions, this algorithm can guarantee that the triggering time of the node is not continuous. The specific steps of this method are as follows: 1) Construct an undirected strongly connected network G. Based on the adjacency matrix of G, obtain the birandom matrix W = [w ij ]; 2) Initialize all variables for all agents i∈V; 3) Set the iteration count t for all agents i∈V to 0, and then set a maximum iteration count t. max As a criterion for stopping the algorithm's iterative updates; 4) Based on the strong convexity of the global function, set the step size coefficient a > 2N / μ; N is the total number of nodes, and μ is the strong convexity coefficient of the global function; 5) Based on this formula, parameter D is set as: in U1 is the variance of the stochastic gradient and the true gradient. I represents the weight matrix of the network; d Let I be a d×d dimensional identity matrix. Nd It is an Nd×Nd dimensional identity matrix; 1 N Let be an N-dimensional vector of all 1s. Let C be its transpose vector; C is the trigger parameter; 6) Calculate the correlation coefficients A and B according to the following formulas, where U2 needs to be calculated from... We get x t Let y be the optimal value estimated at time t. t Let be the gradient of the function at time t. and According to Calculations show that c3 is the correlation coefficient, with a range of 0 < c3 < 1 / 4; U3 needs to be determined by... We obtain, where α t Step size: A=max{4U2a 2 +6U2a 2 ,4U3a 2 +6U2a 2 }, B=max{4U2a 2 +12L 2 U3a 2 ,4U3a 2 +12L 2 U3a 2 }; 7) Select a trigger parameter C such that C satisfies the condition: C≥2A-(A+B) 2 / 4D 8) When the number of iterations is less than t max Then, update according to steps 9)-14): 9) Agent i first calculates the step size / learning rate α. t = a / (t+1); 10) Each agent updates its own variables. 11) Each agent updates its own variables. Since the gradient of each agent is random, its gradient is set to... in For an N-dimensional random vector: 12) Each agent according to Calculate 13) Each agent will Substitute the following formulas to determine whether the event triggering mechanism is satisfied: 14) If the condition in 13) is met, then the variable... and Transmitted to neighboring agents and the trigger time updated. Conversely, variables are not transmitted. 15) Determine if t has reached the maximum number of iterations t. max When the optimal point is reached, the algorithm update ends, and the global function's optimal point is also obtained.
2. A distributed stochastic gradient optimization system based on an event-triggered mechanism, employing the method described in claim 1, applicable to machine learning and distributed systems.