Model training correction method and related equipment
By collecting and analyzing the historical gradient information of the deep neural network model in real time, and dynamically adjusting the gradient correction strategy and amplitude, the problem of instability in model training is solved, and the stability and convergence speed of training are improved.
Patent Information
- Application Number
- CN202411978718.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
Large-scale deep neural network models have training instability problems during training, resulting in gradient fluctuations and instability, affecting the convergence results of the model.
During the iterative training of the large model, historical gradient information of multiple network layers is collected in real time, correction strategies are determined based on this information, and correction amplitude is adjusted according to the network layer, and the current gradient information is corrected to obtain the corrected gradient information.
Through dynamic gradient correction, the oscillation and instability in the later stage of training are reduced, and the stability and convergence speed of model training are improved.
Smart Images

Figure CN119903892A_ABST
Abstract
Description
Background Art
[0002] With the widespread application of deep learning in computer vision, natural language processing, recommendation systems and other fields, the scale and complexity of deep neural network models continue to increase.
[0003] The training of large-scale models places higher demands on convergence speed and training accuracy. Traditional adaptive optimization algorithms (such as Adam, AdaGrad, and RMSprop) have become mainstream. They can dynamically adjust the learning rate based on the historical information of the gradient to accelerate model training to a certain extent. However, in related technologies, the training process of large models still has the problem of unstable training.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a correction method for model training and related equipment, which at least to a certain extent overcome the problem of unstable training in related technologies.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] In a first aspect, an embodiment of the present disclosure provides a correction method for model training, the method comprising:
[0008] During the iterative training of the large model, the historical gradient information of the network parameters of multiple network layers is collected in real time during each iterative update;
[0009] Determining a correction strategy according to the historical gradient information;
[0010] According to the network layer of the large model, adjusting the correction amplitude of the correction strategy to determine the correction amplitude of the current correction;
[0011] According to the correction strategy and the correction amplitude of the current correction, the current gradient information of each network layer of the large model is corrected to obtain the corrected gradient information.
[0012] In a possible embodiment, the method further includes:
[0013] Acquire feedback information of the training process of the large model in real time; the feedback information includes at least: loss curve and gradient change;
[0014] According to the feedback information, the training process of the large model is divided into multiple stages;
[0015] According to the network layers of the large model, determining a learning rate adjustment strategy corresponding to each network layer;
[0016] During the training process, the current learning rate of the large model is adjusted according to the preset learning rate adjustment strategy of each stage and the learning rate adjustment strategy corresponding to each network layer.
[0017] In a possible embodiment, the historical gradient information includes at least: historical gradient fluctuation amplitude, historical update frequency, and historical loss curve change rate.
[0018] In a possible embodiment, determining a correction strategy according to the gradient information includes:
[0019] Determining the gradient fluctuation amplitude;
[0020] If the historical gradient fluctuation amplitude is greater than a first threshold, determining that the correction strategy is to reduce the historical gradient fluctuation amplitude;
[0021] If the historical gradient fluctuation amplitude is less than the second threshold, the correction strategy is determined to be to increase the historical gradient fluctuation amplitude.
[0022] In a possible embodiment, determining a correction strategy according to the gradient information includes:
[0023] Determine the historical update frequency of any parameter layer;
[0024] If the historical update frequency is greater than a third threshold, determining that the correction strategy is to reduce the historical update frequency;
[0025] If the history update frequency is less than a fourth threshold, the correction strategy is determined to be to increase the history update frequency.
[0026] In a possible embodiment, determining a correction strategy according to the gradient information includes:
[0027] Determining a rate of change of the historical loss curve;
[0028] If the change rate of the historical loss curve is greater than a fifth threshold, determining that the correction strategy is to reduce the correction amplitude;
[0029] If the change rate of the historical loss curve is less than a sixth threshold, the correction strategy is determined to be to increase the correction amplitude.
[0030] In a possible embodiment, the network layer includes at least: a convolutional layer, a fully connected layer and a normalization layer.
[0031] In a second aspect, an embodiment of the present disclosure provides a correction device for model training, comprising:
[0032] The collection unit is used to collect the historical gradient information of network parameters of multiple network layers in real time during each iterative update during the iterative training of the large model;
[0033] A first determining unit, configured to determine a correction strategy according to the historical gradient information;
[0034] A second determination unit is used to adjust the correction amplitude of the correction strategy according to the network layer of the large model to determine the correction amplitude of the current correction;
[0035] The correction unit is used to correct the current gradient information of each network layer of the large model according to the correction strategy and the correction amplitude of the current correction to obtain the corrected gradient information.
[0036] In a possible embodiment, the correction device for model training further includes:
[0037] A learning rate adjustment unit, used to obtain feedback information of the training process of the large model in real time; the feedback information at least includes: a loss curve and a gradient change;
[0038] According to the feedback information, the training process of the large model is divided into multiple stages;
[0039] According to the network layers of the large model, determining a learning rate adjustment strategy corresponding to each network layer;
[0040] During the training process, the current learning rate of the large model is adjusted according to the preset learning rate adjustment strategy of each stage and the learning rate adjustment strategy corresponding to each network layer.
[0041] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method described in the first aspect above by executing the executable instructions.
[0042] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method described in the first aspect when executed by a processor.
[0043] In a fifth aspect, according to another aspect of the present disclosure, a computer program product or a computer program is also provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes any of the above-mentioned methods.
[0044] The embodiments of the present disclosure provide a correction method and related equipment for model training, the method comprising: in the process of iterative training of a large model, at each iterative update, real-time collection of historical gradient information of network parameters of multiple network layers; determining a correction strategy based on the historical gradient information; adjusting the correction amplitude of the correction strategy based on the network layer of the large model to determine the correction amplitude of the current correction; correcting the current gradient information of each network layer of the large model based on the correction strategy and the correction amplitude of the current correction to obtain the corrected gradient information. By monitoring and analyzing the historical gradient information during iterative training, the direction and amplitude of the gradient update are adaptively corrected, the oscillation and instability in the later stage of training are reduced, and the stability and convergence speed of training are improved.
[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0047] Figure 1 A flowchart showing a correction method for model training in an embodiment of the present disclosure is shown;
[0048] Figure 2 A flowchart showing another correction method for model training in an embodiment of the present disclosure is shown;
[0049] Figure 3 A schematic diagram showing the structure of a correction device for model training in an embodiment of the present disclosure is shown;
[0050] Figure 4 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0052] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0053] With the widespread application of deep learning in computer vision, natural language processing, recommendation systems and other fields, the scale and complexity of deep neural network models continue to increase.
[0054] The training of large-scale models places higher demands on convergence speed and training accuracy. Traditional adaptive optimization algorithms (such as Adam, AdaGrad, and RMSprop) have become mainstream. They can dynamically adjust the learning rate based on the historical information of the gradient to accelerate model training to a certain extent. However, in related technologies, the training process of large models still has the problem of unstable training.
[0055] For example, traditional adaptive optimization algorithms are prone to gradient fluctuations and instability during the training process, which affects the convergence results of the model, especially in the later stages.
[0056] Based on this, the embodiment of the present disclosure provides a correction method for model training and related equipment, the method comprising: in the process of iterative training of a large model, collecting gradient information at each iterative update, determining a correction strategy based on the gradient information, obtaining the network layer of the large model, determining the correction amplitude of the correction strategy, and correcting the gradient information of each network layer at the next iterative update based on the correction strategy and the correction amplitude. By analyzing the gradient information during the iterative training process, the gradient update direction and amplitude of each layer are adaptively corrected to ensure the stability and convergence effect of the training.
[0057] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.
[0058] First, a correction method for model training is provided in an embodiment of the present disclosure. The method can be executed by any electronic device with computing and processing capabilities. In the following process, the electronic device is taken as a server as an example.
[0059] Figure 1 A flow chart of a correction method for model training in an embodiment of the present disclosure is shown, Figure 1 As shown, the correction method for model training provided in the embodiment of the present disclosure includes the following steps:
[0060] S102: During the iterative training of the large model, historical gradient information is collected during each iterative update.
[0061] The historical gradient information includes at least: gradient fluctuation amplitude, update frequency and loss curve change rate.
[0062] Each time the parameters of the large model are updated and iterated, the system will collect and record the gradient information of the parameters of each layer in real time, that is, the historical gradient information, for example:
[0063] Gradient fluctuation amplitude: records the fluctuation of the parameter gradient of each layer. Large fluctuations may lead to unstable training results.
[0064] Update frequency: Monitor the frequency of parameter updates at each layer. Too frequent gradient updates may indicate high sensitivity of the parameters.
[0065] Loss curve change rate: The rate of change of the loss curve is analyzed. When it decreases rapidly, it indicates that the model learning efficiency is high, but a smoother learning rate adjustment may be required in the later stage of the model training process to avoid excessive fluctuations.
[0066] S104: Determine a correction strategy based on historical gradient information.
[0067] In a possible embodiment, the system generates an adaptive correction strategy based on multiple factors through comprehensive analysis of historical gradient information.
[0068] Exemplarily, if the historical gradient fluctuation amplitude is greater than a first threshold, the correction strategy is determined to be to reduce the historical gradient fluctuation amplitude; if the historical gradient fluctuation amplitude is less than a second threshold, the correction strategy is determined to be to increase the historical gradient fluctuation amplitude.
[0069] For example, if the gradient fluctuates greatly, the correction strategy will automatically increase the smoothness of the update and reduce the amplitude of each update, thereby reducing training instability.
[0070] Exemplarily, the historical update frequency of any parameter layer is determined; if the historical update frequency is greater than the third threshold, the correction strategy is determined to be to reduce the historical update frequency; if the historical update frequency is less than the fourth threshold, the correction strategy is determined to be to increase the historical update frequency.
[0071] Appropriately reducing the correction amplitude of the network parameters of the network layers with higher update frequency can ensure the gradualness and convergence of the training.
[0072] Exemplarily, the rate of change of the historical loss curve is determined; if the rate of change of the historical loss curve is greater than the fifth threshold, the correction strategy is determined to reduce the correction amplitude of the large model; if the rate of change of the historical loss curve is less than the first threshold, the correction strategy is determined to increase the correction amplitude of the large model.
[0073] When the loss changes rapidly, the system will appropriately reduce the correction amplitude to prevent excessive parameter adjustment, thereby ensuring the precision of subsequent training.
[0074] It should be noted that the correction amplitude in the embodiment of the present disclosure refers to the amount of adjustment made to the gradient during this adjustment. Reducing or increasing the correction amplitude refers to reducing or increasing the correction amplitude based on the correction amplitude during the last adjustment of the gradient information.
[0075] Among them, during the training process of the large model, before the first iteration to update the network parameters, the gradient information is corrected according to the pre-set parameters.
[0076] S106: According to the network layer of the large model, the correction amplitude of the correction strategy is adjusted to obtain the correction amplitude of the current correction.
[0077] In a possible embodiment, the network layer includes at least: a convolutional layer, a fully connected layer, and a normalization layer.
[0078] Different network layers have different parameter characteristics and functions, so differentiated correction strategies are applied at the convolutional layer, fully connected layer, and normalization layer. The following network layers are explained.
[0079] Exemplarily, the correction amplitude of the convolution layer is set to a first amplitude. The first amplitude is greater than the original correction amplitude of the large model.
[0080] Convolutional layer: Since the convolutional layer is used to extract image feature information, the gradient correction amplitude can be large to accelerate feature learning.
[0081] Exemplarily, the correction amplitude of the fully connected layer is set to a second amplitude. The second amplitude is smaller than the first amplitude.
[0082] Fully connected layer: The fully connected layer is usually used to capture the global connection between features. The correction amplitude should be appropriately reduced to ensure smooth optimization of the model.
[0083] Exemplarily, the correction amplitude of the normalization layer is set to a third amplitude. The value of the third amplitude is set to be smaller than the second amplitude to achieve a more detailed correction strategy.
[0084] Among them, a more detailed correction strategy may include: reducing the correction amplitude. It may also include: preset adjustment rules for different network layers.
[0085] Normalization layer: For the normalization layer, a more detailed correction strategy can be set to prevent unstable updates of the normalization parameters.
[0086] S108: According to the correction strategy and the correction amplitude of the current correction, the current gradient information of each network layer of the large model is corrected to obtain the corrected gradient information.
[0087] After correcting the gradient information according to the above method, the system updates the network parameters based on the corrected gradient information, thereby achieving optimization in each iteration.
[0088] Through the above method, under the control of dynamic gradient correction, the stability and convergence speed of model training can be improved. In a neural network with a deep structure, the problem of unstable training is more likely to occur. As the number of network layers increases, the correction method disclosed in the present invention can obtain gradient information suitable for each iterative update, so that the network can avoid turbulence and have better stability. The effect is more obvious than that of a shallow network.
[0089] In the process of gradient correction, there is also a corresponding adjustment method for the learning rate. Figure 2 A flowchart of another correction method for model training in an embodiment of the present disclosure is shown. Figure 2 As shown, the following steps are included:
[0090] S202: Obtain feedback information of the training process of the large model in real time, where the feedback information at least includes: loss curve and gradient change.
[0091] S204: Divide the training process of the large model into multiple stages according to the feedback information.
[0092] By analyzing the downward trend of the loss curve and the fluctuation of the gradient in real time, the training stage can be intelligently identified.
[0093] The system can automatically divide the training process into multiple stages. In the embodiment of the present disclosure, three stages are taken as an example, namely: initial stage, stable stage and convergence stage.
[0094] Initial stage: The model is in the rapid learning stage, and the loss decreases rapidly, which is determined to be the initial stage.
[0095] Stable stage: When the decline rate of the loss curve slows down and the decline rate is less than the stable threshold, it is determined to enter the stable stage.
[0096] Convergence stage: In the final stage of training, the learning rate is further reduced so that the model can gradually reach the optimal accuracy and stability.
[0097] S206: Obtain the network layer of the large model.
[0098] The network layer includes at least: convolutional layer, fully connected layer and normalization layer.
[0099] In a possible embodiment, during the intelligent learning rate adjustment process, differentiated learning rate adjustment strategies are applied to different layers according to the characteristics of the network hierarchy.
[0100] In a possible embodiment, for different network layers, the strategies for setting learning rates in different layers may include:
[0101] Convolutional layer: The convolutional layer uses a more aggressive learning rate strategy to enhance the ability to capture feature patterns. It quickly captures global structural information in the early stages of training and accelerates convergence. The learning rate is set to a higher value to speed up the pace of gradient descent.
[0102] Fully connected layer: The learning rate strategy of the fully connected layer is more gentle to ensure robust optimization in a more complex parameter space. In the stable stage of training, the model has entered a stable optimization state, and it is necessary to reduce training fluctuations and stabilize convergence. Gradually reduce the learning rate to make it gradually close to the basic learning rate.
[0103] Normalization layer: In the normalization layer, a moderate learning rate is used to ensure a stable data distribution and avoid numerical instability caused by changes in the learning rate. During the convergence phase of training, the parameters need to be carefully adjusted to ensure that the model achieves the best accuracy. Set the learning rate to a lower value to make fine parameter adjustments to avoid overfitting or oscillation.
[0104] Exemplarily, the learning rate may be set in such a manner that: the learning rate of the convolutional layer is greater than the learning rate of the fully connected layer, and the learning rate of the fully connected layer is greater than the learning rate of the normalization layer.
[0105] Exemplarily, the learning rate may be set based on the basic learning rate.
[0106] The learning rate of the convolutional layer can be set as: base learning rate × 1.5.
[0107] The learning rate of the fully connected layer can be set as: basic learning rate × 0.75.
[0108] The learning rate of the normalization layer can be set as: basic learning rate × 0.5.
[0109] S208: During the training process, the current learning rate of the large model is adjusted according to the preset learning rate adjustment strategy of each stage and the learning rate adjustment strategy corresponding to each network layer.
[0110] In a possible embodiment, for multiple stages, the learning rate may be set in the following manner:
[0111] In the initial stage, the learning rate can be set higher to accelerate convergence.
[0112] For example, the learning rate in the initial stage is set to a first learning rate, and the first learning rate is greater than the seventh threshold.
[0113] During the stable phase, the system can gradually reduce the learning rate to reduce training fluctuations.
[0114] For example, a learning rate curve in a stable phase is planned, and the learning rate in the stable phase is set to gradually decrease according to the time sequence in the learning rate curve. The maximum value of the learning rate curve is less than the seventh threshold.
[0115] During the convergence phase, the learning rate of the convergence phase can be set to be smaller than the minimum learning rate of the learning rate curve.
[0116] In a possible embodiment, the network layer is first obtained, and the corresponding learning rate adjustment strategy is set according to the network layer. The first target learning rate of each network layer is set respectively as the learning rate of the large model. When it is detected that different stages have been entered, the learning rate of the large model is adjusted according to the preset learning rate adjustment strategy of each stage.
[0117] Through automatic stage switching and learning rate adjustment at different stages, overfitting or underfitting during training can be effectively prevented and the generalization performance of training can be improved.
[0118] Through the above methods, the application of large-scale models can be accelerated, the training efficiency of large-scale deep models can be improved, and enterprises can deploy and iterate AI models faster, thereby reducing training costs, shortening product development cycles, and accelerating the implementation of AI technology.
[0119] In addition, it can also improve model accuracy, enhance user experience and security, and make AI models more accurate in applications by improving the stability of the training process and the generalization ability of the model. For example, in high-precision scenarios such as medical image analysis and financial risk monitoring, it can effectively reduce the misjudgment rate, thereby improving user experience and the security of the application system.
[0120] It should be noted that the method in the embodiments of the present disclosure can be applied to the training of large models, such as distributed large models.
[0121] The method in the embodiments of the present disclosure can be applied to a variety of scenarios.
[0122] For example: autonomous driving, real-time object detection and recognition used in autonomous driving systems: autonomous driving relies on a large amount of real-time image processing and object detection. Through this method, the training efficiency and stability of deep neural networks can be improved, so that the autonomous driving system can more quickly and accurately complete the recognition and tracking of pedestrians, vehicles, road signs and other objects, providing a guarantee for safe driving.
[0123] For example, personalized recommendation is applied in the intelligent optimization of personalized recommendation systems. In e-commerce, video and content platforms, recommendation systems need to process massive amounts of user data and respond quickly to user needs. Through intelligent learning rate adjustment and stable gradient correction mechanism, the recommendation model can learn user preferences more quickly, be more efficient in personalized recommendations, and improve user experience.
[0124] It can also be applied to high-precision scenarios such as medical image analysis and financial risk monitoring, etc., without giving specific examples.
[0125] The method in the disclosed embodiment is mainly to correct the gradient update during the training of a large model, and to adjust the learning rate. Through a dynamic adaptive gradient correction mechanism, real-time monitoring and analysis of historical gradient information, multi-factor correction of gradient updates can be performed, which can more effectively smooth gradient changes and reduce shocks and instability in the later stages of training. It improves the convergence speed and stability of deep neural networks on large-scale data sets, so that the model can still maintain efficient optimization during long-term training.
[0126] Through the multi-stage intelligent learning rate adjustment strategy, the learning rate is flexibly adjusted according to the characteristics of different stages in the training process (such as rapid learning in the early stage, optimization in the stable period, and fine adjustment in the convergence period), and combined with hierarchical adjustment of different hierarchical structures. This strategy overcomes the limitations of fixed learning rate adjustment in existing technologies, allowing the model to automatically adapt to the needs of each stage, converge quickly in the early stage, and maintain fine optimization in the later stage, avoiding overfitting or underfitting, and having higher training efficiency and generalization performance.
[0127] Based on the same inventive concept, the present disclosure also provides a correction device for model training, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0128] Figure 3 A schematic diagram of the structure of a correction device for model training in an embodiment of the present disclosure is shown. Figure 3As shown, the correction device 30 for model training includes: a collection unit 301, which is used to collect historical gradient information of network parameters of multiple network layers in real time during each iterative update during the iterative training of the large model; a first determination unit 302, which is used to determine the correction strategy based on the historical gradient information; a second determination unit 303, which is used to adjust the correction amplitude of the correction strategy according to the network layer of the large model, and determine the correction amplitude of the current correction; a correction unit 304, which is used to correct the current gradient information of each network layer of the large model according to the correction strategy and the correction amplitude of the current correction, to obtain the corrected gradient information.
[0129] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0130] Refer to the following Figure 4 The electronic device 400 according to this embodiment of the present disclosure is described. Figure 4 The electronic device 400 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0131] like Figure 4 As shown, the electronic device 400 is in the form of a general computing device. The components of the electronic device 400 may include but are not limited to: at least one processing unit 410, at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410).
[0132] The storage unit stores program codes, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 410 can perform any step of the above method embodiments.
[0133] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202 , and may further include a read-only storage unit (ROM) 4203 .
[0134] The storage unit 420 may also include a program / utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0135] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0136] The electronic device 400 may also communicate with one or more external devices 440 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 400, and / or communicate with any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 450. Furthermore, the electronic device 400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 460. As shown, the network adapter 460 communicates with other modules of the electronic device 400 via a bus 430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0137] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0138] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the above embodiment.
[0139] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0140] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, 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), 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.
[0141] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a 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.
[0142] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0143] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0144] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0145] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0146] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0147] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A correction method for model training, characterized in that: The method comprises: During the iterative training of the large model, the historical gradient information of the network parameters of multiple network layers is collected in real time during each iterative update; Determining a correction strategy based on the historical gradient information; According to the network layer of the large model, adjusting the correction amplitude of the correction strategy to determine the correction amplitude of the current correction; According to the correction strategy and the correction amplitude of the current correction, the current gradient information of each network layer of the large model is corrected to obtain the corrected gradient information.
2. The method according to claim 1, characterized in that The method further comprises: Acquire feedback information of the training process of the large model in real time; the feedback information at least includes: loss curve and gradient change; According to the feedback information, the training process of the large model is divided into multiple stages; Determine a learning rate adjustment strategy corresponding to each network layer according to the network layer of the large model; During the training process, the current learning rate of the large model is adjusted according to the preset learning rate adjustment strategy of each stage and the learning rate adjustment strategy corresponding to each network layer.
3. The method according to claim 1, characterized in that The historical gradient information includes at least: historical gradient fluctuation amplitude, historical update frequency and historical loss curve change rate.
4. The method according to claim 3, characterized in that Determining a correction strategy according to the gradient information includes: Determining the gradient fluctuation amplitude; If the historical gradient fluctuation amplitude is greater than a first threshold, determining a correction strategy to reduce the historical gradient fluctuation amplitude; If the historical gradient fluctuation amplitude is less than the second threshold, the correction strategy is determined to increase the historical gradient fluctuation amplitude.
5. The method according to claim 3, characterized in that: Determining a correction strategy according to the gradient information includes: Determine the historical update frequency of any parameter layer; If the historical update frequency is greater than a third threshold, determining that the correction strategy is to reduce the historical update frequency; If the history update frequency is less than a fourth threshold, the correction strategy is determined to be to increase the history update frequency.
6. The method according to claim 3, characterized in that Determining a correction strategy according to the gradient information includes: Determining a rate of change of the historical loss curve; If the change rate of the historical loss curve is greater than a fifth threshold, determining that the correction strategy is to reduce the correction amplitude; If the change rate of the historical loss curve is less than a sixth threshold, the correction strategy is determined to be to increase the correction amplitude.
7. The method according to claim 1 or 2, characterized in that: The network layer includes at least: a convolutional layer, a fully connected layer and a normalization layer.
8. A correction device for model training, characterized in that: include: The acquisition unit is used to collect the historical gradient information of network parameters of multiple network layers in real time during each iterative update during the iterative training of the large model; A first determining unit, configured to determine a correction strategy according to the historical gradient information; A second determination unit is used to adjust the correction amplitude of the correction strategy according to the network layer of the large model to determine the correction amplitude of the current correction; The correction unit is used to correct the current gradient information of each network layer of the large model according to the correction strategy and the correction amplitude of the current correction to obtain the corrected gradient information.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Battery bumping damage early warning method and system
CN121385674A