Model training method, device and electronic equipment
By combining knowledge distillation and hyperparameter optimization in network structure search technology, the optimal knowledge distillation parameters of the sub-network are determined and the target model is trained, which solves the problem of insufficient model processing capabilities caused by low sub-network accuracy and achieves more efficient data deal with.
Patent Information
- Application Number
- CN202110522759.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-13
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-05-13
AI Technical Summary
In the existing network structure search technology, the low accuracy of the sub-network results in a low data processing ability of the model generated by the final training.
By searching each sub-network from the super-network, perform hyper-parameter optimization on the knowledge distillation parameters of the sub-network based on the benchmark model, determine the target knowledge distillation parameters that make the sub-network network performance the highest, and sort from high to low in order of network performance. Determine the target sub-network in the sub-network and conduct training to generate a target model with higher data processing capabilities.
It achieves automatic and accurate determination of the optimal knowledge distillation parameters, thereby training a target model with higher data processing capabilities and improving the accuracy and efficiency of data processing.
Smart Images

Figure CN113240108B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a model training method, device, and electronic device. Background Art
[0002] Neural Architecture Search (NAS) is a technique for searching for sub-networks by evaluating their performance. Generally, if the performance of the sub-network found is high, the model generated based on the training of the sub-network can have a higher data processing capability.
[0003] In the related art, due to the low accuracy of the search sub-network, the model finally trained and generated has a low ability to process data. Summary of the invention
[0004] This disclosure section is provided to introduce concepts in a brief form, which will be described in detail in the detailed description section below. This disclosure section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] The embodiments of the present disclosure provide a model training method, device and electronic device, which can train a target sub-network into a target model with higher data processing capability.
[0006] In a first aspect, an embodiment of the present disclosure provides a model training method, the method comprising: for each sub-network searched from a hypernetwork, optimizing the hyper-parameters of the knowledge distillation parameters of the sub-network based on a baseline model, and determining a target knowledge distillation parameter that maximizes the network performance of the sub-network; determining a target sub-network from the multiple searched sub-networks in order of network performance from high to low; and training the target sub-network as a target model based on the target knowledge distillation parameter that maximizes the network performance of the target sub-network.
[0007] In a second aspect, an embodiment of the present disclosure provides a model training device, which includes: a first determination unit, for optimizing the hyperparameters of the knowledge distillation parameters of each sub-network searched from the hypernetwork based on the baseline model, and determining the target knowledge distillation parameters that give the sub-network the highest network performance; a second determination unit, for determining the target sub-network from the searched multiple sub-networks in order of network performance from high to low; and a training unit, for training the target sub-network into a target model based on the target knowledge distillation parameters that give the target sub-network the highest network performance.
[0008] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the model training method as described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the model training method as described in the first aspect.
[0010] The model training method, device and electronic device provided by the embodiments of the present disclosure, for each sub-network searched from the super-network, determine the target knowledge distillation parameters that make the network performance of the sub-network the highest by combining knowledge distillation and hyperparameter optimization, and further determine the target sub-network from the searched multiple sub-networks in order of network performance from high to low. Thus, by combining knowledge distillation and hyperparameter optimization, the target sub-network is searched from the super-network. In this process, the optimal knowledge distillation parameters (that is, the target knowledge distillation parameters) can be automatically and accurately determined for the sub-network. Thus, based on the target knowledge distillation parameters that make the network performance of the target sub-network the highest, the target sub-network can be trained as a target model with higher data processing capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0012] Figure 1 is a flowchart of some embodiments of the model training method according to the present disclosure;
[0013] Figure 2 is a flowchart of some embodiments of the model training method according to the present disclosure;
[0014] Figure 3 is a flowchart of some embodiments of the model training method according to the present disclosure;
[0015] Figure 4 is a schematic diagram of the structure of some embodiments of the model training device according to the present disclosure;
[0016] Figure 5 is an exemplary system architecture to which the model training methods of some embodiments of the present disclosure may be applied;
[0017] Figure 6is a schematic diagram of a basic structure of an electronic device provided according to some embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0019] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0020] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0021] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0022] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0024] Please refer to Figure 1 , which shows the process of some embodiments of the model training method according to the present disclosure. Figure 1 As shown, the model training method includes the following steps:
[0025] Step 101, for each sub-network searched from the hyper-network, the hyper-parameter optimization of the knowledge distillation parameters of the sub-network is performed based on the benchmark model to determine the target knowledge distillation parameters that maximize the network performance of the sub-network.
[0026] In this embodiment, the execution subject of the model training method (for example, Figure 5 The server 504 shown in FIG. 5 ) can search for sub-networks from the super-network.
[0027] The subnetworks searched in the supernetwork can share the parameters of the supernetwork.
[0028] Typically, the above execution entity can search multiple sub-networks from the super-network
[0029] In this embodiment, for each sub-network being searched, the execution entity may optimize the hyperparameters of the knowledge distillation parameters of the sub-network based on the benchmark model to determine the target knowledge distillation parameters that maximize the network performance of the sub-network.
[0030] The benchmark model is used to perform knowledge distillation on the subnetwork to achieve subnetwork training. It is understandable that the trained subnetwork can achieve the same function as the benchmark model. As an example, if the benchmark model is used for data classification (for example, image classification), the trained subnetwork can also be used for data classification. As an example, if the benchmark model is used for data recognition (for example, image recognition or speech recognition), the trained subnetwork can also be used for data recognition. Of course, the benchmark model can also be a model for implementing other functions, which are not listed here one by one.
[0031] In practical applications, the baseline model can be a pre-trained model. Usually, the structure of the baseline model is more complex than that of the sub-network.
[0032] The knowledge distillation parameters are the relevant parameters for performing knowledge distillation on the sub-network using the benchmark model.
[0033] In some scenarios, the above-mentioned execution entity can use a hyperparameter optimization algorithm to perform the following steps: based on different knowledge distillation parameters, use a benchmark model to perform knowledge distillation on the sub-network; determine the network performance of the sub-network after knowledge distillation; and determine the target knowledge distillation parameters that maximize the network performance of the sub-network.
[0034] The hyperparameter optimization algorithm can be selected according to specific needs and is not specifically limited here.
[0035] The network performance of a sub-network may include data processing accuracy, data processing speed, etc.
[0036] It can be seen that for each sub-network searched from the hypernetwork, the above-mentioned execution entities can determine the corresponding target knowledge distillation parameters.
[0037] Step 102, determining a target sub-network from the searched multiple sub-networks in descending order of network performance.
[0038] In this embodiment, the execution subject may determine the target sub-network from the searched multiple sub-networks in descending order of network performance.
[0039] The execution subject may determine one or more target subnetworks from the searched multiple subnetworks.
[0040] Step 103: Based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, the target sub-network is trained into a target model.
[0041] In this embodiment, the execution subject may train the target sub-network into a target model based on the target knowledge distillation parameters that maximize the network performance of the target sub-network.
[0042] Usually, the target sub-network identified from the hyper-network needs further training before it can be applied to data processing.
[0043] In this embodiment, for each sub-network searched from the hyper-network, a target knowledge distillation parameter that maximizes the network performance of the sub-network is determined by combining knowledge distillation and hyper-parameter optimization, and further, a target sub-network is determined from the searched multiple sub-networks in descending order of network performance. Thus, a target sub-network is searched from the hyper-network by combining knowledge distillation and hyper-parameter optimization.
[0044] In this process, the optimal knowledge distillation parameters (i.e., target knowledge distillation parameters) can be automatically and accurately determined for the sub-network. On the one hand, it is possible to avoid multiple manual adjustments to the knowledge distillation parameters and determine the optimal knowledge distillation parameters in a shorter time. On the other hand, based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, the target sub-network can be trained to a target model with higher data processing capabilities (e.g., data processing accuracy, data processing efficiency, etc.).
[0045] It can be seen that if electronic devices use target models to process data, the accuracy and efficiency of data processing by the electronic devices can be improved.
[0046] In some embodiments, the above execution entity may be Figure 2 The process shown in the figure trains the target sub-network into the target model. The process includes the following steps:
[0047] Step 201 , based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, use the benchmark model to perform knowledge distillation on the target sub-network to train the target sub-network into a target model.
[0048] Therefore, under the guidance of the benchmark model, the target sub-network is trained to be the target model. Referring to the above analysis, the benchmark model is a pre-trained model with a relatively complex structure. Therefore, under the guidance of the benchmark model, the target sub-network can be trained to be a target model with a simple structure and high data processing accuracy.
[0049] In some embodiments, the above execution entity may be Figure 3 The process shown in the figure determines the target knowledge distillation parameters that maximize the network performance of the sub-network. The process includes the following steps:
[0050] Step 301, based on the benchmark model, the hyperparameter optimization of the knowledge distillation parameters of the sub-network is performed, and the processing steps are executed in a loop.
[0051] The above processing steps include the following steps:
[0052] Step 3011, selecting knowledge distillation parameters for performing knowledge distillation on the sub-network.
[0053] In some scenarios, the execution entity may randomly select knowledge distillation parameters for performing knowledge distillation on the sub-network from a predetermined data set.
[0054] Step 3012: Based on the selected knowledge distillation parameters, the sub-network is subjected to knowledge distillation using the benchmark model to train the sub-network.
[0055] Step 3013, determining the network performance of the sub-network after training.
[0056] Similar to the foregoing, after training the sub-network, the data processing accuracy, data processing speed, etc. of the sub-network can be determined.
[0057] Step 302: taking the knowledge distillation parameters that maximize the network performance of the sub-network as target knowledge distillation parameters.
[0058] Thus, for each sub-network searched from the hyper-network, in the process of hyper-parameter optimization, the network performance of the sub-network is determined based on the knowledge distillation of the sub-network by the benchmark model. Through the knowledge distillation of the sub-network by the benchmark model, the network performance of the sub-network can be evaluated more accurately. Furthermore, the target knowledge distillation that makes the network performance of the sub-network the highest can be determined more accurately, and the target sub-network can be searched from the hyper-network more accurately.
[0059] In some embodiments, the knowledge distillation parameters include at least one of the following: a distillation network layer selected from the network layers included in the baseline model; a distillation loss function selected from a predetermined set of loss functions; and weights of the distillation loss function and the sub-network loss function selected from a predetermined weight range.
[0060] Therefore, in the process of hyperparameter optimization, the sub-network training can be taught using the benchmark model based on the distillation network layer, distillation loss function and sub-network loss function, and the network performance of the sub-network can be further evaluated.
[0061] In some scenarios, after searching the target sub-network from the super-network, the target sub-network can be trained as a target model based on the distillation network layer that gives the target sub-network the highest network performance, the distillation loss function, the weight of the distillation loss function, and the weight of the sub-network loss function.
[0062] In some embodiments, the distillation network layer is an intermediate layer or an output layer included in the baseline model.
[0063] In practical applications, the baseline model may include multiple intermediate layers and may also include one or more output layers.
[0064] Thus, the training of the sub-network can be taught through the intermediate layers or output layers included in the baseline model.
[0065] In some embodiments, the above step 3011 includes: selecting a distillation network layer for performing knowledge distillation on the sub-network from the network layers included in the baseline model; selecting a distillation loss function for performing knowledge distillation on the sub-network from a predetermined set of loss functions; and selecting weights of the distillation loss function and the sub-network loss function respectively from a predetermined weight range.
[0066] The loss function set includes various loss functions that can be used for knowledge distillation, such as variance loss function, cross entropy loss function, etc.
[0067] The sub-network loss function may be a loss function pre-set for the sub-network. In practical applications, the sub-network loss function may be set according to the structural characteristics of the super-network.
[0068] In some scenarios, the weight range may include integers greater than or equal to 1 and less than or equal to 9.
[0069] Therefore, in the process of hyperparameter optimization, the distillation network layer, distillation loss function, the weight of the distillation loss function and the weight of the sub-network loss function can be selected in a targeted manner.
[0070] In some embodiments, the total loss function for performing knowledge distillation on a sub-network using a baseline model is a weighted value of the sub-network loss function and the distillation loss function.
[0071] As an example, the weight of the sub-network loss function F1 is a1, and the weight of the distillation loss function F2 is a2. Then, the total loss function for knowledge distillation of the sub-network using the baseline model is "F1×a1+F2×a2".
[0072] In some scenarios, for each sub-network, during the hyperparameter optimization process, the execution entity may use a weighted value of the sub-network loss function and the selected distillation loss function as the total loss function for training the sub-network using the benchmark model.
[0073] In some scenarios, after searching the target sub-network from the hypernetwork, the above-mentioned execution entity may use the weighted value of the sub-network loss function and the distillation loss function that give the target sub-network the highest network performance as the total loss function for training the target sub-network using the benchmark model.
[0074] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a model training device, which is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0075] like Figure 4 As shown, the model training device of this embodiment includes a first determination unit 401, a second determination unit 402 and a training unit 403. The first determination unit 401 is used to: for each sub-network searched from the super network, based on the benchmark model, optimize the hyper-parameters of the knowledge distillation parameters of the sub-network, and determine the target knowledge distillation parameters that make the network performance of the sub-network the highest. The second determination unit 402 is used to: determine the target sub-network from the searched multiple sub-networks in order of network performance from high to low. The training unit 403 is used to: train the target sub-network into a target model based on the target knowledge distillation parameters that make the network performance of the target sub-network the highest.
[0076] In this embodiment, the specific processing of the first determination unit 401, the second determination unit 402 and the training unit 403 of the model training device and the technical effects thereof can be referred to respectively. Figure 1 The relevant descriptions of step 101, step 102 and step 103 in the corresponding embodiment are not repeated here.
[0077] In some embodiments, the training unit 403 is further used to: based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, use the benchmark model to perform knowledge distillation on the target sub-network to train the target sub-network into the target model.
[0078] In some embodiments, the first determination unit 401 is further used to: optimize the hyper-parameters of the knowledge distillation parameters of the sub-network based on the benchmark model, and loop through the following processing steps: select knowledge distillation parameters for performing knowledge distillation on the sub-network; perform knowledge distillation on the sub-network using the benchmark model based on the selected knowledge distillation parameters to train the sub-network; determine the network performance of the sub-network after training; and use the knowledge distillation parameters that give the sub-network the highest network performance as the target knowledge distillation parameters.
[0079] In some embodiments, the first determination unit 401 is further used to: select a distillation network layer for performing knowledge distillation on the sub-network from the network layers included in the baseline model; select a distillation loss function for performing knowledge distillation on the sub-network from a predetermined set of loss functions; and select weights of the distillation loss function and the sub-network loss function respectively from a predetermined weight range.
[0080] In some embodiments, the total loss function for performing knowledge distillation on the sub-network using the baseline model is a weighted value of the sub-network loss function and the distillation loss function.
[0081] In some embodiments, the knowledge distillation parameters include at least one of the following: a distillation network layer selected from the network layers included in the baseline model; a distillation loss function selected from a predetermined set of loss functions; and weights of the distillation loss function and the sub-network loss function selected from a predetermined weight range.
[0082] In some embodiments, the distillation network layer is an intermediate layer or an output layer included in the baseline model.
[0083] Further references Figure 5 , Figure 5 An exemplary system architecture is shown in which the model training methods of some embodiments of the present disclosure can be applied.
[0084] like Figure 5 As shown, the system architecture may include terminal devices 501, 502, a network 503, and a server 504. The network 503 is used to provide a medium for a communication link between the terminal devices 501, 502 and the server 504. The network 503 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0085] The server 504 can implement various functions. In some scenarios, the server 504 can optimize the hyperparameters of the knowledge distillation parameters of each sub-network searched from the hyper-network based on the benchmark model, determine the target knowledge distillation parameters that make the network performance of the sub-network the highest, further, determine the target sub-network from the searched multiple sub-networks in descending order of network performance, and further, train the target sub-network as a target model based on the target knowledge distillation parameters that make the network performance of the target sub-network the highest.
[0086] The server 504 may be hardware or software. When the server 504 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server 504 is software, it may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services), or as a single software or software module. No specific limitation is made here.
[0087] The terminal devices 501 and 502 can interact with the server 504 through the network 503. Various client applications can be installed on the terminal devices 501 and 502. For example, image processing applications, audio and video processing applications, etc. can be installed on the terminal devices 501 and 502. In some scenarios, the terminal devices 501 and 502 can send data to be processed (for example, images, audio or video, etc.) to the server 504. Further, the server 504 can use the trained target model to process the received data and generate a data processing result.
[0088] Terminal devices 501 and 502 may be hardware or software. When terminal devices 501 and 502 are hardware, they may be various electronic devices having a display screen and supporting information interaction, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers. When terminal devices 501 and 502 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.
[0089] It should be noted that the server 504 may only train the searched target sub-network as a target model, without further using the target model to process the data sent by the terminal devices 501 and 502. Figure 5 The system architecture shown may not include the terminal devices 501 , 502 .
[0090] It should be noted that the model training method provided in the embodiments of the present disclosure can be executed by the server 504 , and accordingly, the model training device can be set in the server 504 .
[0091] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0092] Reference below Figure 6 , which shows an electronic device suitable for implementing some embodiments of the present disclosure (e.g., Figure 5 The terminal devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0093] like Figure 6 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of the electronic device are also stored. The processing device 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0094] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0095] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0096] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0097] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0098] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: for each sub-network searched from the hyper-network, based on the benchmark model, optimizes the hyper-parameters of the knowledge distillation parameters of the sub-network, and determines the target knowledge distillation parameters that give the sub-network the highest network performance; determines the target sub-network from the multiple sub-networks searched in order of network performance from high to low; and trains the target sub-network into a target model based on the target knowledge distillation parameters that give the target sub-network the highest network performance.
[0099] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0100] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0101] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The names of these units do not limit the units themselves in some cases. For example, the second determination unit may also be described as a unit that "determines the target subnetwork from the searched multiple subnetworks in descending order of network performance."
[0102] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0103] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0104] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution.
[0105] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0106] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A model training method, characterized in that: include: For each sub-network searched from the hyper-network, the hyper-parameter optimization of the knowledge distillation parameters of the sub-network is performed based on the benchmark model, and the target knowledge distillation parameters that maximize the network performance of the sub-network are determined; The benchmark model is used for image classification, image recognition, or speech recognition; Determine the target sub-network from the searched multiple sub-networks in descending order of network performance; Based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, training the target sub-network into a target model; The hyper-parameter optimization of the knowledge distillation parameters of the sub-network based on the benchmark model to determine the target knowledge distillation parameters that maximize the network performance of the sub-network includes: Based on the benchmark model, the hyperparameter optimization of the knowledge distillation parameters of the sub-network is performed, and the following processing steps are performed cyclically: selecting the knowledge distillation parameters for performing knowledge distillation on the sub-network; based on the selected knowledge distillation parameters, performing knowledge distillation on the sub-network using the benchmark model to train the sub-network; determining the network performance of the sub-network after training; The knowledge distillation parameters that make the network performance of the sub-network the highest are used as the target knowledge distillation parameters; The step of selecting the knowledge distillation parameters for performing knowledge distillation on the sub-network includes: Selecting a distillation network layer for performing knowledge distillation on the sub-network from the network layers included in the benchmark model; Selecting a distillation loss function for performing knowledge distillation on the sub-network from a predetermined set of loss functions; The weights of the distillation loss function and the sub-network loss function are selected from a predetermined weight range, respectively.
2. The method according to claim 1, characterized in that The step of training the target sub-network into a target model based on the target knowledge distillation parameter that maximizes the network performance of the target sub-network includes: Based on the target knowledge distillation parameters that maximize the network performance of the target sub-network, the target sub-network is subjected to knowledge distillation using the baseline model to train the target sub-network into the target model.
3. The method according to claim 1, characterized in that: The total loss function of performing knowledge distillation on the sub-network using the benchmark model is a weighted value of the sub-network loss function and the distillation loss function.
4. The method according to any one of claims 1 to 3, characterized in that: The knowledge distillation parameters include at least one of the following: A distilled network layer is selected from the network layers included in the benchmark model; A distillation loss function is selected from a predetermined set of loss functions; The weights of the distillation loss function and the sub-network loss function are selected from a predetermined range of weights.
5. The method according to claim 4, characterized in that The distillation network layer is an intermediate layer or output layer included in the baseline model.
6. A model training device, characterized in that: include: A first determination unit is used to optimize the hyperparameters of the knowledge distillation parameters of each sub-network searched from the super-network based on the benchmark model, and determine the target knowledge distillation parameters that maximize the network performance of the sub-network; The benchmark model is used for image classification, image recognition, or speech recognition; A second determining unit is used to determine a target sub-network from the searched multiple sub-networks in descending order of network performance; A training unit, configured to train the target subnetwork into a target model based on a target knowledge distillation parameter that maximizes the network performance of the target subnetwork; The hyper-parameter optimization of the knowledge distillation parameters of the sub-network based on the benchmark model to determine the target knowledge distillation parameters that maximize the network performance of the sub-network includes: Based on the benchmark model, the hyperparameter optimization of the knowledge distillation parameters of the sub-network is performed, and the following processing steps are performed cyclically: selecting the knowledge distillation parameters for performing knowledge distillation on the sub-network; based on the selected knowledge distillation parameters, performing knowledge distillation on the sub-network using the benchmark model to train the sub-network; determining the network performance of the sub-network after training; The knowledge distillation parameters that make the network performance of the sub-network the highest are used as the target knowledge distillation parameters; The step of selecting the knowledge distillation parameters for performing knowledge distillation on the sub-network includes: Selecting a distillation network layer for performing knowledge distillation on the sub-network from the network layers included in the benchmark model; Selecting a distillation loss function for performing knowledge distillation on the sub-network from a predetermined set of loss functions; The weights of the distillation loss function and the sub-network loss function are selected from a predetermined weight range, respectively.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.
8. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
