Variable Optimization System
The variable optimization system stabilizes model fitting in edge computing by using global and local control variables and dual variables to address data biases and asynchronous communication in decentralized networks.
Patent Information
- Application Number
- JP2023523897
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-05-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-05-28
AI Technical Summary
Existing edge computing methods for machine learning face challenges in stabilizing model variable optimization when training data sets across nodes have statistical biases or communication between nodes is asynchronous and sparse.
A variable optimization system that uses a set of learning data distributed across multiple nodes, employing a model variable update mechanism that incorporates global and local control variables, dual variables, and specific update rules to stabilize model fitting despite data biases and asynchronous communication.
The system enables stable optimization of model variables even with statistically biased data and asynchronous communication, ensuring effective model fitting across decentralized networks.
Smart Images

Figure 0007548425000112 
Figure 0007548425000104 
Figure 0007548425000099
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique for optimizing model variables that are the subject of machine learning. [Background technology]
[0002] In recent years, machine learning frameworks such as deep learning have become increasingly popular for extracting meaningful information from data. Machine learning frameworks typically aggregate the data obtained in one place and then train a model.
[0003] However, there are cases where data used for learning cannot be aggregated in one place. (1) For example, in the case of medical data, when the data used for learning is highly private or confidential and cannot be released, the data cannot be aggregated in one place. Also, (2) when there are too many devices storing data used for learning, such as data contained in cars or smartphones, the data transfer may overwhelm the network, and in this case, the data cannot be aggregated in one place either. Furthermore, (3) there are cases where strict regulations are imposed on the handling of data, such as the General Data Protection Regulation (GDPR) in the EU, and in some cases, the data cannot be aggregated in one place. In other words, from the perspectives of privacy protection, the increase in data volume, and legal regulations, learning will become more decentralized in the future.
[0004] Therefore, currently, concepts such as edge computing that enables learning even when data cannot be collected in one place are being considered (see Non-Patent Document 1). In edge computing, models are learned in a state where data to be used for learning is accumulated in each of the computers (also called nodes) distributed on the network. The basic requirements for edge computing are as follows: (1) Obtain a model equivalent to the model trained by aggregating all data in one place (hereafter referred to as the global model).
[0005] In this regard, edge computing must also meet the following three requirements: (2) Any network structure can be used so that the scale of data processing can be expanded to any scale. Examples of the network structure include a distributed network with servers and a P2P communication network. (3) Even if statistically biased data (called non-uniform data) is accumulated at each node, learning can be performed stably. (4) Learning is stable without all nodes in the network communicating synchronously. In this case, the communication is not of the data stored in each node, but of auxiliary information such as model update differences.
[0006] Learning in edge computing is explained below. Consider a network in which n nodes (n is an integer equal to or greater than 2) are connected. Since the network structure can be any structure, it will be described using a graph, and the network on which edge computing is performed will be represented as a graph G(N, ε). Here, N={1, 2, …, n} is a set of indexes representing the nodes that make up the network, and ε={1, 2, …, E} (E is an integer equal to or greater than 1) is a set of indexes representing the edges that make up the network. Note that each node is connected to one or more nodes. In other words, there are no isolated nodes. Also, ε i ={j∈N|(i, j)∈ε(j≠i)}, then ε i represents the set of indexes of nodes to which the i-th node is connected.
[0007] Figure 1 shows a network with four connected nodes. In Figure 1, the i-th node is represented as Node #i. For example, ε4={1, 3} indicates that the fourth node is connected to the first and third nodes.
[0008] Below, the model variables to be trained at the i-th node are i Let x be the set of training data stored in the i-th node. i Let us assume that.
[0009] The model to be optimized has the same structure and dimensions at all nodes, according to requirement (1). That is, for any i, j (i ≠ j), w i =w j The model variable w i (i=1, 2, …, n) is trained. Also, from requirement (3), the training data set x i and the training data set x j (i ≠ j) generally differs in terms of the number of data and the statistical properties of the data.
[0010] Note that each node may have a different computing capability. However, in the following, for the sake of simplicity, it is assumed that in learning, while a specific node performs K variable updates, auxiliary information such as the variable update difference is exchanged once on each edge including that node. Hereinafter, this series of update and exchange processes will be referred to as a round. However, the timing of the exchange can be random. It is assumed that R rounds are executed.
[0011] FIG. 2 shows edge computing in the network of FIG. 1. In FIG. 2, a specific node is designated as Node #1, and learning is shown for K=8 and R=2. "U" in FIG. 2 represents variable update processing within a node, and "X" represents data exchange processing between nodes. Generally, there is no need for special constraints on variable update processing within a node (e.g., constraints on the calculation speed of the node) or special constraints on data exchange processing between nodes (e.g., constraints on the communication method), and the number of variable update processing within a node or the number of data exchange processing between nodes does not need to be uniform.
[0012] In the following, the set representing the number of rounds is represented as {1, 2, …, R}, and the set representing the number of update processes is represented as {1, 2, …, K}. i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) denote the set of indexes of nodes with which the i-th node will communicate in the k-th update process in the r-th round.
[0013] In edge computing learning, for any i, j (i ≠ j), w i =w j In other words, we search for a model that minimizes the cost function f under the condition that the model variables of all nodes are consistent.
[0014] The cost function is explained below. The structure of the neural network and the definition of the cost function are common to all nodes. i Let f be the cost function at the i-th node. For any i, j (i ≠ j), i =f j In addition, the cost function f i The parameters of the model variables w i The cost function f i is designed appropriately for each application field, such as image classification, noise removal, image generation, voice recognition, and anomaly detection. In general, the cost function f i can be any differentiable function. That is, the cost function f i As long as it is a differentiable function, it may be a convex function or a non-convex function.
[0015] Here, as a concrete example, a cost function using deep learning will be explained. Designing a cost function using deep learning has become popular in recent years, and the cost function using deep learning is a differentiable non-convex function. Image classification will be used as an example. An image classification model is a method for classifying an input image x i The output value y is obtained by passing it through a neural network (i.e., a combination of multiple linear and nonlinear transformations).i This is a model (i.e., a function) that obtains the output value y i is a C-dimensional one-hot vector that represents the probability of existence for each class when there are C classes to be classified. Note that the closer the element value of the vector is to 0, the less the class is the relevant class, and the closer it is to 1, the more the relevant class is. Usually, the class with the maximum value is the classification result. A function that outputs a scalar evaluation value is defined as an evaluation function, and a function obtained by combining the evaluation function with the function of the image classification model is defined as a cost function f i In classification problems, including image classification, the cross-entropy function is often used as an evaluation function.
[0016] w=[w1 T , …, w n T ] T The cost function f is defined as follows:
[0017]
number
[0018] Also, g i =∇f i (w i ), then g i is the cost function f i The function represents the gradient of the training data set x i For a mini-batch selected as part of i When we calculate the gradient of , the gradient becomes a random variable. i Let f be the cost function i In deep learning, mini-batches are often chosen to generalize non-convex functions, and learning is often done with small step sizes while fluctuating the gradient.
[0019] A method for solving the optimization problem that minimizes the cost of the following equation will now be described.
[0020]
number
[0021] Methods for solving this optimization problem include, for example, (1) averaging consensus and (2) Stochastic Variance Reduction (SVR). Examples of averaging consensus include DSGD, Gossip SGD, and FedAvg. Examples of stochastic variance reduction gradient methods include SCAFFOLD and GT-SVR.
[0022] First, we will explain DSGD as an example of averaging consensus formation. Figure 3 shows the algorithm of DSGD (see Non-Patent Document 2). Here, μ is the step size, E i is the set ε i It represents the number of elements in. As shown in Figure 3, while updating the model variables at each node, they are occasionally averaged so that the connected nodes have similar model variables (i.e., a consensus is reached). Averaging consensus formation requires little computational effort and memory consumption, so it is often used as a basic algorithm in edge computing.
[0023] Next, we will explain SCAFFOLD as an example of the stochastic variance-reducing gradient method. Figure 4 shows the algorithm of SCAFFOLD (see Non-Patent Document 3). SCAFFOLD is an algorithm that applies SVR to FedAvg, which is an averaging consensus formation in a centralized distributed network. In the stochastic variance-reducing gradient method, the stochastic gradient g i In the following formula (1), - g i By replacing it with, it is possible to reduce the variance of the stochastic gradient and prevent instability of learning due to the selection of mini-batches.
[0024]
number
[0025] Where: - c iis a global control variable that is the expected value of the stochastic gradient of the i-th node and the nodes connected to it, c i are local control variables that are the expected values of the stochastic gradients of the i-th node, and are defined as follows:
[0026]
number
[0027]
number
[0028] In other words, equation (1) is the stochastic gradient g i Global control variables - c i and the local control variable c i By adding the difference with, the formula corrects the direction of learning to move toward the global model.
[0029] As can be seen in Figure 4, the global control variable - c i and the local control variable c i is also updated according to a predetermined update rule. [Prior art documents] [Non-patent literature]
[0030] [Non-Patent Document 1] NTT DATA Corporation, “Edge computing attracts attention in the IoT era,” [online], [Retrieved May 10, 2021], Internet<URL: https: / / www.nttdata.com / jp / ja / data-insight / 2018 / 1122 / > [Non-Patent Document 2] J. Chen, AH Sayed, “Diffusion adaptation strategies for distributed optimization and learning over networks,” IEEE Transactions on Signal Processing, 60(8), pp.4289-4305, 2012. [Non-Patent Document 3] SP Karimireddy, S. Kale, M. Mohri, S. Reddi, S. Stich, AT Suresh, “SCAFFOLD: Stochastic Controlled Averaging for Federated Learning,” Proceedings of the 37th International Conference on Machine Learning, PMLR 119:5132-5143, 2020. Summary of the Invention [Problem to be solved by the invention]
[0031] Averaging consensus methods such as DSGD work stably when the training data sets accumulated in each node are roughly statistically homogeneous. On the other hand, there is a problem that it often does not work well when (1) there is a statistical bias in the training data sets accumulated between nodes, or (2) communication between nodes is asynchronous and sparse. This problem occurs because the stochastic gradient takes values that are quite different for each node, so the learning direction is not corrected to approach the global model.
[0032] In addition, since stochastic variance-reduced gradient methods such as SCAFFOLD update variables so as to reduce the variance of the stochastic gradient, they are more tolerant than average consensus methods to (1) cases where there is a statistical bias in the learning data set accumulated between nodes, and (2) cases where communication between nodes is asynchronous and sparse. On the other hand, due to the update rules for the two control variables, the expected value of the stochastic gradient may not be estimated accurately, and in such cases, there is a problem that learning cannot proceed stably and a global model cannot be learned.
[0033] Therefore, the present invention aims to provide a technology that can stably optimize model variables to fit a training data set, even when there is a statistical bias in the training data set that is distributed and stored across multiple nodes, or when communication between nodes is asynchronous and sparse. [Means for solving the problem]
[0034] One aspect of the present invention is a variable optimization system that is configured with n nodes (n is an integer equal to or greater than 2) and optimizes model variables using a learning data set that is a set of learning data stored in each node, where N={1, ..., n} is a set of node indexes, i∈N, and w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, - c i Let c be the global control variable at the i-th node. i|i Let be the local control variable at the i-th node, and y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as
[0035]
number
[0036] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node updates the model variable w i A model variable update unit that updates the value of
[0037]
number
[0038] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using
[0039]
number
[0040]
number
[0041] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j , j∈ε i For the index j that satisfiesi|j A first dual variable update unit that updates the value of
[0042]
number
[0043] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j and update the value of the global control variable - c i A second dual variable update unit that updates the value of
[0044]
number
[0045]
number
[0046]
number
[0047] When the update process in the rth round is executed for the Kth time, the local control variable c i|i The value of the temporary variable u at the i-th node i|i a local control variable update unit for updating the values of
[0048]
number
[0049]
number
[0050] Includes.
[0051] One aspect of the present invention is a variable optimization system that is configured with n nodes (n is an integer equal to or greater than 2) and optimizes model variables using a learning data set that is a set of learning data stored in each node, where N={1, ..., n} is a set of node indexes, i∈N, and w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, and y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as
[0052]
number
[0053] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node updates the model variable w i A model variable update unit that updates the value of
[0054]
number
[0055] (However, ∇f i (w i) is the training data set x i A mini-batch x i,MB (Calculated using
[0056]
number
[0057] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j , j∈ε i For the index j that satisfies i|j A first dual variable update unit that updates the value of
[0058]
number
[0059] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j The value of the temporary variable u is updated by the following formula: i|j A second dual variable update unit that updates the value of
[0060]
number
[0061] where ψ is the distribution of the types of training data stored in the n nodes, and the mini-batch x i,MB follows the distribution ψ for the training data set x i Here, the mini-batch is generated from
[0062] One aspect of the present invention is a variable optimization system that is configured with n nodes (n is an integer equal to or greater than 2) and optimizes model variables using a learning data set that is a set of learning data stored in each node, where N={1, ..., n} is a set of node indexes, i∈N, and w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, and y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as
[0063]
number
[0064] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node updates the model variable w i A model variable update unit that updates the value of
[0065]
number
[0066] (However, ∇f i (w i ) is the training data set x i A mini-batch xi,MB (Calculated using
[0067]
number
[0068] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j , j∈ε i For the index j that satisfies i|j A first dual variable update unit that updates the value of
[0069]
number
[0070] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j The value of the temporary variable u is updated by the following formula: i|j A second dual variable update unit that updates the value of
[0071]
number
[0072] d i Let x be the training data set. i The number of data is set to be β i|j is the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node, calculated by the following formula: i|jIt is.
[0073]
number
[0074] According to the present invention, even if there is a statistical bias in the training data set stored in a distributed manner across multiple nodes or if communication between nodes is asynchronous and sparse, it is possible to stably optimize model variables to fit the training data set. [Brief description of the drawings]
[0075] [Figure 1] FIG. 1 is a diagram showing an example of a network in which n (n=4) nodes are connected. [Diagram 2] FIG. 2 is a diagram illustrating edge computing in the network of FIG. 1. [Diagram 3] A diagram illustrating the DSGD algorithm. [Figure 4] FIG. 1 illustrates the SCAFFOLD algorithm. [Diagram 5] FIG. 1 illustrates the ECL algorithm. [Figure 6] FIG. 2 illustrates the optimization algorithm of the present application. [Figure 7] FIG. 2 illustrates the optimization algorithm of the present application. [Figure 8] FIG. 2 illustrates the optimization algorithm of the present application. [Figure 9] FIG. 2 illustrates the optimization algorithm of the present application. [Figure 10] FIG. 1 is a block diagram showing a configuration of a variable optimization system 10. [Figure 11] 1 is a block diagram showing a configuration of a node 100. FIG. [Figure 12] 4 is a flowchart showing the operation of the node 100. [Figure 13] FIG. 2 is a block diagram showing the configuration of a variable optimization unit 120 in the first embodiment. [Figure 14] 4 is a flowchart showing the operation of a variable optimization unit 120 in the first embodiment. [Figure 15] FIG. 13 is a block diagram showing the configuration of a variable optimization unit 120 according to the second embodiment. [Figure 16] 13 is a flowchart showing the operation of a variable optimization unit 120 in the second embodiment. [Figure 17] FIG. 2 is a diagram illustrating an example of a functional configuration of a computer that realizes each device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0076] Hereinafter, an embodiment of the present invention will be described in detail. Note that components having the same functions are given the same reference numbers and duplicated explanations will be omitted.
[0077] Before describing each embodiment, the notation used in this specification will be described.
[0078] ^ (caret) represents a superscript. For example, x y^z Yes z is a superscript to x, and x y^z Yes z is a subscript to x. Also, _ (underscore) represents a subscript. For example, x y_z Yes z is a superscript to x, and x y_z Yes z is a subscript on x.
[0079] In addition, the superscripts "^" and "~" such as ^x and ~x for a certain letter x should actually be written directly above the "x", but due to the constraints of the description in the specification, they are written as ^x and ~x. <Technical background> [1: ECL algorithm] As a method for solving an optimization problem, there is a method using a primal-dual update rule, in addition to the averaging consensus method and the stochastic variance-reduced gradient method. Examples of the method using the primal-dual update rule include PDMM and Edge-Consensus Learning (ECL). Here, ECL will be described based on Reference Non-Patent Document 1. (Reference non-patent document 1: K. Niwa, N. Harada, G. Zhang, and WB Kleijn, Edge-consensus learning: Deep learning on P2P networks with nonhomogeneous data. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 668-678, 2020.) The optimized model variables are preferably as consistent as possible with the sum of the training data sets in all nodes, and a consensus on the model variables is reached among the nodes. In other words, the model variables are trained to reduce the cost function, and the model variables are trained to be approximately equal to each other. Therefore, the optimization problem to be solved for the model variables can be formulated as a linearly constrained cost minimization problem as follows:
[0080]
number
[0081]
number
[0082] In addition, the unit matrix A in equation (3) i|j The sign of A i|j ) is also sometimes expressed.
[0083] When the cost function f is a differentiable non-convex function, instead of solving the optimization problem of equation (2), the following optimization problem may be solved in which the cost function f of equation (2) is replaced by a quadratic upper bound function q.
[0084]
number
[0085]
number
[0086]
number
[0087] Here, μ is the step size, and in the case of deep learning, it is set to a sufficiently small value, for example, 0.001. i r,k is the model variable w in the kth update process in the rth round. i Represents the value of .
[0088] Instead of solving the optimization problem of equation (4), we consider solving its dual problem. Specifically, the dual variable λ=[λ1 T , …, λ n T ] T (where λ i =[λ i|ε_i(1) T , …, λ i|ε_i(E_i) T ] T , for any i, j, λ i|j = λ j|i (satisfies the above) and solve the dual problem for the dual variable λ in the following equation.
[0089]
number
[0090] however,
[0091]
number
[0092]
number
[0093]
number
[0094]
number
[0095]
number
[0096]
number
[0097] and P is a matrix (hereinafter referred to as a permutation matrix) that permutes dual variables as follows:
[0098]
number
[0099] All elements of the permutation matrix P are either 0 or 1, and PP=I is satisfied.
[0100] In addition, q * Let q be a convex conjugate function of the function q, and ι be ker(I-P) is called the indicator function.
[0101] Let us consider deriving a variable update rule for solving the optimization problem of equation (5). The dual variable λ that satisfies equation (5) is the cost function q *(J T A T λ)+ι ker(I-P) This is obtained when the subdifferential of (λ) contains 0.
[0102]
number
[0103]
number
[0104]
number
[0105] By introducing dual variables y and z of the same dimension as the dual variable λ and transforming equation (6) using monotone operator decomposition, we obtain the following variable update rule.
[0106]
number
[0107]
number
[0108]
number
[0109] Equation (7) is the update rule for the model variable w, equation (8) is the update rule for the dual variable y, and equation (9) is the update rule for the dual variable z. In addition, the PDMM-SGD in equation (9) is a variable update rule obtained based on the Peaceman-Rachford (PR) type monotone operator decomposition (PRS: Peaceman-Rachford Splitting), and the ADMM-SGD is a variable update rule obtained based on the Douglas-Rachford (DR) type monotone operator decomposition (DRS: Douglas-Rachford Splitting).
[0110] By decomposing the variable update rules of equations (7), (8), and (9) into variable update rules for each node, we obtain the algorithm shown in Figure 5. This algorithm is the ECL algorithm. Here, η i is a constant representing the step size at the i-th node, ρ i is a constant that represents the strength of the regularization term at the i-th node. As with the algorithms in Figures 3 and 4, in the algorithm in Figure 5, learning progresses by repeating the variable update process within a node and the data exchange process between nodes. The variable update rule in equation (7) and the variable update rule in equation (8) are both update rules for the variable update process within a node. On the other hand, the variable update rule in equation (9) is an update rule for the data exchange process between nodes, and in PDMM-SGD, the model variable w j The value of the dual variable y j|i After receiving the value of from the jth node, the dual variable z i|j On the other hand, in ADMM-SGD, the model variable w j The value of the dual variable y j|i After receiving the value of from the jth node, the dual variable y j|i Using the value of i|j After averaging the values of i|j Update the value of [2: Improvement of the ECL algorithm] Primal-dual update rules such as ECL minimize the cost function while imposing constraints to make the models of each node equivalent, and therefore, like the stochastic variance reduced gradient method, are highly resistant to (1) cases where the accumulated training data set has statistical bias, and (2) cases where communication between nodes is asynchronous and sparse. However, unless the step size η and the strength ρ of the regularization term are appropriately selected, learning may not converge well. In fact, with ECL, the values of η and ρ are empirically determined, which posed the problem of not being able to proceed with learning stably.
[0111] Therefore, in order to ensure stable progress in ECL learning, the following methods are used. (1) We introduce control variables to reduce the variance of the stochastic gradient used in the stochastic variance-reduced gradient method. (2) Generate mini-batches taking class balance into account. (3) Normalization is performed according to the amount of data stored in the node.
[0112] The above three methods can be introduced into the ECL either alone or in combination of two or more. [[Method (1)]] Figure 6 shows an algorithm that introduces method (1) into ECL. In the algorithm of Figure 6, the stochastic gradient g i Fix.
[0113]
number
[0114] Here, the local control variable is c i|i It states that:
[0115] In addition, the global control variable - c i Update the value of
[0116]
number
[0117]
number
[0118] This expression indicates that the value of the global control variable is updated using the value of the variable received from the node connected to the i-th node. i} is a set {i} and a set ε i Also, |ε i | is the set ε i The number of elements in the set ε i Represents the concentration of.
[0119] In addition, the local control variable c i|i Update the value of
[0120]
number
[0121] This expression calculates the local control variable c using the value of the self node variable. i|i This represents an update to the value of . [[Method (2)]] Figure 7 shows an algorithm that introduces method (2) into ECL. The distribution ψ of each type (class) of learning data stored in n nodes, that is, the distribution ψ that represents the class balance, is assumed to be known in advance. The learning data set x stored in the i-th node according to the distribution ψ is i Select training data from and create a mini-batch ξ i Generate.
[0122]
number
[0123] This mini-batch ξ i Using the stochastic gradient g i Calculate the value of [[Method (3)]] Figure 8 shows an algorithm that introduces method (3) into ECL. i The number of data d i If we know in advance, the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node is π i|j is calculated as follows:
[0124]
number
[0125] This ratio π i|j The weight β at the i-th node corresponding to the j-th node i|j and the model variable w i In other words, ECL updates the model variable w by simply averaging without weighting. i In method (3), the value of π i|j By weighting and averaging using i Also, when using method (3) in combination with method (1), update the value of the global control variable - c i The value of π i|j Update it using:
[0126] As described above, two or more of the methods (1) to (3) can be combined. As an example of a combination, Fig. 9 shows an algorithm in which the methods (1) to (3) are introduced into ECL.
[0127] By appropriately introducing the above methods (1) to (3) into ECL, we confirmed through numerical experiments that compared to ECL, learning can be performed stably without being affected by differences in the number of elements and statistical properties of the learning data set accumulated in each node. Among them, we experimentally confirmed that methods (1) and (2) are particularly effective. First Embodiment Hereinafter, the variable optimization system 10 will be described with reference to Figs. 10 to 12. Fig. 10 is a block diagram showing the configuration of the variable optimization system 10. The variable optimization system 10 is composed of n nodes (n is an integer equal to or greater than 2). Each node is connected to a network 800. The network 800 may be, for example, the Internet. However, for each node, it is assumed that a node that connects to and communicates with the node is determined in advance. Also, each node accumulates a set of learning data (hereinafter referred to as a learning data set) used for optimizing the model variables.
[0128] FIG. 11 is a block diagram showing the configuration of node 100. FIG. 12 is a flowchart showing the operation of node 100. As shown in FIG. 11, node 100 includes a variable optimization unit 120, a transmission / reception unit 180, and a recording unit 190. The transmission / reception unit 180 is a component that appropriately transmits and receives data that needs to be exchanged with other nodes. The recording unit 190 is a component that appropriately records information necessary for processing by node 100. For example, a learning data set is recorded in the recording unit 190.
[0129] Let N={1, …, n} be the set of node indices, i∈N. i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes to which the i-th node is connected. - c i Let c be the global control variable at the i-th node. i|i Let y be the local control variable at the i-th node. i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is the parameter matrix defined by
[0130]
number
[0131] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,kLet (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes with which the i-th node communicates in the k-th update process in the r-th round. Hereinafter, r will be called the round execution count counter, and k will be called the update process execution count counter. Note that r and k will also be simply called counters.
[0132] The operation of the i-th node 100 will be described with reference to FIG.
[0133] In S120, the variable optimization unit 120 optimizes the learning data set x i Using the above, the model variable w to be optimized is i In this case, the variable optimization unit 120 optimizes the j-th node (where j is j∈ε) using the transmission / reception unit 180. i ) and receives the model variable w i The data received by the i-th node from the j-th node will be explained later.
[0134] The variable optimization unit 120 will be described below with reference to Figs. 13 and 14. Fig. 13 is a block diagram showing the configuration of the variable optimization unit 120. Fig. 14 is a flowchart showing the operation of the variable optimization unit 120. As shown in Fig. 13, the variable optimization unit 120 includes an initialization unit 121, a model variable update unit 1221, a first dual variable update unit 1222, a second dual variable update unit 1223, a local control variable update unit 1224, a counter update unit 123, and a termination condition determination unit 124.
[0135] The operation of the variable optimization unit 120 of the i-th node will be described with reference to FIG.
[0136] In S121, the initialization unit 121 initializes the model variable w iThe initialization process required for optimizing the model variable w is performed. The initialization process will be described below. The initialization unit 121 initializes counters r and k. The initialization unit 121 initializes counter r by setting r←1. Similarly, the initialization unit 121 initializes counter k by setting k←1. The initialization unit 121 also initializes model variable w i , the temporary variable u in the i-th node corresponding to the j-th node i|j , dual variable z i|j (j∈ε i The initialization unit 121 initializes the model variable w i The initial value of the temporary variable u i|j The initial value of the dual variable z i|j The initialization unit 121 also sets the initial value of the global control variable - c i , local control variable c i|i , the local control variable c at the i-th node corresponding to the j-th node i|j The initialization unit 121 initializes the global control variable - c i The initial value of the local control variable c i|i The initial value of the local control variable c i|j Set the initial value of .
[0137] In S1221, the model variable update unit 1221 updates the model variable w i Update the value of
[0138]
number
[0139] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using
[0140]
number
[0141]
number
[0142] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and sign(A i|j ) is the unit matrix A i|j (represents the sign of The vectors μ, η, and ρ may be set by the initialization unit 121 in S121, for example.
[0143] In addition, if the distribution ψ of each class (i.e., the proportion of each class) of the types of learning data stored in n nodes is known in advance, the learning data set x i Let the mini-batch generated from mini-batch x i,MB It can also be used as.
[0144] Weight β i|j For example, β may be set by the initialization unit 121 in S121. i|j =1 / |ε i | Also, the learning data set x i The number of data d i If is known in advance, the weight β i|j is the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node, calculated by the following formula: i|j It is also possible to use the following.
[0145]
number
[0146] In S1222, the first dual variable update unit 1222 updates j∈ε i For the index j that satisfiesi|j Update the value of
[0147]
number
[0148] In S1223, the second dual variable update unit 1223 updates j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j and update the value of the global control variable - c i Update the value of
[0149]
number
[0150]
number
[0151]
number
[0152] Here, the second dual variable update unit 1223 updates the dual variable z i|j The formula used to update the value of is:
[0153]
number
[0154] or
[0155]
number
[0156] (where α is a predetermined constant that satisfies 0<α<1).
[0157] The constant α may be set by the initialization unit 121 in S121, for example.
[0158] In S1224, when the execution of the update process in the rth round is the Kth time (that is, when the counter k satisfies k=K), the local control variable update unit 1224 updates the local control variable c i|i The value of the temporary variable u at the i-th node i|i Update the values of and.
[0159]
number
[0160]
number
[0161] In S123, if counter k satisfies k=K, counter update unit 123 initializes counter k (i.e., k←1) and increments counter r by 1 (i.e., r←r+1), whereas otherwise, counter k is incremented by 1 (i.e., k←k+1).
[0162] In S124, when the counter r reaches a predetermined number of updates R (that is, when the counter r satisfies r=R), the termination condition determination unit 124 determines the model variable w i In other words, if a predetermined termination condition is satisfied, the variable optimization unit 120 outputs the value of the variable w i If not, the process repeats steps S1221 to S124.
[0163] According to an embodiment of the present invention, even if there is a statistical bias in the training data set stored in a distributed manner across multiple nodes or if communication between nodes is asynchronous and sparse, it is possible to stably optimize model variables to fit the training data set. <Second embodiment> In the first embodiment, the variable optimization unit 120 updates the model variables using a value obtained by adding the difference between two control variables to the stochastic gradient, but the variable optimization unit 120 may simply update the model variables using the value of the stochastic gradient. Such an embodiment will be described below. The first and second embodiments differ only in the configuration and operation of the variable optimization unit 120.
[0164] Therefore, hereinafter, the variable optimization unit 120 will be described with reference to Figs. 15 and 16. Fig. 15 is a block diagram showing the configuration of the variable optimization unit 120. Fig. 16 is a flowchart showing the operation of the variable optimization unit 120. As shown in Fig. 15, the variable optimization unit 120 includes an initialization unit 121, a model variable update unit 2221, a first dual variable update unit 2222, a second dual variable update unit 2223, a counter update unit 123, and a termination condition determination unit 124.
[0165] The operation of the variable optimization unit 120 of the i-th node will be described with reference to FIG.
[0166] In S121, the initialization unit 121 initializes the model variable w i The initialization unit 121 initializes counters r and k. The initialization unit 121 also initializes the model variable w i , the temporary variable u in the i-th node corresponding to the j-th node i|j , dual variable z i|j (j∈ε i ) to initialize the
[0167] In S2221, the model variable update unit 2221 updates the model variable w i Update the value of
[0168]
number
[0169] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using
[0170]
number
[0171] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and sign(A i|j ) is the unit matrix A i|j (represents the sign of The vectors μ, η, and ρ may be set by the initialization unit 121 in S121, for example.
[0172] In addition, if the distribution ψ of each class (i.e., the proportion of each class) of the types of learning data stored in n nodes is known in advance, the learning data set x i Let the mini-batch generated from mini-batch x i,MB It can also be used as.
[0173] Weight β i|j For example, β may be set by the initialization unit 121 in S121. i|j =1 / |ε i | Also, the learning data set x i The number of data d i If is known in advance, the weight β i|j is the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node, calculated by the following formula: i|j It is also possible to use the following.
[0174]
number
[0175] In S2222, the first dual variable update unit 2222 updates j∈ε i For the index j that satisfies i|j Update the value of
[0176]
number
[0177] In S2223, the second dual variable update unit 2223 updates j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j The value of the temporary variable u is updated by the following formula: i|j Update the value of
[0178]
number
[0179] Here, the second dual variable update unit 2223 updates the dual variable z i|j The formula used to update the value of is:
[0180]
number
[0181] or
[0182]
number
[0183] (where α is a predetermined constant that satisfies 0<α<1).
[0184] The constant α may be set by the initialization unit 121 in S121, for example.
[0185] In S123, if counter k satisfies k=K, counter update unit 123 initializes counter k (i.e., k←1) and increments counter r by 1 (i.e., r←r+1), whereas otherwise, counter k is incremented by 1 (i.e., k←k+1).
[0186] In S124, when the counter r reaches a predetermined number of updates R (that is, when the counter r satisfies r=R), the termination condition determination unit 124 determines the model variable w i In other words, if a predetermined termination condition is satisfied, the variable optimization unit 120 outputs the value of the variable w i If not, the process of S2221 to S124 is repeated.
[0187] According to an embodiment of the present invention, even if there is a statistical bias in the training data set stored in a distributed manner across multiple nodes or if communication between nodes is asynchronous and sparse, it is possible to stably optimize model variables to fit the training data set. <Application Examples> Here, an example to which each embodiment of the present invention can be applied will be described. Example 1: V2X (Vehicle to everything) In an environment where automobiles, automobiles, infrastructure, etc. are interconnected, as typified by connected cars, automobiles and infrastructure are regarded as nodes in each embodiment. Information from a wide variety of sensors mounted on automobiles and infrastructure, such as images, acoustic signals, and acceleration, is accumulated in each node. The accumulated data may be used as learning data, and each embodiment of the present invention may be used when optimizing one cost function. In this case, the cost function can be designed using an index according to the purpose, such as minimizing the arrival time, minimizing the total amount of energy used, or making the physical distance between nodes equal to or greater than a certain value. Example 2: Digital Twin In a situation where multiple digital twins mutually influence each other, the digital twins are regarded as nodes in each embodiment. Learning data is accumulated in a distributed manner in each digital twin. Each embodiment of the present invention may be used when optimizing one cost function without sharing the accumulated learning data with other nodes. For example, when trying to solve food waste using digital twins, each person and each store can be configured as a digital twin, and a cost function with a cost term that minimizes the amount of ingredients in all stores can be created. Furthermore, a cost function may be designed that uses an index value that expresses the happiness of an individual while maximizing the sum of the index values and minimizing the amount of ingredients in all stores. <Additional Notes> 17 is a diagram showing an example of the functional configuration of a computer that realizes each of the above-mentioned devices (i.e., each node). The processing in each of the above-mentioned devices can be implemented by having a recording unit 2020 load a program for causing a computer to function as each of the above-mentioned devices, and having the control unit 2010, input unit 2030, output unit 2040, etc. operate.
[0188] The device of the present invention has, as a single hardware entity, an input section to which a keyboard or the like can be connected, an output section to which a liquid crystal display or the like can be connected, a communication section to which a communication device (e.g., a communication cable) capable of communicating with the outside of the hardware entity can be connected, a CPU (which may also have a central processing unit, cache memory, registers, etc.), memories such as RAM and ROM, an external storage device such as a hard disk, and buses connecting the input section, output section, communication section, CPU, RAM, ROM, and external storage device so that data can be exchanged between them. If necessary, the hardware entity may also be provided with a device (drive) capable of reading and writing a recording medium such as a CD-ROM. A physical entity equipped with such hardware resources is, for example, a general-purpose computer.
[0189] The external storage device of the hardware entity stores the programs required to realize the above-mentioned functions and the data required in the processing of these programs (not limited to the external storage device, but for example the programs may be stored in a ROM, which is a read-only storage device). Data obtained by the processing of these programs is stored appropriately in the RAM, the external storage device, etc.
[0190] In the hardware entity, each program stored in an external storage device (or ROM, etc.) and the data required for processing each program are loaded into memory as necessary, and interpreted, executed, and processed by the CPU as appropriate, so that the CPU realizes a predetermined function (each component represented as the above, "unit," "means," etc.).
[0191] The present invention is not limited to the above-described embodiment, and can be modified as appropriate without departing from the spirit of the present invention. In addition, the processes described in the above-described embodiment are not limited to being executed in chronological order according to the order described, but may be executed in parallel or individually depending on the processing capacity of the device that executes the processes or as necessary.
[0192] As described above, when the processing functions of the hardware entities (the devices of the present invention) described in the above embodiments are realized by a computer, the processing contents of the functions that the hardware entities should have are described by a program. Then, by executing this program on a computer, the processing functions of the hardware entities are realized on the computer.
[0193] The program describing the processing contents can be recorded on a computer-readable recording medium. The computer-readable recording medium may be, for example, a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or any other suitable recording medium. Specifically, for example, a hard disk drive, a flexible disk, a magnetic tape, or the like can be used as the magnetic recording device, a DVD (Digital Versatile Disc), a DVD-RAM (Random Access Memory), a CD-ROM (Compact Disc Read Only Memory), a CD-R (Recordable) / RW (ReWritable), or the like can be used as the optical disk, an MO (Magneto-Optical disc), or the like can be used as the magneto-optical recording medium, and an EEP-ROM (Electronically Erasable and Programmable-Read Only Memory) or the like can be used as the semiconductor memory.
[0194] The program may be distributed, for example, by selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs on which the program is recorded. Furthermore, the program may be distributed by storing the program in a storage device of a server computer and transferring the program from the server computer to other computers via a network.
[0195] A computer that executes such a program, for example, first stores the program recorded on a portable recording medium or the program transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored in its own storage device and executes a process according to the read program. As another execution form of the program, the computer may directly read the program from the portable recording medium and execute a process according to the program, or may execute a process according to the received program each time a program is transferred from the server computer to the computer. The server computer may not transfer the program to the computer, but may execute the above-mentioned process by a so-called ASP (Application Service Provider) type service that realizes the processing function only by issuing an execution instruction and obtaining the result. Note that the program in this embodiment includes information used for processing by an electronic computer that is equivalent to a program (data that is not a direct instruction to the computer but has a nature that specifies the processing of the computer, etc.).
[0196] In addition, in this embodiment, a hardware entity is configured by executing a specific program on a computer, but at least a part of the processing contents may be realized by hardware.
[0197] The foregoing description of the embodiments of the invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Modifications and variations are possible in light of the above teachings. The embodiments have been chosen and depicted to provide a best illustration of the principles of the invention and to enable those skilled in the art to utilize the invention in various embodiments and with various modifications as may be suitable for the practical use contemplated. All such modifications and variations are within the scope of the invention as defined by the appended claims interpreted in accordance with the breadth to which they are fairly, legally, and equitably entitled.
Claims
1. A variable optimization system that is configured with n nodes (n is an integer of 2 or more) and optimizes model variables using a learning data set that is a set of learning data stored in each node, Let N={1, …, n} be the set of node indices, i∈N, w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, - c i Let c be the global control variable at the i-th node. i|i Let be the local control variable at the i-th node, y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as [Equation 72] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node is The model variable w i A model variable update unit that updates the value of [Equation 73] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using [74] [Number 75] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j (represents the sign of j∈ε i For the index j that satisfies i|j A first dual variable update unit that updates the value of [76] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j and update the value of the global control variable - c i A second dual variable update unit that updates the value of [77] [78] [79] When the update process in the rth round is executed for the Kth time, the local control variable c i|i The value of the temporary variable u at the i-th node i|i a local control variable update unit for updating the values of [Number 80] [Number 81] A variable optimization system including:
2. A variable optimization system that is configured with n nodes (n is an integer of 2 or more) and optimizes model variables using a learning data set that is a set of learning data stored in each node, Let N={1, …, n} be the set of node indices, i∈N, w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as [0082] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node is The model variable w i A model variable update unit that updates the value of [Number 83] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using [Number 84] (where μ, η, ρ are given vectors, β i|jis the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j (represents the sign of j∈ε i For the index j that satisfies i|j A first dual variable update unit that updates the value of [Number 85] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|i The j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j The value of the temporary variable u is updated by the following formula: i|j A second dual variable update unit that updates the value of [Number 86] Including, Let ψ be the distribution of the types of learning data stored in the n nodes, Mini batch x i,MB follows the distribution ψ for the training data set x i Here, the mini-batch generated from Variable optimization system.
3. A variable optimization system that is configured with n nodes (n is an integer of 2 or more) and optimizes model variables using a learning data set that is a set of learning data stored in each node, Let N={1, …, n} be the set of node indices, i∈N, w i Let x be the model variable at the i-th node. i Let f be the training data set at the i-th node. i (w i ) is the cost function at the i-th node, ε i Let be the set of indices of nodes that the i-th node connects to, y i|j , z i|j (j∈ε i ) are the dual variables at the i-th node corresponding to the j-th node, and A i|j (j∈ε i ) is a parameter matrix defined as [Number 87] Let R and K be integers greater than or equal to 1, {1, 2, …, R} be a set representing the number of rounds, {1, 2, …, K} be a set representing the number of update operations, and ε i r,k Let (r∈{1, 2, …, R}, k∈{1, 2, …, K}) be the set of indexes of nodes that the i-th node will communicate with in the k-th update process in the r-th round. The i-th node is The model variable w i A model variable update unit that updates the value of [Number 88] (However, ∇f i (w i ) is the training data set x i A mini-batch x i,MB (Calculated using [Number 89] (where μ, η, ρ are given vectors, β i|j is the weight at the i-th node corresponding to the j-th node, and the temporary variable u at the i-th node corresponding to the j-th node i|j and sign(A i|j ) is the unit matrix A i|j (represents the sign of j∈ε i For the index j that satisfies i|j A first dual variable update unit that updates the value of [Number 90] j∈ε i r,k For index j that satisfies j The value of and the dual variable y j|iThe j-th node receives the values of and from the j-th node, and calculates the dual variable z i|j The value of the temporary variable u is updated by the following formula: i|j A second dual variable update unit that updates the value of [Number 91] Including, d i Let x be the training data set. i The number of data is Weight β i|j is the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node, calculated by the following formula: i|j is [Number 92] Variable optimization system.
4. The variable optimization system according to claim 1, Let ψ be the distribution of the types of learning data stored in the n nodes, Mini batch x i,MB follows the distribution ψ for the training data set x i Here, the mini-batch generated from A variable optimization system.
5. The variable optimization system according to claim 1 or 2, d i Let x be the training data set. i The number of data is Weight β i|j is the ratio of the number of data stored in the jth node connected to the ith node to the number of data stored in all nodes connected to the ith node and the ith node, calculated by the following formula: i|j is [Number 93] A variable optimization system.
6. A variable optimization system according to any one of claims 1 to 3, The second dual variable update unit updates the dual variable z i|j The formula used to update the value of is: [Number 94] or [Number 95] (However, α is 0 <α<1を満たす所定の定数)であるA variable optimization system.< / α<1を満たす所定の定数)である
Citation Information
Patent Citations
Machine learning system, machine learning method, and program
WO2019198815A1
