WO2021027259A1 - 模型参数确定方法、装置和电子设备 - Google Patents
模型参数确定方法、装置和电子设备 Download PDFInfo
- Publication number
- WO2021027259A1 WO2021027259A1 PCT/CN2020/072084 CN2020072084W WO2021027259A1 WO 2021027259 A1 WO2021027259 A1 WO 2021027259A1 CN 2020072084 W CN2020072084 W CN 2020072084W WO 2021027259 A1 WO2021027259 A1 WO 2021027259A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- share
- product
- matrix
- model parameter
- partner
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/211—Schema design and management
- G06F16/212—Schema design and management with details for data modelling support
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
Definitions
- the embodiments of this specification relate to the field of computer technology, and in particular to a method, device and electronic equipment for determining model parameters.
- the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model multiple times. Since the data used to train the data processing model is scattered among the parties involved in the cooperative modeling, how to collaboratively determine the model parameters of the data processing model while protecting data privacy is a technical problem that needs to be solved urgently.
- the purpose of the embodiments of this specification is to provide a method, device and electronic equipment for determining model parameters, so that the model parameters of the data processing model can be determined by multiple parties under the premise of protecting data privacy.
- a method for determining model parameters is provided, which is applied to a first data party, including: secretly sharing the first product with a partner based on the share of feature data and the first model parameter , Obtain the share of the first product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly share the value of the incentive function, obtain the share of the value of the incentive function; The share of the characteristic data and the value of the incentive function share the gradient of the loss function and the Hessian matrix secretly with the partner, and obtain the share of the loss function gradient and the Hessian matrix respectively; according to the share of the random orthogonal matrix and the Hessian matrix Share the second product secretly with the partner to obtain the share of the second product.
- the second product is the product between the random orthogonal matrix and the Hessian matrix; when the condition number of the second product meets the preset condition, The share of the Sen matrix secretly shares the first inverse matrix with the partner to obtain the share of the first inverse matrix, which is the inverse matrix of the Hessian matrix; according to the share of the first inverse matrix, the share of the loss function gradient and The share of the first model parameter secretly shares the new first model parameter with the partner to obtain the share of the new first model parameter.
- a method for determining model parameters is provided, which is applied to a second data party, including: secretly sharing a first product with a partner according to the share of the first model parameter to obtain the first product A share of a product, the first product being the product of the feature data and the first model parameter; according to the share of the first product and the partner secretly sharing the value of the incentive function, the share of the value of the incentive function is obtained; according to the label and incentive
- the share of the value of the function secretly shares the gradient of the loss function with the partner to obtain the share of the gradient of the loss function;
- the share of the value of the incentive function is secretly shared with the partner of the Hessian matrix to obtain the share of the Hessian matrix; according to the random orthogonal matrix
- the share of and the share of the Hessian matrix secretly share the second product with the partner to obtain the share of the second product.
- the second product is the product between the random orthogonal matrix and the Hessian matrix; the condition number of the second product When the preset conditions are met, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
- the first inverse matrix is the inverse of the Hessian matrix;
- the share, the share of the loss function gradient, and the share of the first model parameter secretly share the new first model parameter with the partner to obtain the share of the new first model parameter.
- a model parameter determination device applied to a first data party, including: a first secret sharing unit, which is used to determine the share of the characteristic data and the first model parameter. Share the first product secretly with the partner to obtain the share of the first product, the first product being the product of the feature data and the first model parameter; the second secret sharing unit is used to share the secret of the first product with the partner Share the value of the incentive function to obtain the share of the value of the incentive function; the third secret sharing unit is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the feature data and the share of the value of the incentive function to obtain the loss respectively The share of the function gradient and the share of the Hessian matrix; the fourth secret sharing unit is used to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product.
- a first secret sharing unit which is used to determine the share of the characteristic data and the first model parameter. Share the first product secretly with the partner to
- the second product is the product between the random orthogonal matrix and the Hessian matrix; the fifth secret sharing unit is used to secretly share the first secret with the partner according to the Hessian matrix when the condition number of the second product meets the preset conditions.
- An inverse matrix to obtain the share of the first inverse matrix where the first inverse matrix is the inverse matrix of the Hessian matrix; the sixth secret sharing unit is used to obtain the share of the first inverse matrix, the share of the loss function gradient, and the first
- the share of model parameters secretly shares the new first model parameter with the partner, and obtains the share of the new first model parameter.
- an electronic device including: a memory, configured to store computer instructions; and a processor, configured to execute the computer instructions to implement the computer instructions described in the first aspect Method steps.
- an electronic device including: a memory, configured to store computer instructions; and a processor, configured to execute the computer instructions to implement the method described in the second aspect Method steps.
- the first data party and the second data party can use the secret sharing algorithm to collaboratively determine the data processing model without revealing the data they own.
- Model parameters can be used to collaboratively determine the data processing model without revealing the data they own.
- the method for determining model parameters of this embodiment can avoid the problem of non-convergence caused by ill-conditioned matrices in the process of determining model parameters using the Newton method.
- Figure 1 is a schematic diagram of a model parameter determination system according to an embodiment of the specification
- FIG. 2 is a flowchart of a method for determining model parameters according to an embodiment of the specification
- FIG. 3 is a flowchart of a method for determining model parameters according to an embodiment of the specification
- FIG. 4 is a flowchart of a method for determining model parameters according to an embodiment of the specification
- Fig. 5 is a schematic diagram of a model parameter determining device according to an embodiment of the specification.
- Fig. 6 is a schematic diagram of a model parameter determining device according to an embodiment of the specification.
- Fig. 7 is a functional structure diagram of an electronic device according to an embodiment of the specification.
- Model parameter optimization methods may include gradient descent method, Newton method, etc.
- the Newton's method may include primitive Newton's method and various deformation methods based on the primitive Newton's method (such as damping Newton's method, regularized Newton's method, etc.; regularized Newton's method refers to Newton's method with regularization terms; regularization can be Reduce the complexity and instability of the model, thereby reducing the risk of overfitting).
- the gradient descent method may include the original gradient descent method and various deformation methods based on the original gradient descent method (such as batch gradient descent method, regularized gradient descent method, etc.; regularized gradient descent method refers to a regularization term attached Gradient descent method; regularization can reduce the complexity and instability of the model, thereby reducing the risk of overfitting).
- the Newton method has a faster convergence rate.
- all parties in cooperative modeling prefer to use Newton's method to collaboratively determine the model parameters of the data processing model.
- Newton's method to collaboratively determine the model parameters of the data processing model.
- some cases for example, the proportion of positive and negative samples is unbalanced
- ill-conditioned matrices are prone to appear in the process of using Newton's method to determine model parameters, resulting in non-convergence of model parameters. Therefore, if the ill-conditioned degree of the Hessian matrix is judged in the process of using the Newton method to determine the model parameters, the problem of non-convergence caused by the ill-conditioned matrix in the process of using the Newton method to determine the model parameters can be avoided.
- the gradient descent method can be used instead of the Newton method to continue to optimize and adjust the model parameters to continue training the data processing model, thereby achieving adaptive selection of Newton Method or gradient descent method to optimize and adjust model parameters.
- An ill-conditioned matrix is a special matrix, which refers to a non-singular matrix with a large condition number.
- the inverse of the ill-conditioned matrix and the boundary of the system of equations using it as the coefficient matrix are very sensitive to small disturbances, which will bring great difficulties to the numerical solution.
- the condition number of the matrix can be used to measure the ill-conditioned degree of the matrix.
- represents norm operation, F -1 represents the inverse of matrix F matrix.
- Secret Sharing is an algorithm to protect data privacy. Multiple data parties can use secret sharing algorithms to perform collaborative calculations to obtain secret information without leaking their own data. Each data party can obtain a share of the secret information. A single data party cannot recover the secret information. Only multiple data parties can work together to recover the secret information.
- the data party P 1 owns the data x 1
- the data party P 2 owns the data x 2 .
- the data party P 1 can obtain the share y 1 of the secret information y after the calculation
- the data party P 2 can obtain the share y 2 of the secret information y after the calculation.
- the model parameter optimization method can be used to optimize and adjust the model parameters of the data processing model.
- the model parameter optimization method can be implemented by using a secret sharing algorithm.
- Loss function can be used to measure the degree of inconsistency between the predicted value of the data processing model and the true value. The smaller the value of the loss function, the better the robustness of the data processing model.
- the loss function includes but is not limited to a logarithmic loss function (Logarithmic Loss Function), a square loss function (Square Loss), and the like.
- the Hessian Matrix also known as the Hessian matrix, Hessian matrix or Hessian matrix, etc., is a square matrix formed by the second-order partial derivative of the loss function, used to express the local curvature of the loss function.
- Activation function also known as activation function, can be used to build data processing models.
- the excitation function defines the output at a given input. Through the excitation function, nonlinear factors can be added to the data processing model to improve the expressive ability of the data processing model.
- the activation function may include, for example, Sigmoid function, Tanh function, ReLU function, and so on.
- This specification provides an embodiment of a model parameter determination system.
- the model parameter determination system may include a first data party, a second data party, and a trusted third party (TTP, Trusted Third Party).
- TTP Trusted Third Party
- the third party may be one server; or, it may also be a server cluster including multiple servers.
- the third party may be used to provide random numbers to the first data party and the second data party.
- the third party may generate a random orthogonal matrix, and each random number in the random orthogonal matrix may be split into two shares, and one of the shares may be used as the first share, and the other share may be used as the first share.
- the second share may use the matrix formed by the first share of each random number in the random orthogonal matrix as the first share of the random orthogonal matrix, and calculate the second share of each random number in the random orthogonal matrix.
- the formed matrix is used as the second share of the random orthogonal matrix; the first share of the random orthogonal matrix may be sent to the first data party, and the random orthogonal matrix may be sent to the second data party Second share.
- the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
- the random orthogonal matrix may be a random number matrix composed of random numbers; on the other hand, the random orthogonal matrix may also be an orthogonal matrix. After a square matrix is multiplied by an orthogonal matrix, a new matrix can be obtained, and the new matrix has the same condition number as the square matrix.
- the first data party and the second data party are respectively two parties of cooperative security modeling.
- the first data party may be a data party that does not hold a tag
- the second data party may be a data party that has a tag.
- the first data party may hold complete feature data
- the second data party may hold a label of the feature data.
- the first data party may hold a part of the feature data
- the second data party may hold another part of the feature data and tags.
- the characteristic data may include the user's savings amount and loan amount.
- the first data party may hold the user's savings amount
- the second data party may hold the user's loan amount and the tag of the characteristic data.
- the tag can be used to distinguish different types of characteristic data, and the specific value can be taken from 0 and 1, for example.
- the data party here can be an electronic device.
- the electronic equipment may include a personal computer, a server, a handheld device, a portable device, a tablet device, a multi-processor device; or, it may also include a cluster formed by any of the above devices or devices.
- the feature data and its corresponding labels together constitute sample data, and the sample data can be used to train the data processing model.
- the first data party and the second data party may each obtain a share of the first model parameter.
- the share obtained by the first data party may be used as the first share of the first model parameter
- the share obtained by the second data party may be used as the second share of the first model parameter.
- the sum of the first share of the first model parameter and the second share of the first model parameter is equal to the first model parameter.
- the first data party may receive the first share of the random orthogonal matrix.
- the second data party may receive the second share of the random orthogonal matrix.
- the first data party may be based on the first share of the first model parameter, the characteristic data and the first share of the random orthogonal matrix
- the second data party may be based on the second share of the first model parameter, the label and the random
- the second share of the orthogonal matrix adopts a secret sharing method to collaboratively determine the new first model parameters.
- the first data party and the second data party may each obtain a share of the new first model parameter.
- model parameter determination method embodiment please refer to the following model parameter determination method embodiment.
- This specification also provides an embodiment of a method for determining model parameters.
- This embodiment may include the following steps.
- Step S101 The first data party secretly shares the first product according to the first share of the characteristic data and the first model parameter, and the second data party secretly shares the first product according to the second share of the first model parameter.
- the first data party gets the first share of the first product
- the second data party gets the second share of the first product.
- the first product is the product of the feature data and the first model parameter.
- Step S103 The first data party secretly shares the value of the incentive function according to the first share of the first product, and the second data party secretly shares the value of the incentive function according to the second share of the first product.
- the first data party obtains the first share of the value of the excitation function, and the second data party obtains the second share of the value of the excitation function.
- Step S105 The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the gradient of the loss function based on the label and the second share of the incentive function.
- the first data party obtains the first share of the loss function gradient, and the second data party obtains the second share of the loss function gradient.
- Step S107 The first data party obtains the first share of the value based on the characteristic data and the incentive function, and the second data party secretly shares the Hessian matrix according to the second share of the value obtained by the incentive function.
- the first data party gets the first share of the Hessian matrix
- the second data party gets the second share of the Hessian matrix.
- Step S109 The first data party secretly shares the first share according to the first share of the random orthogonal matrix and the first share of the Hessian matrix, and the second data party secretly shares the first share according to the second share of the random orthogonal matrix and the second share of the Hessian matrix.
- Two products The first data party gets the first share of the second product, and the second data party gets the second share of the second product.
- the second product is a product between a random orthogonal matrix and a Hessian matrix.
- Step S111 When the condition number of the second product satisfies the preset condition, the first data party secretly shares the first inverse matrix according to the first share of the Hessian matrix, and the second data party secretly shares the first inverse matrix according to the second share of the Hessian matrix.
- the first data party obtains the first share of the first inverse matrix, and the second data party obtains the second share of the first inverse matrix.
- the first inverse matrix is the inverse matrix of the Hessian matrix.
- Step S113 The first data party according to the first share of the first model parameter, the first share of the first inverse matrix and the first share of the loss function gradient, and the second data party according to the second share, first share of the first model parameter
- the second share of the inverse matrix and the second share of the gradient of the loss function secretly share the new first model parameters.
- the first data party gets the first share of the new first model parameter
- the second data party gets the second share of the new first model parameter.
- the first product, the second product, the third product, the fourth product and the fifth product may be a product between the first model parameter and the feature data.
- the second product may be a product between a random orthogonal matrix and a Hessian matrix.
- the third product may be the product between the inverse matrix of the Hessian matrix and the gradient of the loss function.
- the fourth product may be the product of the first share of the gradient of the loss function and the preset step size.
- the fifth product may be the product of the second share of the gradient of the loss function and the preset step size.
- the first product may be expressed as XW; where W represents a first model parameter, specifically a vector formed by the first model parameter; X represents feature data, specifically a matrix formed by feature data.
- the second product may be expressed as HR, where H represents a Hessian matrix, and R represents a random orthogonal matrix.
- the third product may be expressed as H -1 dW, where H -1 represents the inverse matrix of the Hessian matrix, dW represents the gradient of the loss function, and dW is a vector.
- the fourth product may be expressed as G ⁇ dW> 0
- the fifth product may be expressed as G ⁇ dW> 1 .
- G represents the preset step size
- ⁇ dW> 0 represents the first share of the loss function gradient
- ⁇ dW> 1 represents the second share of the loss function gradient
- ⁇ dW> 0 + ⁇ dW> 1 dW.
- the first inverse matrix and the second inverse matrix Since the Hessian matrix is a square matrix, the Hessian matrix can be inverted, and the inverse matrix of the Hessian matrix can be used as the first inverse matrix.
- the second product may be a square matrix, and thus the second product may be inverted, and the inverse matrix of the second product may be used as the second inverse matrix.
- the first inverse matrix may be expressed as H -1
- the second inverse matrix may be expressed as (HR) -1 .
- the first data party may secretly share according to the feature data and the first share of the first model parameter, and the second data party may secretly share according to the second share of the first model parameter.
- the first data party and the second data party may each obtain a share of the first product.
- the share obtained by the first data party may be used as the first share of the first product
- the share obtained by the second data party may be used as the second share of the first product.
- the sum of the first share of the first product and the second share of the first product is equal to the first product.
- the first share of the first model parameter can be expressed as ⁇ W> 0
- the first data party may secretly share the first product XW according to X and ⁇ W> 0
- the second data party may secretly share the first product XW according to ⁇ W> 1 .
- the first data party can obtain the first share of the first product ⁇ XW> 0
- the second data party can obtain the second share of the first product ⁇ XW> 1 .
- ⁇ XW> 0 + ⁇ XW> 1 XW.
- the first data party may secretly share the value of the polynomial according to the first share of the first product
- the second data party may secretly share the value of the polynomial according to the second share of the first product.
- the first data party and the second data party may respectively obtain a share of the value of the polynomial.
- the polynomial can be used to fit the activation function of the data processing model. In this way, the share obtained by the first data party may be used as the first share of the value of the incentive function, and the share obtained by the second data party may be used as the second share of the value of the incentive function.
- the sum of the first share of the value of the excitation function and the second share of the value of the excitation function is equal to the value of the excitation function.
- the excitation function may be a Sigmoid function.
- the first share of the value of the excitation function may be expressed as ⁇ a> 0
- the second share of the value of the excitation function may be expressed as ⁇ a> 1 .
- ⁇ a> 0 + ⁇ a> 1 a.
- ⁇ a> 0 , ⁇ a> 1, and a are vectors respectively.
- the first data party may take a first share of the value based on the characteristic data and the activation function
- the second data party may take a second share of the value based on the label and the activation function, Secretly share the gradient of the loss function.
- the first data party and the second data party may obtain a share of the gradient of the loss function respectively.
- the share obtained by the first data party may be used as the first share of the loss function gradient
- the share obtained by the second data party may be used as the second share of the loss function gradient.
- the sum of the first share of the gradient of the loss function and the second share of the gradient of the loss function is equal to the gradient of the loss function.
- the first data party can secretly share the gradient dW (specifically a vector) of the loss function based on X and ⁇ a> 0
- the second data party can secretly share the gradient dW of the loss function based on the label Y and ⁇ a> 1
- the first data party can obtain the first share of the loss function gradient ⁇ dW> 0
- the second data party can obtain the second share of the loss function gradient ⁇ dW> 1 .
- the party may be the first data X
- the second party data may ⁇ a> 1, secret sharing X T ⁇ a> 1.
- the first data party can obtain ⁇ [X T ⁇ a> 1 ]> 0
- the second data party can obtain ⁇ [X T ⁇ a> 1 ]> 1 .
- ⁇ [X T ⁇ a> 1 ]> 0 + ⁇ [X T ⁇ a> 1 ]> 1 X T ⁇ a> 1 .
- the first data party may also secretly share X T Y according to X
- the second data party may also secretly share X T Y according to tag Y (specifically, a vector formed by tags).
- the first data party can obtain ⁇ X T Y> 0
- the second data party can obtain ⁇ X T Y> 1 .
- ⁇ X T Y> 0 + ⁇ X T Y> 1 X T Y.
- the first data party can calculate X T ⁇ a> 0 ; can calculate X T ⁇ a> 0 + ⁇ [X T ⁇ a> 1 ]> 0 - ⁇ X T Y> 0 as the first of the loss function gradient dW Share ⁇ dW> 0 .
- the second data party may calculate ⁇ [X T ⁇ a> 1 ]> 1- ⁇ X T Y> 1 as the second share of the loss function gradient dW ⁇ dW> 1 .
- the first data party may obtain the first share of the value based on the characteristic data and the incentive function, and the second data party may secretly share the second share of the value based on the incentive function.
- Hessian matrix The first data party and the second data party may obtain a share of the Hessian matrix respectively.
- the share obtained by the first data party may be used as the first share of the Hessian matrix
- the share obtained by the second data party may be used as the second share of the Hessian matrix.
- the sum of the first share of the Hessian matrix and the second share of the Hessian matrix is equal to the Hessian matrix.
- the first data party may secretly share the diagonal matrix according to the first share of the value of the incentive function
- the second data party may secretly share the diagonal matrix according to the second share of the value of the incentive function.
- the first data party and the second data party may obtain a share of the diagonal matrix respectively.
- the share obtained by the first data party may be used as the first share of the diagonal matrix
- the share obtained by the second data party may be used as the second share of the diagonal matrix.
- the sum of the first share of the diagonal matrix and the second share of the diagonal matrix is equal to the diagonal matrix.
- the first data party can secretly share the Hessian matrix according to the feature data and the first share of the diagonal matrix
- the second data party can secretly share the Hessian matrix according to the second share of the diagonal matrix.
- the first data party can obtain the first share of the Hessian matrix
- the second data party can obtain the second share of the Hessian matrix.
- the first data party can secretly share the diagonal matrix RNN according to ⁇ a> 0 and the second data party can secretly share the diagonal matrix RNN according to ⁇ a> 1 .
- the first data party can obtain the first share RNN 0 of the diagonal matrix, and the second data party can obtain the second share RNN 1 of the diagonal matrix.
- the first party data may ⁇ a> 0, the second party data may ⁇ a> 1, secret sharing ⁇ a> 0 ⁇ ⁇ a> 1.
- the first data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0
- the second data party can obtain ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 .
- ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 0 + ⁇ [ ⁇ a> 0 ⁇ a> 1 ]> 1 ⁇ a> 0 ⁇ a> 1 .
- ⁇ represents the bitwise multiplication operation. For example, vector vector Then,
- ⁇ r> 0 ⁇ r> 1
- the first party data may be ⁇ r> as data element 0 of the data element on the main diagonal RNN 0, thus achieved under ⁇ r> 0 0 RNN generated; may ⁇ r> 1 data element as a data element on the main diagonal RNN 1, thus realized ⁇ r> 1 generated according RNN 1.
- the first data party can secretly share the Hessian matrix H according to X and RNN 0
- the second data party can secretly share the Hessian matrix H according to RNN 1 .
- the first data party can obtain the first share ⁇ H> 0 of the Hessian matrix
- the second data party can obtain the second share ⁇ H> 1 of the Hessen matrix.
- the party may be the first data X
- the second party data may RNN 1, secret sharing X T RNN 1.
- the first data party can obtain ⁇ X T RNN 1 > 0
- the second data party can obtain ⁇ X T RNN 1 > 1 .
- ⁇ X T RNN 1 > 0 + ⁇ X T RNN 1 > 1 X T RNN 1 .
- the first party data may also according to X
- the second party may also be in accordance with data ⁇ X T RNN 1> 1, secret sharing ⁇ X T RNN 1> 1 X.
- the first data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 0
- the second data party can obtain ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 .
- the first data party can calculate X T RNN 0 X+ ⁇ X T RNN 1 > 0 X+ ⁇ [ ⁇ X T RNN 1 > 1 X]> 0 as the first share of the Hessian matrix H ⁇ H> 0 .
- the second data party may use ⁇ [ ⁇ X T RNN 1 > 1 X]> 1 as the second share of the Hessian matrix H ⁇ H> 0 .
- the third party may issue the first share of the random orthogonal matrix to the first data party; may issue the second share of the random orthogonal matrix to the second data party.
- the sum of the first share of the random orthogonal matrix and the second share of the random orthogonal matrix is equal to the random orthogonal matrix.
- the first data party may receive a first share of a random orthogonal matrix
- the second data party may receive a second share of a random orthogonal matrix.
- the first data party can be based on the first share of the random orthogonal matrix and the first share of the Hessian matrix
- the second data party can be based on the second share of the random orthogonal matrix and the first share of the Hessian matrix.
- the second share of the matrix secretly shares the second product.
- the first data party and the second data party may each obtain a share of the second product.
- the share obtained by the first data party may be used as the first share of the second product
- the share obtained by the second data party may be used as the second share of the second product.
- the sum of the first share of the second product and the second share of the second product is equal to the second product.
- the first share of the random orthogonal matrix can be expressed as ⁇ R> 0
- the first data party may secretly share the second product HR according to ⁇ R> 0 and ⁇ H> 0
- the second data party may secretly share the second product HR according to ⁇ R> 1 and ⁇ H> 1
- the first data party can obtain the first share of the second product ⁇ HR> 0
- the second data party can obtain the second product second share ⁇ HR> 1 .
- the first party data may ⁇ H> 0, the second party data may ⁇ R> 1, secret sharing ⁇ H> 0 ⁇ R> 1 .
- the first data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0
- the second data party can obtain ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 .
- ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 ⁇ H> 0 ⁇ R> 1 .
- the first data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ R> 0 and the second data party may also secretly share ⁇ H> 1 ⁇ R> 0 according to ⁇ H> 1 .
- the first data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0
- the second data party can obtain ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 .
- ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 ⁇ H> 1 ⁇ R> 0 .
- the first data party can calculate ⁇ H> 0 ⁇ R> 0 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 0 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 0 as the second product of One share ⁇ HR> 0 .
- the second data party can calculate ⁇ H> 1 ⁇ R> 1 + ⁇ [ ⁇ H> 0 ⁇ R> 1 ]> 1 + ⁇ [ ⁇ H> 1 ⁇ R> 0 ]> 1 as the second product of Second share ⁇ HR> 1 .
- the preset condition may include: the number of conditions is less than or equal to a preset threshold.
- the preset threshold may be an empirical value, or it may also be obtained by other means (for example, a machine learning method).
- Both the first data party and the second data party may hold the preset conditions. Furthermore, the first data party and the second data party may respectively determine whether the condition number of the second product satisfies the preset condition.
- the condition number of the second product may be calculated by the first data party. Specifically, the second data party may send the second share of the second product to the first data party. The first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; may calculate the second product The condition number of the second product can be determined whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the second data party.
- the second data party can receive the condition number of the second product; and can determine whether the condition number of the second product meets the preset condition. In some other embodiments, the second data party may also calculate the condition number of the second product. Specifically, the first data party may send the first share of the second product to the second data party. The second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product The condition number of the second product can be judged whether the condition number of the second product meets the preset condition; the condition number of the second product can be sent to the first data party. The first data party can receive the condition number of the second product; and can judge whether the condition number of the second product meets the preset condition.
- the second data party may send the second share of the second product to the first data party.
- the first data party may receive the second share of the second product; may add the second share of the second product to the first share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the second data party.
- the second data party may receive the judgment result information.
- only the second data party may hold the preset condition, and then only the second data party may determine whether the condition number of the second product meets the preset condition.
- the first data party may send the first share of the second product to the second data party.
- the second data party may receive the first share of the second product; may add the first share of the second product to the second share of the second product held by itself to obtain the second product; and may calculate the second product It is possible to judge whether the condition number of the second product satisfies the preset condition; it is possible to send the judgment result information to the first data party.
- the first data party may receive the judgment result information.
- a square matrix can be multiplied by an orthogonal matrix to obtain a new matrix, which has the same condition number as the square matrix. Since the Hessian matrix is a square matrix, the condition number of the second product is equal to the condition number of the Hessian matrix. In this way, the first data party and the second data party can collaboratively calculate the condition number of the Hessian matrix without leaking their share of the Hessian matrix.
- the condition number of the second product satisfies the preset condition, indicating that the second product is less ill-conditioned, that is, it indicates that the Hessian matrix is less ill-conditioned, so the Newton method can be used to determine the model parameters.
- the first data party may secretly share the first inverse matrix according to the first share of the Hessian matrix
- the second data party may secretly share the first inverse matrix according to the second share of the Hessian matrix.
- the first data party can obtain a first share of the first inverse matrix
- the second data party can obtain a second share of the first inverse matrix.
- the second product may be inverted by the second data party.
- the first data party may send the first share of the second product to the second data party.
- the second data party may receive the first share of the second product; may add the first share of the second product to the second share of its own second product to obtain the second product. Since the second product is a square matrix, the second data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix.
- the first data party may receive the second inverse matrix.
- the first data party may also invert the second product. Specifically, the second data party may send the second share of the second product to the first data party.
- the first data party may receive the second share of the second product; may add the second share of the second product to the first share of its own second product to obtain the second product. Since the second product is a square matrix, the first data party can perform inverse processing on the second product to obtain the inverse matrix of the second product as the second inverse matrix; The data party sends the second inverse matrix. The second data party may receive the second inverse matrix.
- the first data party may multiply the first share of the random orthogonal matrix by the second inverse matrix to obtain the first share of the first inverse matrix.
- the second data party may multiply the second share of the random orthogonal matrix by the second inverse matrix to obtain the second share of the first inverse matrix.
- the sum of the first share of the first inverse matrix and the second share of the first inverse matrix is equal to the first inverse matrix.
- the second data party inverts the second product HR.
- the first data party may send the first share of the second product ⁇ HR> 0 to the second data party.
- the second data party may receive the first share of the second product ⁇ HR> 0 ; may add the first share of the second product ⁇ HR> 0 to its second share of the second product ⁇ HR> 1 , second product to give the HR; inversion process may be performed on the second product HR, to obtain a second inverse matrix (HR) -1; may send a second inverse matrix (HR) -1 to the first party data.
- the first data party may receive the second inverse matrix (HR) -1 .
- the first data party may multiply the second inverse matrix (HR) -1 by the first share of the random orthogonal matrix ⁇ R> 0 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 0 .
- the second data party may multiply the second inverse matrix (HR) -1 by the second share of the random orthogonal matrix ⁇ R> 1 to obtain the first share of the first inverse matrix H -1 ⁇ H -1 > 1 .
- the first data party may be based on the first share of the first inverse matrix and the first share of the loss function gradient
- the second data party may be based on the first share of the first inverse matrix.
- the second share and the second share of the gradient of the loss function secretly share the third product.
- the first data party and the second data party may each obtain a share of the third product.
- the share obtained by the first data party may be used as the first share of the third product
- the share obtained by the second data party may be used as the second share of the third product.
- the sum of the first share of the third product and the second share of the third product is equal to the third product.
- the first data party may subtract the first share of the first model parameter from the first share of the third product to obtain the first share of the new first model parameter.
- the second data party may subtract the second share of the first model parameter from the second share of the third product to obtain the second share of the new first model parameter.
- the first data party can secretly share the third party according to ⁇ H -1 > 0 and ⁇ dW> 0
- the second data party can secretly share the third party according to ⁇ H -1 > 1 and ⁇ dW> 1
- the first data party can obtain the first share of the third product ⁇ H -1 ⁇ dW> 0
- the second data party can obtain the second share of the third product ⁇ H -1 ⁇ dW> 1 .
- the first party data may ⁇ H -1> 0, the second party data may ⁇ dW> 1, secret sharing ⁇ H -1> 0 ⁇ dW> 1.
- the first data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0
- the second data party can obtain ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 .
- ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 ⁇ H -1 > 0 ⁇ dW> 1 .
- the first data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ dW> 0 and the second data party can also secretly share ⁇ H -1 > 1 ⁇ dW> 0 according to ⁇ H -1 > 1 .
- the first data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
- the second data party can obtain ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1 .
- ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1 ⁇ H -1 > 1 ⁇ dW> 0 .
- the first data party can calculate ⁇ H -1 > 0 ⁇ dW> 0 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 0 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 0
- the first share as the third product ⁇ H -1 ⁇ dW> 0
- the second data party can calculate ⁇ H -1 > 1 ⁇ dW> 1 + ⁇ [ ⁇ H -1 > 0 ⁇ dW> 1 ]> 1 + ⁇ [ ⁇ H -1 > 1 ⁇ dW> 0 ]> 1
- the second share as the third product ⁇ H -1 ⁇ dW> 1 .
- H -1 ⁇ dW ⁇ H -1 ⁇ dW> 0 + ⁇ H -1 ⁇ dW> 1
- the condition number of the second product does not satisfy the preset condition, which indicates that the second product is ill-conditioned, which means that the Hessian matrix is ill-conditioned, and the Newton method cannot be used to determine the model parameters.
- the gradient descent method can be used instead of Newton's method to determine the model parameters.
- the first data party may calculate the first share of the new first model parameter according to the first share of the first model parameter, the first share of the loss function gradient, and the preset step size.
- the second data party may calculate the second share of the new first model parameter according to the second share of the first model parameter, the second share of the loss function gradient, and the preset step size.
- the preset step length can be used to control the iteration speed of the gradient descent method.
- the preset step length can be any suitable positive real number. For example, when the preset step size is too large, the iteration speed will be too fast, resulting in the possibility that the optimal model parameters cannot be obtained. When the preset step size is too small, the iteration speed will be too slow, resulting in a longer time.
- the preset step length may specifically be an empirical value; or, it may also be obtained by means of machine learning. Of course, the preset step length can also be obtained in other ways. Both the first data party and the second data party may hold the preset step size.
- the first data party may multiply the first share of the loss function gradient by the preset step size to obtain the fourth product; may subtract the first share of the first model parameter and the fourth product to obtain a new first The first share of model parameters.
- the second data party may multiply the second share of the loss function gradient by the preset step size to obtain the fifth product; may subtract the second share of the first model parameter and the fifth product to obtain the new first The second share of model parameters.
- the sum of the first share of the new first model parameter and the second share of the new first model parameter is equal to the new first model parameter.
- the second data party may multiply the second share of the gradient of the loss function ⁇ dW> 1 (specifically a vector) by the preset step size G (specifically a multiplication of the vector) to obtain the fifth product G ⁇ dW> 1 ;
- ⁇ W'> 0 + ⁇ W'> 1 W'
- W' represents the new first model parameter.
- it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
- Step S101 may be repeatedly executed, the first data party can obtain the first share of the new first product, and the second data party can obtain the second share of the new first product.
- the new first product is the product of the feature data and the new first model parameter.
- Step S103 may be repeatedly executed, the first data party can obtain the first share of the new excitation function value, and the second data party can obtain the second share of the new excitation function value.
- Step S105 may be repeated, and the first data party can obtain the first share of the new loss function gradient, and the second data party can obtain the second share of the new loss function gradient.
- Step S107 can be repeated, the first data party can obtain the first share of the new Hessian matrix, and the second data party can obtain the second share of the new Hessian matrix.
- Step S109 may be repeated, the first data party can obtain the first share of the new second product, and the second data party can obtain the second share of the new second product.
- the new second product is the product of the random orthogonal matrix and the new Hessian matrix
- Step S111 can be repeated.
- the first data party can obtain the first share of the new first inverse matrix
- the second data party can obtain the second share of the new first inverse matrix.
- the new first inverse matrix is the inverse of the new Hessian matrix.
- the first data party may be based on the first share of the new first model parameter, the first share of the new first inverse matrix, and the first share of the new loss function gradient, and the second data party may be based on the new first share.
- the second share of a model parameter, the second share of the new first inverse matrix and the second share of the new loss function gradient secretly share the second model parameters.
- the first data party can obtain a first share of the second model parameter
- the second data party can obtain a second share of the second model parameter.
- the sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
- the first data party may calculate the first share of the second model parameter according to the first share of the new first model parameter, the first share of the new loss function gradient, and the preset step size.
- the second data party may calculate the second share of the second model parameter according to the second share of the new first model parameter, the second share of the new loss function gradient, and the preset step size. The sum of the first share of the second model parameter and the second share of the second model parameter is equal to the second model parameter.
- the first data party and the second data party can use a secret sharing algorithm to collaboratively determine the model parameters of the data processing model without leaking the data they own.
- the method for determining model parameters of this embodiment can avoid the problem of non-convergence caused by ill-conditioned matrices in the process of determining model parameters using the Newton method.
- this specification also provides an embodiment of another method for determining model parameters.
- the first data party is the execution subject, and the first data party may hold the share of the feature data and the first model parameter.
- This embodiment may include the following steps.
- Step S201 secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter.
- the cooperating party may be understood as a data party that performs cooperative security modeling with the first data party, and specifically may be the previous second data party.
- Step S203 According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
- the first data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
- Step S205 secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the characteristic data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively.
- Step S207 secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product.
- the second product is the product of the random orthogonal matrix and the Hessian matrix .
- Step S209 When the condition number of the second product meets the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
- the preset condition may include: the number of conditions is less than or equal to a preset threshold.
- the condition number of the second product can be calculated by the first data party and/or the partner.
- the condition number of the second product is equal to the condition number of the Hessian matrix.
- condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters.
- the first data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
- Step S211 secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter.
- the first data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
- the third product may be a product between the first inverse matrix and the gradient of the loss function.
- the first data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
- the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. .
- the first data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. Specifically, the first data party may multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
- it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
- the first data party may repeat step S201, step S203, step S205, and step S207.
- the first data party may repeat step S209. The first data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
- the first data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
- the first data party can use the secret sharing algorithm to determine the model parameters of the data processing model in collaboration with the partner without leaking the data it owns, and obtain a share of the new first model parameters.
- this specification also provides an embodiment of another method for determining model parameters.
- the second data party is the execution subject, and the second data party may hold the share of the tag and the first model parameter.
- This embodiment may include the following steps.
- Step S301 According to the share of the first model parameter and the partner secretly share the first product to obtain the share of the first product, the first product is the product of the feature data and the first model parameter.
- the cooperating party may be understood as a data party that performs cooperative security modeling with the second data party, and specifically may be the previous first data party.
- Step S303 According to the share of the first product and the partner secretly share the value of the incentive function, the share of the value of the incentive function is obtained.
- the second data party may secretly share the value of the polynomial with the partner according to the share of the first product, and obtain the share of the polynomial value as the share of the value of the incentive function, and the polynomial is used for fitting The activation function.
- Step S305 secretly share the gradient of the loss function with the partner according to the value of the label and the incentive function to obtain the share of the gradient of the loss function; according to the share of the incentive function, secretly share the Hessian matrix with the partner to obtain the Hessian matrix Share.
- Step S307 secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the product between the random orthogonal matrix and the Hessian matrix .
- Step S309 When the condition number of the second product satisfies the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix, and the first inverse matrix is the Hessian matrix The inverse matrix.
- the preset condition may include: the number of conditions is less than or equal to a preset threshold.
- the condition number of the second product can be calculated by the second data party and/or the partner.
- the condition number of the second product is equal to the condition number of the Hessian matrix.
- condition number of the second product satisfies the preset condition, indicating that the degree of ill-condition of the second product is small, and Newton's method can be used to determine the model parameters.
- the second data party can secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
- Step S311 According to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter, secretly share the new first model parameter with the partner to obtain the share of the new first model parameter.
- the second data party may secretly share the third product with the partner according to the share of the first inverse matrix and the share of the loss function gradient to obtain the share of the third product.
- the third product may be a product between the first inverse matrix and the gradient of the loss function.
- the second data party may subtract the share of the first model parameter from the share of the third product to obtain a new share of the first model parameter.
- the condition number of the second product does not satisfy the preset condition, indicating that the second product is ill-conditioned and cannot be determined using Newton's method. Therefore, gradient descent method can be used instead of Newton's method to determine model parameters. .
- the second data party may calculate the share of the new first model parameter according to the share of the first model parameter, the share of the loss function gradient, and the preset step length. The second data party may specifically multiply the share of the loss function gradient by the preset step length to obtain the fourth product; may subtract the share of the first model parameter and the fourth product to obtain the new first model parameter Share.
- it may also include a process of iterative optimization and adjustment of the model parameters of the data processing model.
- the second data party may repeat step S301, step S303, step S305, and step S307.
- the second data party may repeat step S309. The second data party may then secretly share the second model parameter with the partner according to the share of the new first inverse matrix, the share of the new loss function gradient, and the share of the new first model parameter to obtain the second model parameter Share.
- the second data party may calculate the share of the second model parameter according to the share of the new first model parameter, the share of the new loss function gradient, and the preset step length.
- the second data party can use the secret sharing algorithm to determine the model parameters of the data processing model in collaboration with the partner without leaking the data it owns, and obtain the share of the new first model parameter.
- this specification also provides an embodiment of a model parameter determination device. Please refer to Figure 5.
- This embodiment can be applied to the first data party and can include the following units.
- the first secret sharing unit 401 is configured to secretly share the first product with the partner according to the share of the feature data and the first model parameter to obtain the share of the first product, and the first product is the product of the feature data and the first model parameter ;
- the second secret sharing unit 403 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
- the third secret sharing unit 405 is configured to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the share of the feature data and the value of the incentive function, and obtain the share of the gradient of the loss function and the Hessian matrix respectively;
- the fourth secret sharing unit 407 is configured to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea.
- the fifth secret sharing unit 409 is configured to secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix when the condition number of the second product meets the preset condition.
- the inverse matrix is the inverse matrix of the Hessian matrix;
- the sixth secret sharing unit 411 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter .
- this specification also provides an embodiment of a model parameter determination device. Please refer to Figure 6.
- This embodiment can be applied to the second data party and can include the following units.
- the first secret sharing unit 501 is configured to secretly share the first product with the partner according to the share of the first model parameter to obtain the share of the first product, where the first product is the product of the feature data and the first model parameter;
- the second secret sharing unit 503 is configured to secretly share the value of the incentive function with the partner according to the share of the first product to obtain the share of the value of the incentive function;
- the third secret sharing unit 505 is used to secretly share the gradient of the loss function and the Hessian matrix with the partner according to the value of the incentive function to obtain the share of the gradient of the loss function and the Hessian matrix respectively;
- the fourth secret sharing unit 507 is configured to secretly share the second product with the partner according to the share of the random orthogonal matrix and the share of the Hessian matrix to obtain the share of the second product, and the second product is the random orthogonal matrix and the sea.
- the fifth secret sharing unit 509 is configured to, when the condition number of the second product meets the preset condition, secretly share the first inverse matrix with the partner according to the share of the Hessian matrix to obtain the share of the first inverse matrix.
- the inverse matrix is the inverse matrix of the Hessian matrix;
- the sixth secret sharing unit 511 is used to secretly share the new first model parameter with the partner according to the share of the first inverse matrix, the share of the loss function gradient, and the share of the first model parameter to obtain the share of the new first model parameter .
- FIG. 7 is a schematic diagram of the hardware structure of an electronic device in this embodiment.
- the electronic device may include one or more (only one is shown in the figure) processor, memory, and transmission module.
- processor any electronic device that can be included in the electronic device.
- memory any type of memory
- transmission module any type of transmission module.
- the hardware structure shown in FIG. 7 is only for illustration, which does not limit the hardware structure of the above electronic device.
- the electronic device may also include more or fewer component units than shown in FIG. 7; or, have a different configuration from that shown in FIG. 7.
- the memory may include a high-speed random access memory; or, it may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
- the storage may also include a remotely set network storage.
- the remotely set network storage can be connected to the electronic device through a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
- the memory may be used to store program instructions or modules of application software, such as the program instructions or modules of the embodiment corresponding to FIG. 3 of this specification; and/or, the program instructions or modules of the embodiment corresponding to FIG. 4 of this specification.
- the processor can be implemented in any suitable way.
- the processor may take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program codes (for example, software or firmware) executable by the (micro)processor, logic gates, switches, special-purpose integrated Circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller and embedded microcontroller form, etc.
- the processor can read and execute program instructions or modules in the memory.
- the transmission module can be used for data transmission via a network, for example, data transmission via a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
- a network such as the Internet, an intranet, a local area network, a mobile communication network, and the like.
- a programmable logic device Programmable Logic Device, PLD
- FPGA Field Programmable Gate Array
- HDL Hardware Description Language
- a typical implementation device is a computer.
- the computer may be, for example, a personal computer, a laptop computer, a cell phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or Any combination of these devices.
- This manual can be used in many general or special computer system environments or configurations.
- program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
- This specification can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network.
- program modules can be located in local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Data Mining & Analysis (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种模型参数确定方法、装置和电子设备。所述方法包括:使用牛顿法,根据特征数据和第一模型参数的份额,采用秘密分享的方式,确定新的第一模型参数的份额;进而,使用梯度下降法,根据特征数据和新的第一模型参数的份额,采用秘密分享的方式,确定第二模型参数的份额。
Description
本说明书实施例涉及计算机技术领域,特别涉及一种模型参数确定方法、装置和电子设备。
大数据时代,存在非常多的数据孤岛。数据通常分散存于不同的企业中,企业与企业之间由于竞争关系和隐私保护的考虑,并不是完全的互相信任。在一些情况下,企业与企业之间需要进行合作安全建模,以便在充分保护企业数据隐私的前提下,使用各方的数据对数据处理模型进行协作训练。
在对数据处理模型进行协作训练的过程中,可以使用模型参数优化方法对数据处理模型的模型参数进行多次优化调整。由于用于对数据处理模型进行训练的数据是分散在合作建模的各方的,因此如何在保护数据隐私的条件下,协作确定数据处理模型的模型参数,是当前亟需解决的技术问题。
发明内容
本说明书实施例的目的是提供一种模型参数确定方法、装置和电子设备,以在保护数据隐私的前提下,由多方协作确定数据处理模型的模型参数。
为实现上述目的,本说明书中一个或多个实施例提供的技术方案如下。
根据本说明书一个或多个实施例的第一方面,提供了一种模型参数确定方法,应用于第一数据方,包括:根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一 逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
根据本说明书一个或多个实施例的第二方面,提供了一种模型参数确定方法,应用于第二数据方,包括:根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
根据本说明书一个或多个实施例的第三方面,提供了一种模型参数确定装置,应用于第一数据方,包括:第一秘密分享单元,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;第三秘密分享单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
根据本说明书一个或多个实施例的第四方面,提供了一种模型参数确定装置,应用于第二数据方,包括:第一秘密分享单元,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到 激励函数取值的份额;第三秘密分享单元,用于根据激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
根据本说明书一个或多个实施例的第五方面,提供了一种电子设备,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令以实现如第一方面所述的方法步骤。
根据本说明书一个或多个实施例的第六方面,提供了一种电子设备,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令以实现如第二方面所述的方法步骤。
由以上本说明书实施例提供的技术方案可见,本说明书实施例,第一数据方和第二数据方可以利用秘密分享算法,在不泄漏自身所拥有的数据的前提下,协作确定数据处理模型的模型参数。另外,通过条件数和预设条件,本实施例的模型参数确定方法可以避免在使用牛顿法确定模型参数的过程中由于出现病态矩阵所导致的不收敛问题。
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本说明书实施例一种模型参数确定系统的示意图;
图2为本说明书实施例一种模型参数确定方法的流程图;
图3为本说明书实施例一种模型参数确定方法的流程图;
图4为本说明书实施例一种模型参数确定方法的流程图;
图5为本说明书实施例一种模型参数确定装置的示意图;
图6为本说明书实施例一种模型参数确定装置的示意图;
图7为本说明书实施例一种电子设备的功能结构图。
下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
模型参数优化方法可以包括梯度下降法、牛顿法等。所述牛顿法可以包括原始牛顿法以及基于原始牛顿法的各种变形方法(诸如阻尼牛顿法、正则化牛顿法等等;正则化牛顿法是指附带了正则化项的牛顿法;正则化可以降低模型的复杂度和不稳定程度,从而降低过拟合的危险)。所述梯度下降法可以包括原始梯度下降法以及基于原始梯度下降法的各种变形方法(诸如批量梯度下降法、正则化梯度下降法等等;正则化梯度下降法是指附带了正则化项的梯度下降法;正则化可以降低模型的复杂度和不稳定程度,从而降低过拟合的危险)。
相较于梯度下降法,牛顿法有着更快的收敛速度。为了减少模型参数优化调整的次数,提高数据处理模型的训练效率,合作建模各方优先使用牛顿法协作确定数据处理模型的模型参数。但一些情况下(例如正负样本比例不均衡),在使用牛顿法确定模型参数的过程中容易出现病态矩阵,导致模型参数不收敛。因此若在使用牛顿法确定模型参数的过程中判断海森矩阵的病态程度,则可以避免在使用牛顿法确定模型参数的过程中由于出现病态矩阵所导致的不收敛问题。另外,若在使用牛顿法确定模型参数的过程中出现了病态矩阵,则还可以使用梯度下降法代替牛顿法继续优化调整模型参数,以对数据处理模型继续进行训练,从而实现自适应地选择牛顿法或梯度下降法来优化调整模型参数。
病态矩阵是一种特殊矩阵,指条件数较大的非奇异矩阵。病态矩阵的逆和以其为系数矩阵的方程组的界对微小扰动十分敏感,对数值求解会带来很大困难。
矩阵的条件数可以用于度量该矩阵的病态程度。矩阵的条件数越大,则表示该矩阵的病态程度越大;矩阵的条件数越小,则表示该矩阵的病态程度越小。矩阵的条件数等于该矩阵的范数与该矩阵的逆的范数的乘积。例如,cond(F)=||F||×||F
-1||,cond(F)表 示矩阵F的条件数,|| ||表示取范数运算,F
-1表示矩阵F的逆矩阵。
秘密分享(SS,Secret Sharing)是一种保护数据隐私安全的算法。多个数据方可以在不泄漏自身数据的前提下,使用秘密分享算法进行协作计算,得到秘密信息。每个数据方可以获得该秘密信息的一份份额。单个数据方无法恢复该秘密信息。只有多个数据方一同协作才能恢复该秘密信息。例如数据方P
1拥有数据x
1,数据方P
2拥有数据x
2。采用秘密分享算法,数据方P
1和数据方P
2可以进行协作计算,得到秘密信息y=y
1+y
2=x
1x
2。数据方P
1在计算后可以获得秘密信息y的份额y
1,数据方P
2在计算后可以获得秘密信息y的份额y
2。
在合作安全建模的场景中,出于保护数据隐私的考虑,多个数据方可以在不泄漏自身所拥有的数据的前提下,基于自身拥有的数据,对数据处理模型进行协作训练。所述数据处理模型包括但不限于逻辑回归模型、神经网络模型等。在对数据处理模型进行训练的过程中,可以利用模型参数优化方法对数据处理模型的模型参数进行优化调整。考虑到在合作安全建模的场景中,用于对数据处理模型进行训练的数据分散在合作建模的各数据方。因此在合作安全建模的场景中,所述模型参数优化方法可以采用秘密分享算法来实现。
损失函数(Loss Function)可以用于衡量数据处理模型的预测值与真实值之间不一致的程度。损失函数的值越小,表示数据处理模型的鲁棒性越好。所述损失函数包括但不限于对数损失函数(Logarithmic Loss Function)、平方损失函数(Square Loss)等。
海森矩阵(Hessian Matrix),又称为黑塞矩阵、海瑟矩阵或海塞矩阵等,是损失函数的二阶偏导数所构成的方阵,用于表示损失函数的局部曲率。
激励函数(Activation Function),又称为激活函数,可以用于构建数据处理模型。激励函数定义了在给定输入下的输出。通过激励函数可以在数据处理模型中加入非线性因素,提高数据处理模型的表达能力。所述激励函数例如可以包括Sigmoid函数、Tanh函数和ReLU函数等等。
本说明书提供一种模型参数确定系统的实施例。
请参阅图1。在该实施例中,所述模型参数确定系统可以包括第一数据方、第二数据方和可信任的第三方(TTP,Trusted Third Party)。
所述第三方可以为一个服务器;或者,还可以为包括多个服务器的服务器集群。所 述第三方可以用于向所述第一数据方和所述第二数据方提供随机数。具体地,所述第三方可以生成随机正交矩阵,可以将所述随机正交矩阵中的各个随机数拆分为两个份额,可以将其中一个份额作为第一份额,将其中另一个份额作为第二份额。所述第三方可以将所述随机正交矩阵中各个随机数的第一份额形成的矩阵作为所述随机正交矩阵的第一份额,将所述随机正交矩阵中各个随机数的第二份额形成的矩阵作为所述随机正交矩阵的第二份额;可以向所述第一数据方发送所述随机正交矩阵的第一份额,可以向所述第二数据方发送所述随机正交矩阵的第二份额。其中,所述随机正交矩阵的第一份额和所述随机正交矩阵的第二份额的和等于所述随机正交矩阵。另外,一方面所述随机正交矩阵可以为由随机数构成的随机数矩阵;另一方面所述随机正交矩阵还可以为正交矩阵。一个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。这样便于第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份额的条件下,协作计算得到海森矩阵的条件数;进而便于根据条件数来度量海森矩阵的病态程度。具体过程详见后面的实施例。
所述第一数据方和所述第二数据方分别为合作安全建模的双方。所述第一数据方可以为不持有标签的数据方,所述第二数据方可以为持有标签的数据方。例如,所述第一数据方可以持有完整的特征数据,所述第二数据方可以持有特征数据的标签。或者,所述第一数据方可以持有特征数据的一部分数据项,所述第二数据方可以持有特征数据的另一部分数据项和标签。具体地,例如,特征数据可以包括用户的储蓄金额和借贷金额。所述第一数据方可以持有用户的储蓄金额,所述第二数据方可以持有用户的借贷金额和特征数据的标签。所述标签可以用于区分不同类型的特征数据,具体数值例如可以取自0和1。这里的数据方可以为电子设备。所述电子设备可以包括个人计算机、服务器、手持设备、便携式设备、平板型设备、多处理器装置;或者,还可以包括由以上任何多个装置或设备所构成的集群等。另外,特征数据及其对应的标签共同构成了样本数据,样本数据可以用于对数据处理模型进行训练。
在合作安全建模的场景中,所述第一数据方和所述第二数据方可以分别获得第一模型参数的一份份额。这里可以将所述第一数据方获得份额作为第一模型参数的第一份额,可以将所述第二数据方获得份额作为第一模型参数的第二份额。第一模型参数的第一份额和第一模型参数的第二份额的和等于第一模型参数。
所述第一数据方可以接收随机正交矩阵的第一份额。所述第二数据方可以接收随机正交矩阵的第二份额。如此所述第一数据方可以基于第一模型参数的第一份额、特征数 据和随机正交矩阵的第一份额,所述第二数据方可以基于第一模型参数的第二份额、标签和随机正交矩阵的第二份额,采用秘密分享的方式,协作确定新的第一模型参数。所述第一数据方和所述第二数据方可以分别获得新的第一模型参数的一份份额。具体过程可以参见后面的模型参数确定方法实施例。
本说明书还提供一种模型参数确定方法的实施例。
请参阅图2。该实施例可以包括以下步骤。
步骤S101:第一数据方根据特征数据和第一模型参数的第一份额,第二数据方根据第一模型参数的第二份额,秘密分享第一乘积。第一数据方获得第一乘积的第一份额,第二数据方获得第一乘积的第二份额。所述第一乘积为特征数据和第一模型参数的乘积。
步骤S103:第一数据方根据第一乘积的第一份额,第二数据方根据第一乘积的第二份额,秘密分享激励函数的取值。第一数据方获得激励函数取值的第一份额,第二数据方获得激励函数取值的第二份额。
步骤S105:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。第一数据方获得损失函数梯度的第一份额,第二数据方获得损失函数梯度的第二份额。
步骤S107:第一数据方根据特征数据和激励函数取值的第一份额,第二数据方根据激励函数取值的第二份额,秘密分享海森矩阵。第一数据方获得海森矩阵的第一份额,第二数据方获得海森矩阵的第二份额。
步骤S109:第一数据方根据随机正交矩阵的第一份额和海森矩阵的第一份额,第二数据方根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。第一数据方获得第二乘积的第一份额,第二数据方获得第二乘积的第二份额。所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。
步骤S111:在第二乘积的条件数满足预设条件时,第一数据方根据海森矩阵的第一份额,第二数据方根据海森矩阵的第二份额,秘密分享第一逆矩阵。第一数据方获得第一逆矩阵的第一份额,第二数据方获得第一逆矩阵的第二份额。第一逆矩阵为海森矩阵的逆矩阵。
步骤S113:第一数据方根据第一模型参数的第一份额、第一逆矩阵的第一份额和损失函数梯度的第一份额,第二数据方根据第一模型参数的第二份额、第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享新的第一模型参数。第一数据方获得新的第 一模型参数的第一份额,第二数据方获得新的第一模型参数的第二份额。
下面介绍在实施例中涉及的一些术语。
(一)、第一乘积、第二乘积、第三乘积、第四乘积和第五乘积。所述第一乘积可以为第一模型参数和特征数据之间的乘积。所述第二乘积可以为随机正交矩阵和海森矩阵之间的乘积。所述第三乘积可以为海森矩阵的逆矩阵和损失函数梯度之间的乘积。所述第四乘积可以为损失函数梯度的第一份额与预设步长的乘积。所述第五乘积可以为损失函数梯度的第二份额与预设步长的乘积。
在一些场景示例中,所述第一乘积可以表示为XW;其中,W表示第一模型参数,具体为第一模型参数构成的向量;X表示特征数据,具体为特征数据构成的矩阵。
所述第二乘积可以表示为HR,其中,H表示海森矩阵,R表示随机正交矩阵。
所述第三乘积可以表示为H
-1dW,其中,H
-1表示海森矩阵的逆矩阵,dW表示损失函数的梯度,dW为向量。
所述第四乘积可以表示为G<dW>
0,所述第五乘积可以表示为G<dW>
1。其中,G表示预设步长,<dW>
0表示损失函数梯度的第一份额,<dW>
1表示损失函数梯度的第二份额,<dW>
0+<dW>
1=dW。
(二)、第一逆矩阵和第二逆矩阵。鉴于海森矩阵为方阵,因而可以对海森矩阵进行求逆处理,可以将海森矩阵的逆矩阵作为第一逆矩阵。所述第二乘积可以为方阵,因而可以对所述第二乘积进行求逆处理,可以将所述第二乘积的逆矩阵作为第二逆矩阵。
延续前面的场景示例,所述第一逆矩阵可以表示为H
-1,所述第二逆矩阵可以表示为(HR)
-1。
在一些实施例中,在步骤S101中,所述第一数据方可以根据特征数据和第一模型参数的第一份额,所述第二数据方可以根据第一模型参数的第二份额,秘密分享第一乘积。所述第一数据方和所述第二数据方可以分别获得所述第一乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第一乘积的第一份额,可以将所述第二数据方获得的份额作为第一乘积的第二份额。第一乘积的第一份额和第一乘积的第二份额的和等于第一乘积。
延续前面的场景示例,第一模型参数的第一份额可以表示为<W>
0,第一模型参数的第二份额可以表示为<W>
1,<W>
0+<W>
1=W。所述第一数据方可以根据X和<W>
0,所述第二数据方可以根据<W>
1,秘密分享第一乘积XW。所述第一数据方可以获得第一乘积的第一份额<XW>
0,所述第二数据方可以获得第一乘积的第二份额<XW>
1。<XW>
0+<XW>
1=XW。
在一些实施例中,在步骤S103中,所述第一数据方可以根据第一乘积的第一份额,所述第二数据方可以根据第一乘积的第二份额,秘密分享多项式的取值。所述第一数据方和所述第二数据方可以分别获得所述多项式取值的一份份额。所述多项式可以用于拟合所述数据处理模型的激励函数。如此可以将所述第一数据方获得的份额作为激励函数取值的第一份额,可以将所述第二数据方获得的份额作为激励函数取值的第二份额。激励函数取值的第一份额和激励函数取值的第二份额的和等于激励函数的取值。
延续前面的场景示例,所述激励函数可以为Sigmoid函数。所述激励函数的取值可以表示为a=sigmoid(XW)。所述激励函数取值的第一份额可以表示为<a>
0,所述激励函数取值的第二份额可以表示为<a>
1。其中,<a>
0+<a>
1=a。<a>
0、<a>
1和a分别为向量。
在一些实施例中,在步骤S105中,所述第一数据方可以根据特征数据和激励函数取值的第一份额,所述第二数据方可以根据标签和激励函数取值的第二份额,秘密分享损失函数的梯度。所述第一数据方和所述第二数据方可以分别获得所述损失函数梯度的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为损失函数梯度的第一份额,可以将所述第二数据方获得的份额作为损失函数梯度的第二份额。损失函数梯度的第一份额和损失函数梯度的第二份额的和等于损失函数的梯度。
延续前面的场景示例,所述第一数据方可以根据X和<a>
0,所述第二数据方可以根据标签Y和<a>
1,秘密分享损失函数的梯度dW(具体为向量)。所述第一数据方可以获得损失函数梯度的第一份额<dW>
0,所述第二数据方可以获得损失函数梯度的第二份额<dW>
1。
下面介绍所述第一数据方和所述第二数据方秘密分享损失函数dW的详细过程。
所述第一数据方可以根据X,所述第二数据方可以根据<a>
1,秘密分享X
T<a>
1。所述第 一数据方可以获得<[X
T<a>
1]>
0,所述第二数据方可以获得<[X
T<a>
1]>
1。<[X
T<a>
1]>
0+<[X
T<a>
1]>
1=X
T<a>
1。
所述第一数据方还可以根据X,所述第二数据方还可以根据标签Y(具体为标签构成的向量),秘密分享X
TY。所述第一数据方可以获得<X
TY>
0,所述第二数据方可以获得<X
TY>
1。<X
TY>
0+<X
TY>
1=X
TY。
所述第一数据方可以计算X
T<a>
0;可以计算X
T<a>
0+<[X
T<a>
1]>
0-<X
TY>
0作为损失函数梯度dW的第一份额<dW>
0。所述第二数据方可以计算<[X
T<a>
1]>
1-<X
TY>
1作为损失函数梯度dW的第二份额<dW>
1。
dW=<dW>
0+<dW>
1
=X
T<a>
0+<[X
T<a>
1]>
0-<X
TY>
0+<[X
T<a>
1]>
1-<X
TY>
1
=X
T<a>
0+X
T<a>
1-X
TY
=X
Ta-X
TY
=X
T(a-Y)
在一些实施例中,在步骤S107中,所述第一数据方可以根据特征数据和激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享海森矩阵。所述第一数据方和所述第二数据方可以分别获得所述海森矩阵的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为所述海森矩阵的第一份额,可以将所述第二数据方获得的份额作为所述海森矩阵的第二份额。海森矩阵的第一份额和海森矩阵的第二份额的和等于海森矩阵。
具体地,所述第一数据方可以根据激励函数取值的第一份额,所述第二数据方可以根据激励函数取值的第二份额,秘密分享对角矩阵。所述第一数据方和所述第二数据方可以分别获得所述对角矩阵的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为所述对角矩阵的第一份额,可以将所述第二数据方获得的份额作为所述对角矩阵的第二份额。对角矩阵的第一份额和对角矩阵的第二份额的和等于对角矩阵。如此所述第一数据方可以根据特征数据和所述对角矩阵的第一份额,所述第二数据方可以根据所述对角矩阵的第二份额,秘密分享海森矩阵。所述第一数据方可以获得所述海森矩阵的第一份额,所述第二数据方可以获得所述海森矩阵的第二份额。
延续前面的场景示例,所述第一数据方可以根据<a>
0,所述第二数据方可以根据 <a>
1,秘密分享对角矩阵RNN。所述第一数据方可以获得对角矩阵的第一份额RNN
0,所述第二数据方可以获得对角矩阵的第二份额RNN
1。
下面介绍所述第一数据方和所述第二数据方秘密分享对角矩阵RNN的详细过程。
所述第一数据方可以根据<a>
0,所述第二数据方可以根据<a>
1,秘密分享<a>
0·<a>
1。所述第一数据方可以获得<[<a>
0·<a>
1]>
0,所述第二数据方可以获得<[<a>
0·<a>
1]>
1。<[<a>
0·<a>
1]>
0+<[<a>
0·<a>
1]>
1=<a>
0·<a>
1。其中,·表示按位相乘运算。例如,向量
向量
那么,
所述第一数据方可以计算<r>
0=<a>
0-<[<a>
0·<a>
1]>
0-<a>
0·<a>
0,所述第二数据方可以计算<r>
1=<a>
1-<[<a>
0·<a>
1]>
0-<a>
1·<a>
1。
r=<r>
0+<r>
1
=<a>
0-<[<a>
0·<a>
1]>
0-<a>
0·<a>
0+<a>
1-<[<a>
0·<a>
1]>
0-<a>
1·<a>
1
={<a>
0+<a>
1}{1-<a>
0-<a>
1}
=a(1-a)
<r>
0、<r>
1和r分别为向量。因而所述第一数据方可以根据<r>
0生成对角矩阵RNN=diag(r)的第一份额RNN
0=diag(<r>
0),所述第二数据方可以根据<r>
1生成对角矩阵RNN=diag(r)的第二份额RNN
1=diag(<r>
1)。RNN
0+RNN
1=RNN。其中,对角矩阵RNN的第一份额RNN
0和第二份额RNN
1均可以为一个对角矩阵。在实际处理过程中,所述第一数据方可以将<r>
0中的数据元素作为RNN
0主对角线上的数据元素,这样便实现了根据<r>
0生成RNN
0;可以将<r>
1中的数据元素作为RNN
1主对角线上的数据元素,这样便实现了根据<r>
1生成RNN
1。
所述第一数据方可以根据X和RNN
0,所述第二数据方可以根据RNN
1,秘密分享海森矩阵H。所述第一数据方可以获得海森矩阵的第一份额<H>
0,所述第二数据方可以获得海森矩阵的第二份额<H>
1。
下面介绍所述第一数据方和所述第二数据方秘密分享海森矩阵H的详细过程。
所述第一数据方可以根据X,所述第二数据方可以根据RNN
1,秘密分享X
TRNN
1。所述第一数据方可以获得<X
TRNN
1>
0,所述第二数据方可以获得<X
TRNN
1>
1。<X
TRNN
1>
0+<X
TRNN
1>
1=X
TRNN
1。
所述第一数据方还可以根据X,所述第二数据方还可以根据<X
TRNN
1>
1,秘密分享<X
TRNN
1>
1X。所述第一数据方可以获得<[<X
TRNN
1>
1X]>
0,所述第二数据方可以获得<[<X
TRNN
1>
1X]>
1。
<[<X
TRNN
1>
1X]>
0+<[<X
TRNN
1>
1X]>
1=<X
TRNN
1>
1X
所述第一数据方可以计算X
TRNN
0X+<X
TRNN
1>
0X+<[<X
TRNN
1>
1X]>
0作为海森矩阵H的第一份额<H>
0。所述第二数据方可以将<[<X
TRNN
1>
1X]>
1作为海森矩阵H的第二份额<H>
0。
H=<H>
0+<H>
1
=X
TRNN
0X+<X
TRNN
1>
0X+<[<X
TRNN
1>
1X]>
0+<[<X
TRNN
1>
1X]>
1
=X
TRNN
0X+<X
TRNN
1>
0X+<X
TRNN
1>
1X
=X
TRNN
0X+X
TRNN
1X
=X
TRNNX
在一些实施例中,第三方可以向第一数据方下发随机正交矩阵的第一份额;可以向第二数据方下发随机正交矩阵的第二份额。随机正交矩阵的第一份额和随机正交矩阵的第二份额的和等于随机正交矩阵。所述第一数据方可以接收随机正交矩阵的第一份额,所述第二数据方可以接收随机正交矩阵的第二份额。如此在步骤S109中,所述第一数据方可以根据随机正交矩阵的第一份额和海森矩阵的第一份额,所述第二数据方可以根据随机正交矩阵的第二份额和海森矩阵的第二份额,秘密分享第二乘积。所述第一数据方和所述第二数据方可以分别获得所述第二乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第二乘积的第一份额,可以将所述第二数据方获得的份额作为第二乘积的第二份额。第二乘积的第一份额和第二乘积的第二份额的和等于第二乘积。
延续前面的场景示例,随机正交矩阵的第一份额可以表示为<R>
0,随机正交矩阵 的第二份额可以表示为<R>
1,<R>
0+<R>
1=R。所述第一数据方可以根据<R>
0和<H>
0,所述第二数据方可以根据<R>
1和<H>
1,秘密分享第二乘积HR。所述第一数据方可以获得第二乘积的第一份额<HR>
0,所述第二数据方可以获得第二乘积第二份额<HR>
1。
下面介绍所述第一数据方和所述第二数据方秘密分享第二乘积HR的详细过程。
所述第一数据方可以根据<H>
0,所述第二数据方可以根据<R>
1,秘密分享<H>
0<R>
1。所述第一数据方可以获得<[<H>
0<R>
1]>
0,所述第二数据方可以获得<[<H>
0<R>
1]>
1。<[<H>
0<R>
1]>
0+<[<H>
0<R>
1]>
1=<H>
0<R>
1。
所述第一数据方还可以根据<R>
0,所述第二数据方还可以根据<H>
1,秘密分享<H>
1<R>
0。所述第一数据方可以获得<[<H>
1<R>
0]>
0,所述第二数据方可以获得<[<H>
1<R>
0]>
1。<[<H>
1<R>
0]>
0+<[<H>
1<R>
0]>
1=<H>
1<R>
0。
所述第一数据方可以计算<H>
0<R>
0+<[<H>
0<R>
1]>
0+<[<H>
1<R>
0]>
0作为第二乘积的第一份额<HR>
0。所述第二数据方可以计算<H>
1<R>
1+<[<H>
0<R>
1]>
1+<[<H>
1<R>
0]>
1作为第二乘积的第二份额<HR>
1。
HR=<HR>
0+<HR>
1
=<H>
0<R>
0+<[<H>
0<R>
1]>
0+<[<H>
1<R>
0]>
0+
<H>
1<R>
1+<[<H>
0<R>
1]>
1+<[<H>
1<R>
0]>
1
=<H>
0<R>
0+<H>
0<R>
1+<H>
1<R>
0+<H>
1<R>
1
=(<H>
0+<H>
1)(<R>
0+<R>
1)
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。所述预设阈值可以为经验值,或者,还可以采用其它方式(例如机器学习的方式)获得。
所述第一数据方和所述第二数据方均可以持有所述预设条件。进而,所述第一数据方和所述第二数据方可以分别判断第二乘积的条件数是否满足所述预设条件。在一些实施方式中,可以由第一数据方计算第二乘积的条件数。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积; 可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送第二乘积的条件数。所述第二数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。在另一些实施方式中,还可以由第二数据方计算第二乘积的条件数。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送第二乘积的条件数。所述第一数据方可以接收第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件。
或者,可以仅由第一数据方持有所述预设条件,进而仅由第一数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身持有的第二乘积的第一份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第二数据方发送判断结果信息。所述第二数据方可以接收判断结果信息。
又或者,可以仅由第二数据方持有所述预设条件,进而仅由第二数据方判断第二乘积的条件数是否满足所述预设条件。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身持有的第二乘积的第二份额相加,得到第二乘积;可以计算第二乘积的条件数;可以判断第二乘积的条件数是否满足所述预设条件;可以向所述第一数据方发送判断结果信息。所述第一数据方可以接收判断结果信息。
如前面所述,一个方阵与一个正交矩阵相乘后可以得到一个新的矩阵,该新的矩阵与该方阵具有相同的条件数。鉴于海森矩阵为方阵,因而第二乘积的条件数等于海森矩阵的条件数。这样便实现了第一数据方和第二数据方在不泄漏自身持有的海森矩阵的份额的条件下,协作计算得到海森矩阵的条件数。
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,即表明海森矩阵的病态程度较小,因而可以使用牛顿法确定模型参数。如此在步骤S111中,所述第一数据方可以根据海森矩阵的第一份额,所述第二数据方可以根据海森矩阵的第二份额,秘密分享第一逆矩阵。所述第一数据方可以获得第一逆矩阵的第一份额,所述第二数据方可以获得第一逆矩阵的第二份额。
在一些实施方式中,可以由所述第二数据方对所述第二乘积进行求逆。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额。所述第二数据方可以接收第二乘积的第一份额;可以将第二乘积的第一份额与自身的第二乘积的第二份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第二数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以向所述第一数据方发送所述第二逆矩阵。所述第一数据方可以接收所述第二逆矩阵。或者,在另一些实施方式中,还可以由所述第一数据方对所述第二乘积进行求逆。具体地,所述第二数据方可以向所述第一数据方发送第二乘积的第二份额。所述第一数据方可以接收第二乘积的第二份额;可以将第二乘积的第二份额与自身的第二乘积的第一份额相加,得到第二乘积。鉴于所述第二乘积为方阵,因而所述第一数据方可以对所述第二乘积进行求逆处理,得到所述第二乘积的逆矩阵作为第二逆矩阵;可以向所述第二数据方发送所述第二逆矩阵。所述第二数据方可以接收所述第二逆矩阵。
所述第一数据方可以将随机正交矩阵的第一份额与第二逆矩阵相乘,得到第一逆矩阵的第一份额。所述第二数据方可以将随机正交矩阵的第二份额与第二逆矩阵相乘,得到第一逆矩阵的第二份额。第一逆矩阵的第一份额和第一逆矩阵的第二份额的和等于第一逆矩阵。
延续前面的场景示例,这里由第二数据方对第二乘积HR进行求逆。具体地,所述第一数据方可以向所述第二数据方发送第二乘积的第一份额<HR>
0。所述第二数据方可以接收第二乘积的第一份额<HR>
0;可以将第二乘积的第一份额<HR>
0与自身的第二乘积的第二份额<HR>
1相加,得到第二乘积HR;可以对第二乘积HR进行求逆处理,得到第二逆矩阵(HR)
-1;可以向所述第一数据方发送第二逆矩阵(HR)
-1。所述第一数据方可以接收第二逆矩阵(HR)
-1。
所述第一数据方可以将第二逆矩阵(HR)
-1与随机正交矩阵的第一份额<R>
0相乘,得到第一逆矩阵H
-1的第一份额<H
-1>
0。所述第二数据方可以将第二逆矩阵(HR)
-1与随机正交矩阵的第二份额<R>
1相乘,得到第一逆矩阵H
-1的第一份额<H
-1>
1。H
-1=<H
-1>
0+<H
-1>
1=<R>
0(HR)
-1+<R>
1(HR)
-1=R×(HR)
-1。
在一些实施例中,在步骤S113中,所述第一数据方可以根据第一逆矩阵的第一份 额和损失函数梯度的第一份额,所述第二数据方可以根据第一逆矩阵的第二份额和损失函数梯度的第二份额,秘密分享第三乘积。所述第一数据方和所述第二数据方可以分别获得所述第三乘积的一份份额。为了便于描述,可以将所述第一数据方获得的份额作为第三乘积的第一份额,可以将所述第二数据方获得的份额作为第三乘积的第二份额。第三乘积的第一份额和第三乘积的第二份额的和等于第三乘积。
所述第一数据方可以将第一模型参数的第一份额与第三乘积的第一份额相减,得到新的第一模型参数的第一份额。所述第二数据方可以将第一模型参数的第二份额与第三乘积的第二份额相减,得到新的第一模型参数的第二份额。
延续前面的场景示例,所述第一数据方可以根据<H
-1>
0和<dW>
0,所述第二数据方可以根据<H
-1>
1和<dW>
1,秘密分享第三乘积H
-1×dW。所述第一数据方可以获得第三乘积的第一份额<H
-1×dW>
0,所述第二数据方可以获得第三乘积的第二份额<H
-1×dW>
1。
下面介绍所述第一数据方和所述第二数据方秘密分享第三乘积H
-1×dW的详细过程。
所述第一数据方可以根据<H
-1>
0,所述第二数据方可以根据<dW>
1,秘密分享<H
-1>
0<dW>
1。所述第一数据方可以获得<[<H
-1>
0<dW>
1]>
0,所述第二数据方可以获得<[<H
-1>
0<dW>
1]>
1。<[<H
-1>
0<dW>
1]>
0+<[<H
-1>
0<dW>
1]>
1=<H
-1>
0<dW>
1。
所述第一数据方还可以根据<dW>
0,所述第二数据方还可以根据<H
-1>
1,秘密分享<H
-1>
1<dW>
0。所述第一数据方可以获得<[<H
-1>
1<dW>
0]>
0,所述第二数据方可以获得<[<H
-1>
1<dW>
0]>
1。<[<H
-1>
1<dW>
0]>
0+<[<H
-1>
1<dW>
0]>
1=<H
-1>
1<dW>
0。
所述第一数据方可以计算<H
-1>
0<dW>
0+<[<H
-1>
0<dW>
1]>
0+<[<H
-1>
1<dW>
0]>
0作为第三乘积的第一份额<H
-1×dW>
0。所述第二数据方可以计算<H
-1>
1<dW>
1+<[<H
-1>
0<dW>
1]>
1+<[<H
-1>
1<dW>
0]>
1作为第三乘积的第二份额<H
-1×dW>
1。
H
-1×dW=<H
-1×dW>
0+<H
-1×dW>
1
=<H
-1>
0<dW>
0+<[<H
-1>
0<dW>
1]>
0+<[<H
-1>
1<dW>
0]>
0+
<H
-1>
1<dW>
1+<[<H
-1>
0<dW>
1]>
1+<[<H
-1>
1<dW>
0]>
1
=<H
-1>
0<dW>
0+<H
-1>
0<dW>
1+<H
-1>
1<dW>
0+<H
-1>
1<dW>
1
=(<H
-1>
0+<H
-1>
1)(<dW>
0+<dW>
1)
所述第一数据方可以计算<W'>
0=<W>
0-<H
-1×dW>
0,所述第二数据方可以计算<W'>
1=<W>
1-<H
-1×dW>
1,<W'>
0表示新的第一模型参数的第一份额,<W'>
1表示新的第一模型参数的第二份额,W′表示新的第一模型参数。
W'=<W'>
0+<W'>
1=<W>
0-<H
-1×dW>
0+<W>
1-<H
-1×dW>
1=W-H
-1×dW
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,即表明海森矩阵的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。具体地,所述第一数据方可以根据第一模型参数的第一份额、损失函数梯度的第一份额和预设步长,计算新的第一模型参数的第一份额。所述第二数据方可以根据第一模型参数的第二份额、损失函数梯度的第二份额和预设步长,计算新的第一模型参数的第二份额。
所述预设步长可以用于控制梯度下降法的迭代速度。所述预设步长可以为任意适当正实数。例如,当预设步长过大时,迭代速度会过快,导致有可能无法获得最优模型参数。当预设步长过小时,导致迭代速度会过慢,导致花费的时间较长。所述预设步长具体可以为经验值;或者,也可以采用机器学习的方式得到。当然,所述预设步长还可以采用其它方式得到。所述第一数据方和所述第二数据方均可以持有所述预设步长。
所述第一数据方可以将损失函数梯度的第一份额与预设步长相乘,得到第四乘积;可以将第一模型参数的第一份额与第四乘积相减,得到新的第一模型参数的第一份额。所述第二数据方可以将损失函数梯度的第二份额与预设步长相乘,得到第五乘积;可以将第一模型参数的第二份额与第五乘积相减,得到新的第一模型参数的第二份额。新的第一模型参数的第一份额和新的第一模型参数的第二份额的和等于新的第一模型参数。
延续前面的场景示例,所述第一数据方可以将损失函数梯度的第一份额<dW>
0(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第四乘积G<dW>
0; 可以将第一模型参数的第一份额<W>
0与第四乘积G<dW>
0相减,得到新的第一模型参数的第一份额<W'>
0=<W>
0-G<dW>
0。
所述第二数据方可以将损失函数梯度的第二份额<dW>
1(具体为向量)与预设步长G相乘(具体为向量的数乘),得到第五乘积G<dW>
1;可以将第一模型参数的第二份额<W>
1与第五乘积G<dW>
1相减,得到新的第一模型参数的第二份额<W'>
1=<W>
1-G<dW>
1。其中,<W'>
0+<W'>
1=W',W'表示新的第一模型参数。
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。
可以重复执行步骤S101,所述第一数据方可以获得新的第一乘积的第一份额,所述第二数据方可以获得新的第一乘积的第二份额。新的第一乘积为特征数据和新的第一模型参数的乘积。可以重复执行步骤S103,所述第一数据方可以获得新的激励函数取值的第一份额,所述第二数据方可以获得新的激励函数取值的第二份额。可以重复执行步骤S105,所述第一数据方可以获得新的损失函数梯度的第一份额,所述第二数据方可以获得新的损失函数梯度的第二份额。可以重复执行步骤S107,所述第一数据方可以获得新的海森矩阵的第一份额,所述第二数据方可以获得新的海森矩阵的第二份额。可以重复执行步骤S109,所述第一数据方可以获得新的第二乘积的第一份额,所述第二数据方可以获得新的第二乘积的第二份额。新的第二乘积为随机正交矩阵和新的海森矩阵之间的乘积。
在新的第二乘积的条件数满足预设条件时,表明在该轮迭代过程中可以继续使用牛顿法确定模型参数。可以重复执行步骤S111。所述第一数据方可以获得新的第一逆矩阵的第一份额,所述第二数据方可以获得新的第一逆矩阵的第二份额。新的第一逆矩阵为新的海森矩阵的逆矩阵。所述第一数据方可以根据新的第一模型参数的第一份额、新的第一逆矩阵的第一份额和新的损失函数梯度的第一份额,所述第二数据方根据新的第一模型参数的第二份额、新的第一逆矩阵的第二份额和新的损失函数梯度的第二份额,秘密分享第二模型参数。所述第一数据方可以获得第二模型参数的第一份额,所述第二数据方可以获得第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。
在新的第二乘积的条件数不满足预设条件时,表明在该轮迭代过程中无法继续 使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的第一份额、新的损失函数梯度的第一份额和预设步长,计算第二模型参数的第一份额。所述第二数据方可以根据新的第一模型参数的第二份额、新的损失函数梯度的第二份额和预设步长,计算第二模型参数的第二份额。第二模型参数的第一份额和第二模型参数的第二份额的和等于第二模型参数。
本实施例中,第一数据方和第二数据方可以利用秘密分享算法,在不泄漏自身所拥有的数据的前提下,协作确定数据处理模型的模型参数。另外,通过条件数和预设条件,本实施例的模型参数确定方法可以避免在使用牛顿法确定模型参数的过程中由于出现病态矩阵所导致的不收敛问题。
基于同样的发明构思,本说明书还提供另一种模型参数确定方法的实施例。该实施例以第一数据方为执行主体,所述第一数据方可以持有特征数据和第一模型参数的份额。请参阅图3。该实施例可以包括以下步骤。
步骤S201:根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积。
在一些实施例中,所述合作方可以理解为与所述第一数据方进行合作安全建模的数据方,具体可以为前面的第二数据方。
步骤S203:根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额。
在一些实施例中,所述第一数据方可以根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。
步骤S205:根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额。
步骤S207:根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。
步骤S209:在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。第二 乘积的条件数可以由第一数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛顿法确定模型参数。如此所述第一数据方可以根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。
步骤S211:根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
在一些实施例中,所述第一数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第一数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第一数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。
所述第一数据方可以重复执行步骤S201、步骤S203、步骤S205、步骤S207。
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第一数据方可以重复执行步骤S209。所述第一数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第一数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。
在本实施例中,第一数据方可以利用秘密分享算法,在不泄漏自身所拥有的数据的前提下,与合作方协作确定数据处理模型的模型参数,得到新的第一模型参数的份 额。
基于同样的发明构思,本说明书还提供另一种模型参数确定方法的实施例。该实施例以第二数据方为执行主体,所述第二数据方可以持有标签和第一模型参数的份额。请参阅图4。该实施例可以包括以下步骤。
步骤S301:根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积。
在一些实施例中,所述合作方可以理解为与所述第二数据方进行合作安全建模的数据方,具体可以为前面的第一数据方。
步骤S303:根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额。
在一些实施例中,所述第二数据方可以根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。
步骤S305:根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额。
步骤S307:根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积。
步骤S309:在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵。
在一些实施例中,所述预设条件可以包括:条件数小于或等于预设阈值。第二乘积的条件数可以由第二数据方和/或合作方来计算。第二乘积的条件数等于海森矩阵的条件数。
在一些实施例中,第二乘积的条件数满足所述预设条件,表明第二乘积的病态程度较小,可以使用牛顿法确定模型参数。如此所述第二数据方可以根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额。
步骤S311:根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
在一些实施例中,所述第二数据方可以根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额。所述第三乘积可以为第一逆矩阵和损失函数梯度之间的乘积。所述第二数据方可以将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。
在一些实施例中,第二乘积的条件数不满足所述预设条件,表明第二乘积的病态程度较大,无法使用牛顿法确定模型参数,因而可以使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。所述第二数据方具体可以将损失函数梯度的份额与预设步长相乘,得到第四乘积;可以将第一模型参数的份额与第四乘积相减,得到新的第一模型参数的份额。
在一些实施例中,还可以包括对数据处理模型的模型参数进行迭代优化调整的过程。
所述第二数据方可以重复执行步骤S301、步骤S303、步骤S305、步骤S307。
在新的第二乘积的条件数满足预设条件时,表明可以继续使用牛顿法确定模型参数。所述第二数据方可以重复执行步骤S309。所述第二数据方进而可以根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。
在新的第二乘积的条件数不满足预设条件时,表明需要使用梯度下降法代替牛顿法确定模型参数。所述第二数据方可以根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。
在本实施例中,第二数据方可以利用秘密分享算法,在不泄漏自身所拥有的数据的前提下,与合作方协作确定数据处理模型的模型参数,得到新的第一模型参数的份额。
基于同样的发明构思,本说明书还提供一种模型参数确定装置的实施例。请参阅图5。该实施例可以应用于第一数据方,可以包括以下单元。
第一秘密分享单元401,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;
第二秘密分享单元403,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;
第三秘密分享单元405,用于根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;
第四秘密分享单元407,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;
第五秘密分享单元409,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;
第六秘密分享单元411,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
基于同样的发明构思,本说明书还提供一种模型参数确定装置的实施例。请参阅图6。该实施例可以应用于第二数据方,可以包括以下单元。
第一秘密分享单元501,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;
第二秘密分享单元503,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;
第三秘密分享单元505,用于根据激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;
第四秘密分享单元507,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;
第五秘密分享单元509,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;
第六秘密分享单元511,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
下面介绍本说明书电子设备的一个实施例。图7是该实施例中一种电子设备的硬件结构示意图。如图7所示,所述电子设备可以包括一个或多个(图中仅示出一个) 处理器、存储器和传输模块。当然,本领域普通技术人员可以理解,图7所示的硬件结构仅为示意,其并不对上述电子设备的硬件结构造成限定。在实际中所述电子设备还可以包括比图7所示更多或者更少的组件单元;或者,具有与图7所示不同的配置。
所述存储器可以包括高速随机存储器;或者,还可以包括非易失性存储器,例如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。当然,所述存储器还可以包括远程设置的网络存储器。所述远程设置的网络存储器可以通过诸如互联网、企业内部网、局域网、移动通信网等网络连接至所述电子设备。所述存储器可以用于存储应用软件的程序指令或模块,例如本说明书图3所对应实施例的程序指令或模块;和/或,本说明书图4所对应实施例的程序指令或模块。
所述处理器可以按任何适当的方式实现。例如,所述处理器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式等等。所述处理器可以读取并执行所述存储器中的程序指令或模块。
所述传输模块可以用于经由网络进行数据传输,例如经由诸如互联网、企业内部网、局域网、移动通信网等网络进行数据传输。
需要说明的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其它实施例的不同之处。尤其,对于装置实施例和电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。另外,可以理解的是,本领域技术人员在阅读本说明书文件之后,可以无需创造性劳动想到将本说明书列举的部分或全部实施例进行任意组合,这些组合也在本说明书公开和保护的范围内。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需 要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书各个实施例或者实施例的某些部分所述的方法。
本说明书可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式 计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施例描绘了本说明书,本领域普通技术人员知道,本说明书有许多变形和变化而不脱离本说明书的精神,希望所附的权利要求包括这些变形和变化而不脱离本说明书的精神。
Claims (26)
- 一种模型参数确定方法,应用于第一数据方,包括:根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据特征数据和激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
- 如权利要求1所述的方法,还包括:在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。
- 如权利要求1所述的方法,还包括:重复执行所述秘密分享第一乘积的步骤、所述秘密分享激励函数的取值的步骤、所述秘密分享损失函数的梯度和海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;在新的第二乘积的条件数满足预设条件时,重复执行所述秘密分享第一逆矩阵的步骤;根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。
- 如权利要求1所述的方法,还包括:重复执行所述秘密分享第一乘积的步骤、所述秘密分享激励函数的取值的步骤、所述秘密分享损失函数的梯度和海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。
- 如权利要求1所述的方法,所述根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额,包括:根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为 激励函数取值的份额,所述多项式用于拟合所述激励函数。
- 如权利要求1所述的方法,还包括:接收合作方发来的第二乘积的份额;将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积;计算第二乘积的条件数。
- 如权利要求1所述的方法,还包括:向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。
- 如权利要求1所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,包括:接收合作方发来的第二乘积的份额;将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积;计算第二乘积的逆矩阵作为第二逆矩阵;将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。
- 如权利要求1所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,包括:向合作方发送第二乘积的份额;接收合作方发来的第二乘积的逆矩阵作为第二逆矩阵;将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。
- 如权利要求1所述的方法,所述根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额,包括:根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。
- 如权利要求4所述的方法,所述根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额,包括:将新的损失函数梯度的份额与预设步长相乘,得到第四乘积;将新的第一模型参数的份额与第四乘积相减,得到第二模型参数的份额。
- 一种模型参数确定方法,应用于第二数据方,包括:根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;根据标签和激励函数取值的份额与合作方秘密分享损失函数的梯度,得到损失函数梯度的份额;根据激励函数取值的份额与合作方秘密分享海森矩阵,得到海森矩阵的份额;根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
- 如权利要求12所述的方法,还包括:在第二乘积的条件数不满足预设条件时,根据第一模型参数的份额、损失函数梯度的份额和预设步长,计算新的第一模型参数的份额。
- 如权利要求12所述的方法,还包括:重复执行所述秘密分享第一乘积的步骤、所述秘密分享激励函数的取值的步骤、所述秘密分享损失函数的梯度和海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;在新的第二乘积的条件数满足预设条件时,重复执行所述秘密分享第一逆矩阵的步骤;根据新的第一逆矩阵的份额、新的损失函数梯度的份额和新的第一模型参数的份额与合作方秘密分享第二模型参数,得到第二模型参数的份额。
- 如权利要求12所述的方法,还包括:重复执行所述秘密分享第一乘积的步骤、所述秘密分享激励函数的取值的步骤、所述秘密分享损失函数的梯度和海森矩阵的步骤、以及所述秘密分享第二乘积的步骤;在新的第二乘积的条件数不满足所述预设条件时,根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额。
- 如权利要求12所述的方法,所述根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额,包括:根据第一乘积的份额与合作方秘密分享多项式的取值,得到多项式取值的份额作为激励函数取值的份额,所述多项式用于拟合所述激励函数。
- 如权利要求12所述的方法,还包括:接收合作方发来的第二乘积的份额;将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积;计算第二乘积的条件数。
- 如权利要求12所述的方法,还包括:向合作方发送第二乘积的份额,以便合作方计算第二乘积的条件数。
- 如权利要求12所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,包括:接收合作方发来的第二乘积的份额;将自身的第二乘积的份额与接收的第二乘积的份额相加,得到第二乘积;计算第二乘积的逆矩阵作为第二逆矩阵;将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。
- 如权利要求12所述的方法,所述根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,包括:向合作方发送第二乘积的份额;接收合作方发来的第二乘积的逆矩阵作为第二逆矩阵;将第二逆矩阵与随机正交矩阵的份额相乘,得到第一逆矩阵的份额。
- 如权利要求12所述的方法,所述根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额,包括:根据第一逆矩阵的份额和损失函数梯度的份额与合作方秘密分享第三乘积,得到第三乘积的份额,所述第三乘积为第一逆矩阵和损失函数梯度之间的乘积;将第一模型参数的份额与第三乘积的份额相减,得到新的第一模型参数的份额。
- 如权利要求15所述的方法,所述根据新的第一模型参数的份额、新的损失函数梯度的份额和预设步长,计算第二模型参数的份额,包括:将新的损失函数梯度的份额与预设步长相乘,得到第四乘积;将新的第一模型参数的份额与第四乘积相减,得到第二模型参数的份额。
- 一种模型参数确定装置,应用于第一数据方,包括:第一秘密分享单元,用于根据特征数据和第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;第三秘密分享单元,用于根据特征数据和激励函数取值的份额与合作方秘密分享损 失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
- 一种电子设备,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令以实现如权利要求1-11中任一项所述的方法步骤。
- 一种模型参数确定装置,应用于第二数据方,包括:第一秘密分享单元,用于根据第一模型参数的份额与合作方秘密分享第一乘积,得到第一乘积的份额,所述第一乘积为特征数据和第一模型参数的乘积;第二秘密分享单元,用于根据第一乘积的份额与合作方秘密分享激励函数的取值,得到激励函数取值的份额;第三秘密分享单元,用于根据激励函数取值的份额与合作方秘密分享损失函数的梯度和海森矩阵,分别得到损失函数梯度的份额和海森矩阵的份额;第四秘密分享单元,用于根据随机正交矩阵的份额和海森矩阵的份额与合作方秘密分享第二乘积,得到第二乘积的份额,所述第二乘积为随机正交矩阵和海森矩阵之间的乘积;第五秘密分享单元,用于在第二乘积的条件数满足预设条件时,根据海森矩阵的份额与合作方秘密分享第一逆矩阵,得到第一逆矩阵的份额,所述第一逆矩阵为海森矩阵的逆矩阵;第六秘密分享单元,用于根据第一逆矩阵的份额、损失函数梯度的份额和第一模型参数的份额与合作方秘密分享新的第一模型参数,得到新的第一模型参数的份额。
- 一种电子设备,包括:存储器,用于存储计算机指令;处理器,用于执行所述计算机指令以实现如权利要求12-22中任一项所述的方法步骤。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US16/787,151 US10803184B2 (en) | 2019-08-09 | 2020-02-11 | Generation of a model parameter |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910734792.8A CN110569228B (zh) | 2019-08-09 | 2019-08-09 | 模型参数确定方法、装置和电子设备 |
| CN201910734792.8 | 2019-08-09 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US16/787,151 Continuation US10803184B2 (en) | 2019-08-09 | 2020-02-11 | Generation of a model parameter |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021027259A1 true WO2021027259A1 (zh) | 2021-02-18 |
Family
ID=68775001
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/072084 Ceased WO2021027259A1 (zh) | 2019-08-09 | 2020-01-14 | 模型参数确定方法、装置和电子设备 |
Country Status (3)
| Country | Link |
|---|---|
| CN (1) | CN110569228B (zh) |
| TW (1) | TWI717221B (zh) |
| WO (1) | WO2021027259A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121122603A (zh) * | 2025-11-13 | 2025-12-12 | 浪潮电子信息产业股份有限公司 | 一种数据批量处理方法及设备 |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110569228B (zh) * | 2019-08-09 | 2020-08-04 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| WO2021027598A1 (zh) * | 2019-08-09 | 2021-02-18 | 创新先进技术有限公司 | 模型参数确定方法、装置和电子设备 |
| US10803184B2 (en) | 2019-08-09 | 2020-10-13 | Alibaba Group Holding Limited | Generation of a model parameter |
| US10936960B1 (en) | 2019-08-09 | 2021-03-02 | Advanced New Technologies Co., Ltd. | Determining model parameters using secret sharing |
| CN110555315B (zh) * | 2019-08-09 | 2021-04-09 | 创新先进技术有限公司 | 基于秘密分享算法的模型参数更新方法、装置和电子设备 |
| CN111738361B (zh) * | 2020-07-31 | 2020-12-08 | 支付宝(杭州)信息技术有限公司 | 业务模型的联合训练方法及装置 |
| CN111737757B (zh) * | 2020-07-31 | 2020-11-17 | 支付宝(杭州)信息技术有限公司 | 针对隐私数据进行安全运算的方法和装置 |
| CN111783130B (zh) * | 2020-09-04 | 2021-01-29 | 支付宝(杭州)信息技术有限公司 | 隐私保护的数据处理方法、装置及服务器 |
Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104168114A (zh) * | 2014-08-07 | 2014-11-26 | 河海大学 | 一种分布式的基于(k,n)门限证书加密方法及系统 |
| CN105071938A (zh) * | 2015-07-14 | 2015-11-18 | 中国科学技术大学 | 一种基于门限秘密共享的组认证方法 |
| CN109977694A (zh) * | 2019-03-11 | 2019-07-05 | 暨南大学 | 一种基于协作深度学习的数据共享方法 |
| US20190245682A1 (en) * | 2018-02-06 | 2019-08-08 | Wickr Inc. | Facilitating Communications using Hybrid Cryptography |
| CN110472439A (zh) * | 2019-08-09 | 2019-11-19 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110555315A (zh) * | 2019-08-09 | 2019-12-10 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110555525A (zh) * | 2019-08-09 | 2019-12-10 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110569228A (zh) * | 2019-08-09 | 2019-12-13 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110569227A (zh) * | 2019-08-09 | 2019-12-13 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110580410A (zh) * | 2019-08-09 | 2019-12-17 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110580409A (zh) * | 2019-08-09 | 2019-12-17 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
Family Cites Families (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1252594A2 (en) | 1999-11-22 | 2002-10-30 | Accenture LLP | Scheduling and planning before and proactive management during maintenance and service in a network-based supply chain environment |
| CN1894923A (zh) * | 2003-10-08 | 2007-01-10 | 史蒂芬·J·英格博格 | 用改进保密性技术来建立通讯的方法和系统 |
| US20110060901A1 (en) * | 2009-09-04 | 2011-03-10 | Gradiant | Cryptographic System for Performing Secure Iterative Matrix Inversions and Solving Systems of Linear Equations |
| US11080718B2 (en) * | 2012-09-28 | 2021-08-03 | Rex Wiig | System and method of a requirement, active compliance and resource management for cyber security application |
| CN104573142A (zh) * | 2013-10-10 | 2015-04-29 | 无锡市思库瑞科技信息有限公司 | 基于神经网络的口令属性分析方法 |
| US9563854B2 (en) * | 2014-01-06 | 2017-02-07 | Cisco Technology, Inc. | Distributed model training |
| JP2016085381A (ja) * | 2014-10-27 | 2016-05-19 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America | 暗号化方法、暗号化装置、及び暗号化システム |
| CN105406966B (zh) * | 2015-12-30 | 2018-11-09 | 中国农业大学 | 一种门限秘密信息分配、还原、完整性验证方法及装置 |
| CN109308418B (zh) * | 2017-07-28 | 2021-09-24 | 创新先进技术有限公司 | 一种基于共享数据的模型训练方法及装置 |
| WO2019046651A2 (en) * | 2017-08-30 | 2019-03-07 | Inpher, Inc. | EVALUATION OF REAL-VALUE FUNCTION PRESERVING HIGH PRECISION CONFIDENTIALITY |
| CN108491266B (zh) * | 2018-03-09 | 2021-11-16 | 联想(北京)有限公司 | 基于区块链的数据处理方法、装置及电子设备 |
| CN109033288A (zh) * | 2018-07-13 | 2018-12-18 | 电子科技大学 | 一种基于bp神经网络的智能终端安全等级分类方法 |
| US11244242B2 (en) * | 2018-09-07 | 2022-02-08 | Intel Corporation | Technologies for distributing gradient descent computation in a heterogeneous multi-access edge computing (MEC) networks |
| CN109413087B (zh) * | 2018-11-16 | 2019-12-31 | 京东城市(南京)科技有限公司 | 数据共享方法、装置、数字网关及计算机可读存储介质 |
| CN109919318B (zh) * | 2018-12-14 | 2023-08-08 | 创新先进技术有限公司 | 数据处理方法、装置和设备 |
| CN109633289A (zh) * | 2018-12-28 | 2019-04-16 | 集美大学 | 一种基于倒谱和卷积神经网络的电磁红信息检测方法 |
| WO2019072315A2 (en) * | 2019-01-11 | 2019-04-18 | Alibaba Group Holding Limited | LOGISTIC REGRESSION MODELING SCHEME USING SECRET SHARING |
| CN110232507B (zh) * | 2019-05-28 | 2021-07-27 | 中国人民解放军国防科技大学 | 基于智能合约的众包活动全过程监管方法及系统 |
-
2019
- 2019-08-09 CN CN201910734792.8A patent/CN110569228B/zh active Active
-
2020
- 2020-01-14 WO PCT/CN2020/072084 patent/WO2021027259A1/zh not_active Ceased
- 2020-03-04 TW TW109107096A patent/TWI717221B/zh not_active IP Right Cessation
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104168114A (zh) * | 2014-08-07 | 2014-11-26 | 河海大学 | 一种分布式的基于(k,n)门限证书加密方法及系统 |
| CN105071938A (zh) * | 2015-07-14 | 2015-11-18 | 中国科学技术大学 | 一种基于门限秘密共享的组认证方法 |
| US20190245682A1 (en) * | 2018-02-06 | 2019-08-08 | Wickr Inc. | Facilitating Communications using Hybrid Cryptography |
| CN109977694A (zh) * | 2019-03-11 | 2019-07-05 | 暨南大学 | 一种基于协作深度学习的数据共享方法 |
| CN110472439A (zh) * | 2019-08-09 | 2019-11-19 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110555315A (zh) * | 2019-08-09 | 2019-12-10 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110555525A (zh) * | 2019-08-09 | 2019-12-10 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110569228A (zh) * | 2019-08-09 | 2019-12-13 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110569227A (zh) * | 2019-08-09 | 2019-12-13 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110580410A (zh) * | 2019-08-09 | 2019-12-17 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
| CN110580409A (zh) * | 2019-08-09 | 2019-12-17 | 阿里巴巴集团控股有限公司 | 模型参数确定方法、装置和电子设备 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN121122603A (zh) * | 2025-11-13 | 2025-12-12 | 浪潮电子信息产业股份有限公司 | 一种数据批量处理方法及设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110569228B (zh) | 2020-08-04 |
| TW202107459A (zh) | 2021-02-16 |
| TWI717221B (zh) | 2021-01-21 |
| CN110569228A (zh) | 2019-12-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI717221B (zh) | 模型參數確定方法、裝置和電子設備 | |
| TWI761778B (zh) | 模型參數確定方法、裝置和電子設備 | |
| CN110555525B (zh) | 模型参数确定方法、装置和电子设备 | |
| CN110472439A (zh) | 模型参数确定方法、装置和电子设备 | |
| CN110569227B (zh) | 模型参数确定方法、装置和电子设备 | |
| CN110580410A (zh) | 模型参数确定方法、装置和电子设备 | |
| US10803184B2 (en) | Generation of a model parameter | |
| US10936960B1 (en) | Determining model parameters using secret sharing | |
| US20200177364A1 (en) | Determining data processing model parameters through multiparty cooperation | |
| US10873452B1 (en) | Secret sharing data exchange for generating a data processing model | |
| CN111967035B (zh) | 模型训练方法、装置和电子设备 | |
| CN110580409A (zh) | 模型参数确定方法、装置和电子设备 | |
| TWI710981B (zh) | 損失函數取值的確定方法、裝置和電子設備 | |
| CN112507323A (zh) | 基于单向网络的模型训练方法、装置和计算设备 | |
| CN112511361B (zh) | 模型训练方法、装置和计算设备 | |
| WO2021027598A1 (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018718A (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018718B (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018912A (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018139A (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018912B (zh) | 模型参数确定方法、装置和电子设备 | |
| CN113011459A (zh) | 模型训练方法、装置和计算设备 | |
| HK40018826B (zh) | 模型参数确定方法、装置和电子设备 | |
| HK40018826A (zh) | 模型参数确定方法、装置和电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20851972 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20851972 Country of ref document: EP Kind code of ref document: A1 |