Method and apparatus for generating shared encoder
Abstract
A method and an apparatus for generating a shared encoder are provided, which belongs to a field of computer technology and deep learning. The method includes: sending by a master node a shared encoder training instruction to child nodes, so that each child node obtains training samples based on a type of a target shared encoder included in the training instruction; sending an initial parameter set of the target shared encoder to be trained to each child node after obtaining a confirmation message returned by each child node; obtaining an updated parameter set of the target shared encoder returned by each child node; determining a target parameter set corresponding to the target shared encoder based on a first preset rule and the updated parameter set of the target shared encoder returned by each child node.
Interactive Citation Constellation Global Citation Ranking
Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 8 · Forward citations: 0.
Claims (15 — 3 Independent, 12 Dependent)
- Claim 1Independent Claim
A method for generating a shared encoder, comprising: sending by a master node a shared encoder training instruction comprising a type of a target shared encoder to be trained to child nodes, to allow each child node obtains training samples based on the type; sending an initial parameter set of the target shared encoder to be trained to each child node after obtaining a confirmation message returned by each child node, so that the initial parameter set is trained by each child node with the training samples; obtaining a number of the training samples included in each child node; determining a weight of each child node based on the number of the training samples included in each child node, wherein the weight is used to balance an importance of each child node in a training of the target shared encoder: obtaining an updated parameter set of the target shared encoder returned by each child node; and determining a product of the weight of each child node and a corresponding parameter in the updated parameter set as a value for each parameter in an updated parameter set after modification, and determining a target parameter set corresponding to the target shared encoder by fusing the updated parameter set after modification of each child node based on a first preset rule.
- Claim 2Depends on #1
The method according to claim 1, wherein before sending by the master node the shared encoder training instruction to the child nodes, further comprising: obtaining by the master node a request for obtaining the target shared encoder sent by at least one child node.
- Claim 3Depends on #1
The method according to claim 1, wherein before sending by the master node the shared encoder training instruction to the child nodes, further comprising: obtaining by the master node an update request of the target shared encoder sent by at least one child node, the update request comprising an identifier of the target shared encoder.
- Claim 4Depends on #1
The method according to claim 1, wherein after determining the target parameter set corresponding to the target shared encoder, further comprising: sending the target parameter set corresponding to the target shared encoder to each child node, so that each child node continues to train the target shared encoder based on the target parameter set corresponding to the target shared encoder.
- Claim 5Depends on #4
The method according to claim 4, wherein after sending the target parameter set corresponding to the target shared encoder to each child node, further comprising: obtaining a parameter set of the target shared encoder returned by a first child node again; determining a current weight value for the first child node based on times of the first child node returning the parameter set of the target shared encoder; and updating the target parameter set corresponding to the target shared encoder based on the current weight value for the first child node and the parameter set of the target shared encoder currently returned by the first child node according to the first preset rule.
- Claim 6Depends on #1
The method according to claim 1, wherein before sending the initial parameter set of the target shared encoder to be trained to each child node, further comprising: generating the target shared encoder to be trained according to a second preset rule.
- Claim 7Independent Claim
A method for generating a shared encoder, comprising: obtaining by a child node a shared encoder training instruction sent from a master node, the training instruction comprising a type of a target shared encoder to be trained; returning a confirmation message to the master node after determining that training samples that match the type are included; obtaining an initial parameter set of the target shared encoder sent from the master node; sending a number of training samples that match the type of the target shared encoder to the master node; performing model training with the training samples that match the type to determine an updated parameter set of the target shared encoder; and returning the updated parameter set of the target shared encoder to the master node, so that the master node determines a product of the weight of the child node and a corresponding parameter in the updated parameter set as a value for each parameter in an updated parameter set after modification, and determines a target parameter set corresponding to the target shared encoder by fusing the updated parameter set after modification of each child node based on a first preset rule.
- Claim 8Depends on #7
The method according to claim 7, wherein after returning the confirmation message to the master node, further comprising: obtaining parameter updating rules of the target shared encoder returned by the master node; and returning the updated parameter set of the target shared encoder to the master node comprises: returning the updated parameter set of the target shared encoder to the master node when it is determined that the updating rules are currently met.
- Claim 9Depends on #7
The method according to claim 7, wherein performing model training with the training samples that match the type, further comprising: determining a private encoder and a private decoder corresponding to the target shared encoder.
- Claim 10Independent Claim
An apparatus for generating a shared encoder, comprising: a non-transitory computer-readable medium including computer-executable instructions stored thereon, and an instruction execution system which is configured by the instructions to implement: a first sending module, configured to send by a master node a shared encoder training instruction comprising a type of a target shared encoder to be trained to child nodes, to allow each child node obtains training samples based on the type; a second sending module, configured to send an initial parameter set of the target shared encoder to be trained to each child node after obtaining a confirmation message returned by each child node, so that the initial parameter set is trained by each child node with the training samples; a first obtaining module, configured to obtain an updated parameter set of the target shared encoder returned by each child node; a fourth obtaining module, configured to obtain a number of the training samples included in each child node; a second determining module, configured to determine a weight of each child node based on the number of the training samples included in each child node, wherein the weight is used to balance an importance of each child node in a training of the target shared encoder; and a first determining module, configured to determine a product of the weight of each child node and a corresponding parameter in the updated parameter set as a value for each parameter in an updated parameter set after modification, and determine a target parameter set corresponding to the target shared encoder by fusing the updated parameter set after modification of each child node based on a first preset rule.
- Claim 11Depends on #10
The apparatus according to claim 10, wherein the instruction execution system is further configured by the instructions to implement: a second obtaining module, configured to obtain by the master node a request for obtaining the target shared encoder sent by at least one child node.
- Claim 12Depends on #10
The apparatus according to claim 10, wherein the instruction execution system is further configured by the instructions to implement: a third obtaining module, configured to obtain by the master node an update request of the target shared encoder sent by at least one child node, the update request comprising an identifier of the target shared encoder.
- Claim 13Depends on #10
The apparatus according to claim 10, wherein the instruction execution system is further configured by the instructions to implement: a third sending module, configured to send the target parameter set corresponding to the target shared encoder to each child node, so that each child node continues to train the target shared encoder based on the target parameter set corresponding to the target shared encoder.
- Claim 14Depends on #13
The apparatus according to claim 13, wherein the instruction execution system is further configured by the instructions to implement: a fifth obtaining module, configured to obtain a parameter set of the target shared encoder returned by a first child node again; a third determining module, configured to determine a current weight value for the first child node based on times of the first child node returning the parameter set of the target shared encoder; and an updating module, configured to update the target parameter set corresponding to the target shared encoder based on the current weight value for the first child node and the parameter set of the target shared encoder currently returned by the first child node according to the first preset rule.
- Claim 15Depends on #10
The apparatus according to claim 10, wherein the instruction execution system is further configured by the instructions to implement: a generating module, configured to generate the target shared encoder to be trained according to a second preset rule.
Technical Overview & Description
CROSS-REFERENCE TO RELATED APPLICATION This application is a continuation application of International Application No. PCT/CN2020/083551, filed on Apr. 7, 2020, which claims priority to Chinese patent application No. 201911155509.2 filed on Nov. 22, 2019 with a title of “ METHOD AND APPARATUS FOR GENERATING SHARED ENCODER, AND ELECTRONIC DEVICE ” . TECHNICAL FIELD The present application relates to a field of computer technology, in particular to a field of big data technology, and a method and an apparatus for generating a shared encoder. BACKGROUND Pre-training models have been proven effective in fields of computer vision, natural language processing and so on. It has become a popular practice to perform pre-training with big data and then fine-tune model parameters based on specific tasks. SUMMARY The method and apparatus for generating a shared encoder are provided in the present disclosure. In embodiments of the present disclosure, a method for generating a shared encoder includes: sending by a master node a shared encoder training instruction comprising a type of a target shared encoder to be trained to child nodes, to allow each child node obtains training samples based on the type; sending an initial parameter set of the target shared encoder to be trained to each child node after obtaining a confirmation message returned by each child node, so that the initial parameter set is trained by each child node with the training samples; obtaining an updated parameter set of the target shared encoder returned by each child node; and determining a target parameter set corresponding to the target shared encoder based on a first preset rule and the updated parameter set of the target shared encoder returned by each child node. In embodiments of the present disclosure, a method for generating a shared encoder includes: obtaining by a second child node a shared encoder training instruction sent from a master node, the training instruction comprising a type of a target
Cited By — Indexed Forward Citations (0 of 0 total)
No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.
References Cited — Backward Prior Art (8)
| Patent | Title | Year | Citations |
|---|
Non-Patent Literature (10)
- Hatcher et al (
- “
- A Survey of Deep Learning: Platforms, Applications and Emerging Research Trends
- ”
- 2018) (Year: 2018).
- G
- ü
- nd
- ü
- z et al (