Code recognition model training method and device based on visualization

Through the visual-based code recognition model training method, users can customize the training mode, network structure and hyperparameters of deep learning models, solving the problems of insufficient flexibility and customization in the existing technology, and achieving efficient model training.

CN114691111BActive Publication Date: 2025-03-11BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011586098.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-28
Publication Date
2025-03-11
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

The existing technology lacks flexibility and customization in deep learning model training, and users cannot customize network structures and algorithms. The code-based training mode requires high user capabilities and has a high threshold, resulting in low model training efficiency.

Method used

Provide a visual-based code recognition model training method. By displaying the model configuration page, the model training mode, network structure and hyperparameters input by the user are obtained, the model to be trained is matched, the pre-saved code training samples are loaded, and the model is trained according to the hyperparameters.

Benefits of technology

It reduces the limitations of model training and the cost of user errors, reduces the waste of manpower and resources, does not require users to develop code, reduces the amount of code development, and improves the efficiency of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691111B_ABST
    Figure CN114691111B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide a method and device for training a code recognition model based on visualization. The method includes: displaying a model configuration page; obtaining a model training mode, a model network structure, and hyperparameters input by a user in the model configuration page; obtaining a code recognition model to be trained that matches the model network structure; according to the model training mode, obtaining a pre-saved code training sample corresponding to the code recognition model to be trained; loading the hyperparameters, and training the code recognition model to be trained according to the code training sample. The embodiments of the present disclosure can save a lot of manpower, material resources, and time, reduce the amount of code development, save model training time, and improve the training efficiency of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of model training technology, and in particular, to a visualization-based code recognition model training method and device. Background Art

[0002] Deep learning has become a development trend of intelligence in the industrial sector and is widely used in business lines such as food delivery, distribution, Xiaoxiang, bicycles, and Kuailv.

[0003] The core of deep learning is to find the best model in a complex network to match data. Deep learning focuses more on model design. A simple change or a simple adjustment of the structure can greatly improve the model effect. Flexibility and diversity of model configuration are crucial. In addition, hyperparameters play a vital role in deep learning model training. Hyperparameters can be used to control algorithm behavior.

[0004] At present, based on the training mode of visual deep learning model components, the algorithm platform provides mainstream deep learning model components. Users build experiments by dragging and dropping in the visual interface, and do not support user-defined network structures. In the model training mode based on custom deep learning code, the algorithm platform integrates the open source JupyterLab to provide an interactive programming environment, where users can write, debug and run code in the IDE.

[0005] Training mode based on visual deep learning model components. The platform has constraints on the input and output types and algorithms of the model, and has high restrictions on the types and technologies of predictive and prescriptive modeling problems. Users can only use limited deep learning algorithms for model training and cannot customize new algorithms and network structures. It is difficult to manually adjust the type and number of layers, connection methods, nodes and other hyperparameters experimentally, and the flexibility is low. Deep learning algorithms are very complex and have poor universality. It is impossible to use mainstream deep learning methods to cover complex business scenarios. A lot of manpower, material resources and time are required to develop new algorithms and models. The customization, adaptability, uncertainty of input and output, and diversity of hyperparameters of deep learning models make it difficult for the platform to make customized adaptations. Model training mode based on customized deep learning code. Users need to write complete deep learning model training code. Customized deep learning code requires high user capabilities and has a high threshold. Codes with the same function need to be repeatedly developed by users, which requires a large amount of code development, takes a long time, and has low model training efficiency. Summary of the invention

[0006] The embodiments of the present disclosure provide a visualization-based code recognition model training method and device, which are used to minimize the limitations of model training and the cost of user errors, reduce manpower costs and waste of resources, and do not require users to develop code, thereby reducing the amount of code development and improving model training efficiency.

[0007] According to a first aspect of an embodiment of the present disclosure, a visualization-based code recognition model training method is provided, comprising:

[0008] Display the model configuration page;

[0009] Obtain the model training mode, model network structure and hyperparameters entered by the user in the model configuration page;

[0010] Obtaining a code recognition model to be trained that matches the model network structure;

[0011] According to the model training mode, obtaining a pre-saved code training sample corresponding to the code recognition model to be trained;

[0012] The hyperparameters are loaded, and the code recognition model to be trained is trained according to the code training samples.

[0013] Optionally, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes:

[0014] Obtaining model input parameters and model output parameters input by the user in the model configuration page;

[0015] The loading of the hyperparameters and training of the code recognition model to be trained according to the code training samples includes:

[0016] According to the model input parameters, the code training sample is input into the code recognition model to be trained;

[0017] According to the model output parameters, obtaining a code prediction result corresponding to the code training sample output by the code recognition model to be trained;

[0018] According to the initial code result corresponding to the code training sample and the code prediction result, a loss value corresponding to the code recognition model to be trained is calculated;

[0019] When the loss value is within a preset range, the trained code recognition model is used as the final target code recognition model.

[0020] Optionally, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes:

[0021] Obtaining the loss function type entered by the user in the model configuration page;

[0022] The calculating, according to the initial code result corresponding to the code training sample and the code prediction result, a loss value corresponding to the code recognition model to be trained includes:

[0023] According to the initial code result and the code prediction result, a loss value that matches the loss function type and corresponds to the code recognition model to be trained is calculated.

[0024] Optionally, after calculating the loss value corresponding to the code recognition model to be trained according to the initial code result corresponding to the code training sample and the code prediction result, the method further includes:

[0025] When the loss value is outside the preset range, obtaining a loss gradient corresponding to the loss value;

[0026] Adjust the hyperparameter according to the loss gradient to obtain a target hyperparameter;

[0027] The target hyperparameter is loaded, and according to the code training sample, the training process of the code recognition model to be trained is iteratively performed until the loss value corresponding to the code recognition model to be trained is within the preset range.

[0028] Optionally, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes:

[0029] Verifying the configuration validity of the model input parameters, the model output parameters, and the hyperparameters;

[0030] If the configuration validity does not meet the model training conditions, generate a configuration error prompt message;

[0031] The configuration error prompt information is sent to the user, so that the user can reconfigure the model input parameters, and / or the model output parameters, and / or the hyperparameters according to the configuration error prompt information.

[0032] Optionally, the loading of the hyperparameters and training the code recognition model to be trained according to the code training samples includes:

[0033] Assigning a value to the hyperparameter to obtain an assigned hyperparameter;

[0034] The assigned hyperparameters are loaded, and the code recognition model to be trained is trained according to the code training samples.

[0035] Optionally, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes:

[0036] Obtaining the hook function entered by the user in the model configuration page;

[0037] The training of the code recognition model to be trained according to the code training sample includes:

[0038] During the training process of the code recognition model to be trained according to the code training sample, the hook function is automatically loaded.

[0039] According to a second aspect of an embodiment of the present disclosure, a visualization-based code recognition model training device is provided, comprising:

[0040] Configuration page display module, used to display the model configuration page;

[0041] A model parameter acquisition module is used to obtain the model training mode, model network structure and hyperparameters input by the user in the model configuration page;

[0042] A module for acquiring a model to be trained, used to acquire a code recognition model to be trained that matches the model network structure;

[0043] A code sample acquisition module, used to acquire a pre-saved code training sample corresponding to the code recognition model to be trained according to the model training mode;

[0044] The code model training module is used to load the hyperparameters and train the code recognition model to be trained according to the code training samples.

[0045] Optionally, it also includes:

[0046] An input and output parameter acquisition module, used to acquire the model input parameters and model output parameters input by the user in the model configuration page;

[0047] The code model training module includes:

[0048] A code sample input unit, used for inputting the code training sample into the code recognition model to be trained according to the model input parameters;

[0049] A prediction result output unit, used for obtaining, according to the model output parameters, a code prediction result corresponding to the code training sample output by the code recognition model to be trained;

[0050] A loss value calculation unit, used to calculate the loss value corresponding to the code recognition model to be trained according to the initial code result corresponding to the code training sample and the code prediction result;

[0051] The target code model acquisition unit is used to use the trained code recognition model as the final target code recognition model when the loss value is within a preset range.

[0052] Optionally, it also includes:

[0053] A loss function type acquisition module, used to acquire the loss function type entered by the user in the model configuration page;

[0054] The loss value calculation unit comprises:

[0055] The loss value calculation subunit is used to calculate the loss value that matches the loss function type and corresponds to the code recognition model to be trained based on the initial code result and the code prediction result.

[0056] Optionally, it also includes:

[0057] A loss gradient acquisition module, used for acquiring the loss gradient corresponding to the loss value when the loss value is outside the preset range;

[0058] A target hyperparameter acquisition module, used to adjust the hyperparameter according to the loss gradient to obtain a target hyperparameter;

[0059] The model iteration training module is used to load the target hyperparameters and iteratively execute the training process of the code recognition model to be trained according to the code training samples until the loss value corresponding to the code recognition model to be trained is within the preset range.

[0060] Optionally, it also includes:

[0061] A configuration validity verification module is used to verify the configuration validity of the model input parameters, the model output parameters and the hyperparameters;

[0062] A configuration prompt information generation module, used to generate configuration error prompt information when the configuration validity does not meet the model training conditions;

[0063] A configuration prompt information sending module is used to send the configuration error prompt information to the user, so that the user can reconfigure the model input parameters, and / or the model output parameters, and / or the hyperparameters according to the configuration error prompt information.

[0064] Optionally, the code model training module includes:

[0065] A hyperparameter assignment unit, used for assigning a value to the hyperparameter to obtain an assigned hyperparameter;

[0066] The code model training unit is used to load the assigned hyperparameters and train the code recognition model to be trained according to the code training samples.

[0067] Optionally, it also includes:

[0068] A hook function acquisition module, used to acquire the hook method input by the user in the model configuration page;

[0069] The code model training module includes:

[0070] The hook function loading unit is used to automatically load the hook function during the training process of the code recognition model to be trained according to the code training sample.

[0071] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0072] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the visualization-based code recognition model training method described in any one of the above items is implemented.

[0073] According to a fourth aspect of an embodiment of the present disclosure, a readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the visualization-based code recognition model training methods described above.

[0074] The embodiments of the present disclosure provide a method and device for training a code recognition model based on visualization. By displaying the model configuration page, the model training mode, model network structure and hyperparameters input by the user in the model configuration page are obtained, the code recognition model to be trained that matches the model network structure is obtained, and the code training samples corresponding to the code recognition model to be trained that are pre-saved are obtained according to the model training mode, the hyperparameters are loaded, and the code recognition model to be trained is trained according to the code training samples. The embodiments of the present disclosure can allow users to customize the model training mode, model network structure and hyperparameters, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing codes, thereby saving a lot of manpower, material resources and time, reducing the amount of code development, saving model training time, and improving the training efficiency of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0076] Figure 1 A flowchart of a visualization-based code recognition model training method provided in an embodiment of the present disclosure;

[0077] Figure 2 A flowchart of another method for training a code recognition model based on visualization provided by an embodiment of the present disclosure;

[0078] Figure 3 A schematic diagram of the structure of a visualization-based code recognition model training device provided in an embodiment of the present disclosure;

[0079] Figure 4 A schematic diagram of the structure of another visualization-based code recognition model training device provided in an embodiment of the present disclosure;

[0080] Figure 5 A schematic diagram of the structure of a code model training module provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0081] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.

[0082] Embodiment 1

[0083] Reference Figure 1 , shows a flowchart of a method for training a code recognition model based on visualization provided by an embodiment of the present disclosure, such as Figure 1 As shown, the visualization-based code recognition model training method may specifically include the following steps:

[0084] Step 101: Display the model configuration page.

[0085] The embodiments of the present disclosure can be applied to scenarios where users customize the model training mode, model network structure, and hyperparameters of a model to perform model training.

[0086] The model configuration page refers to a page pre-set by the operator for the user to set the relevant parameters for model training. In this embodiment, a model editor can be set in advance. When the user needs to set the relevant parameters for model training, the model editor can be started. At this time, a model configuration page can be displayed, and the user can set the relevant parameters required for model training in the model configuration page.

[0087] When a user needs to perform a certain type of code recognition model training, the model configuration page can be opened and displayed.

[0088] After the model configuration page is displayed, step 102 is executed.

[0089] Step 102: Obtain the model training mode, model network structure and hyperparameters input by the user in the model configuration page.

[0090] The model training mode refers to a mode used to indicate the type of training model, that is, to indicate what type of model is obtained through training. After the model training mode is determined, the model training samples required for training the model can be determined.

[0091] The model network structure refers to the basic architecture of the model that needs to be trained, such as which network layers it contains and whether sub-models need to be spliced.

[0092] Hyperparameters refer to the parameters set before the model starts model training. During the model training process, the hyperparameters can be optimized and a set of optimal hyperparameters can be selected for model training to improve the performance and effect of model training.

[0093] After the model configuration page is displayed, the user can enter the required training code in the model configuration page to identify the model training mode, model network structure and hyperparameters corresponding to the model.

[0094] After obtaining the model training mode, model network structure and hyperparameters corresponding to the code recognition model required for training input by the user in the model configuration page, execute steps 103 and 104.

[0095] Step 103: Obtain a code recognition model to be trained that matches the model network structure.

[0096] The code recognition model to be trained refers to a code recognition model that has not been trained and is determined according to the model network structure.

[0097] After obtaining the model network structure input by the user, the code recognition model to be trained can be determined according to the network model structure input by the user. Specifically, when the user clicks the run button on the model configuration page, the corresponding deep learning framework can be pulled from the warehouse according to the environment, and the user-defined model network structure can be automatically loaded to obtain the code recognition model to be trained.

[0098] Step 104: According to the model training mode, obtain the pre-saved code training samples corresponding to the code recognition model to be trained.

[0099] After obtaining the model training mode input by the user in the model configuration page, the code training samples required for the code recognition model to be trained can be obtained from the sample warehouse according to the model mode.

[0100] It is understandable that different training modes of models of the same network structure require different samples. Therefore, in this embodiment, by presetting the model training mode, different model training modes correspond to different model types. After obtaining the model training mode input by the user on the model configuration page, the code training samples required for training the corresponding type of model can be obtained.

[0101] In this embodiment, the acquired code training samples may be codes authorized by other users that are pre-saved in a code database, or codes downloaded from the Internet, etc. Specifically, the method for acquiring code training samples may be determined according to business needs, and this embodiment does not impose any restrictions on this.

[0102] After the code recognition model to be trained and the code training samples corresponding to the code recognition model to be trained are obtained, step 105 is executed.

[0103] Step 105: Load the hyperparameters, and train the code recognition model to be trained according to the code training samples.

[0104] After obtaining the code recognition model to be trained and the code training samples, the hyperparameters entered by the user in the model configuration page can be loaded, and the code recognition model to be trained can be trained according to the code training samples.

[0105] The embodiments of the present disclosure allow users to customize the model training mode, model network structure and hyperparameters of the model, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing code, thereby saving a lot of manpower, material resources and time.

[0106] In this embodiment, the hyperparameters configured by the user may also be assigned values ​​before training. Specifically, it may be described in detail in combination with the following specific implementation method.

[0107] In a specific implementation of the present disclosure, the above step 105 may include:

[0108] Sub-step A1: assigning values ​​to the hyperparameters to obtain assigned hyperparameters.

[0109] In the embodiments of the present disclosure, a distributed computing module can be pre-set. When the user clicks on the model training task to run in the visualized model configuration page, the configuration in the visualization interface will take effect in the distributed computing module. In the distributed computing process, the specified data set can be loaded into the partitio to perform platform distributed computing to complete the feature preprocessing process, and the intermediate results are assigned to the user-specified hyperparameters. The input and output data are converted according to the user-specified format and saved in the hdfs file in the tfRecord format. The hyperparameters are encapsulated in the specified format.

[0110] Of course, in this embodiment, the hyperparameters may also be assigned values ​​according to the experience of the developers to obtain the assigned hyperparameters.

[0111] It can be understood that the amplitude of the hyperparameter can be determined according to business requirements, and this embodiment does not limit this.

[0112] After assigning the hyperparameters to obtain the assigned hyperparameters, sub-step A2 is performed.

[0113] Sub-step A2: Load the assigned hyperparameters, and train the code recognition model to be trained according to the code training samples.

[0114] After obtaining the assigned hyperparameters, the assigned hyperparameters may be loaded, and the to-be-trained code recognition model may be trained according to the code training samples.

[0115] The embodiments of the present disclosure can separate the hyperparameter setting and assignment processes, and can realize dynamic assignment of hyperparameters without the intervention of developers, thus saving labor costs.

[0116] In this embodiment, the user can also define a hook function on the model configuration page to implement the use of advanced functions in the model training process. Specifically, it can be described in detail in combination with the following specific implementation method.

[0117] In another specific implementation of the present disclosure, before the above step 105, the following may also be included:

[0118] Step B1: Obtain the hook function input by the user in the model configuration page.

[0119] The above step 105 may include:

[0120] Sub-step C1: during the training process of the code recognition model to be trained according to the code training sample, automatically loading the hook function.

[0121] In an embodiment of the present disclosure, a user may set a hook function (i.e., a hooks function) in advance in a model configuration page, and the hook function may be automatically loaded during the process of training a code recognition model to be trained according to code training samples.

[0122] In the embodiments of the present disclosure, the user customizes advanced functions on the model configuration page, and the advanced function functions can be used in model training, thereby improving the autonomous configurability of the code recognition model.

[0123] The visualization-based code recognition model training method provided by the embodiment of the present disclosure displays the model configuration page, obtains the model training mode, model network structure and hyperparameters input by the user in the model configuration page, obtains the code recognition model to be trained that matches the model network structure, obtains the code training sample corresponding to the pre-saved code recognition model to be trained according to the model training mode, loads the hyperparameters, and trains the code recognition model to be trained according to the code training sample. The embodiment of the present disclosure allows the user to customize the model training mode, model network structure and hyperparameters, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing codes, thereby saving a lot of manpower, material resources and time, reducing the amount of code development, saving model training time, and improving the training efficiency of the model.

[0124] Embodiment 2

[0125] Reference Figure 2 , shows a flowchart of another method for training a code recognition model based on visualization provided by an embodiment of the present disclosure, such as Figure 2 As shown, the visualization-based code recognition model training method may specifically include the following steps:

[0126] Step 201: Display the model configuration page.

[0127] The embodiments of the present disclosure can be applied to scenarios where users customize the model training mode, model network structure, and hyperparameters of a model to perform model training.

[0128] The model configuration page refers to a page pre-set by the operator for the user to set the relevant parameters for model training. In this embodiment, a model editor can be set in advance. When the user needs to set the relevant parameters for model training, the model editor can be started. At this time, a model configuration page can be displayed, and the user can set the relevant parameters required for model training in the model configuration page.

[0129] When a user needs to perform a certain type of code recognition model training, the model configuration page can be opened and displayed.

[0130] After the model configuration page is displayed, step 202 is executed.

[0131] Step 202: Obtain the model training mode, model network structure and hyperparameters input by the user in the model configuration page.

[0132] The model training mode refers to a mode used to indicate the type of training model, that is, to indicate what type of model is obtained through training. After the model training mode is determined, the model training samples required for training the model can be determined.

[0133] The model network structure refers to the basic architecture of the model that needs to be trained, such as which network layers it contains and whether sub-models need to be spliced.

[0134] Hyperparameters refer to the parameters set before the model starts model training. During the model training process, the hyperparameters can be optimized and a set of optimal hyperparameters can be selected for model training to improve the performance and effect of model training.

[0135] After the model configuration page is displayed, the user can enter the required training code in the model configuration page to identify the model training mode, model network structure and hyperparameters corresponding to the model.

[0136] Step 203: Obtain the model input parameters and model output parameters input by the user in the model configuration page.

[0137] Model input parameters refer to parameters of code fields that can be input into the code recognition model to be trained each time during the training process of the code recognition model to be trained, and may include parameters such as the number of input fields and the type of input fields.

[0138] The model output parameters refer to the parameters of the code fields that can be output by the code recognition model to be trained each time during the training process of the code recognition model to be trained, and may include parameters such as the number of output fields and the type of output fields.

[0139] In this example, the user may also input model input parameters and model output parameters in the model configuration page.

[0140] Step 204: Obtain a code recognition model to be trained that matches the model network structure.

[0141] The code recognition model to be trained refers to a code recognition model that has not been trained and is determined according to the model network structure.

[0142] After obtaining the model network structure input by the user, the code recognition model to be trained can be determined according to the network model structure input by the user. Specifically, when the user clicks the run button on the model configuration page, the corresponding deep learning framework can be pulled from the warehouse according to the environment, and the user-defined model network structure can be automatically loaded to obtain the code recognition model to be trained.

[0143] Step 205: According to the model training mode, obtain the pre-saved code training samples corresponding to the code recognition model to be trained.

[0144] After obtaining the model training mode input by the user in the model configuration page, the code training samples required for the code recognition model to be trained can be obtained from the sample warehouse according to the model mode.

[0145] It is understandable that different training modes of models of the same network structure require different samples. Therefore, in this embodiment, by presetting the model training mode, different model training modes correspond to different model types. After obtaining the model training mode input by the user on the model configuration page, the code training samples required for training the corresponding type of model can be obtained.

[0146] In this embodiment, the acquired code training samples may be codes authorized by other users that are pre-saved in a code database, or codes downloaded from the Internet, etc. Specifically, the method for acquiring code training samples may be determined according to business needs, and this embodiment does not impose any restrictions on this.

[0147] Step 206: Load the hyperparameters, and input the code training samples into the code recognition model to be trained according to the model input parameters.

[0148] After obtaining the code recognition model to be trained and the code training samples, the hyperparameters entered by the user in the model configuration page can be loaded, and the code training samples can be input into the code recognition model to be trained according to the model input parameters, so that the code recognition model to be trained can perform corresponding processing on the code training samples.

[0149] Step 207: According to the model output parameters, a code prediction result corresponding to the code training sample output by the code recognition model to be trained is obtained.

[0150] After the code training sample inputted and matching the model input parameters is processed by the code recognition model to be trained, the code prediction result corresponding to the code training sample outputted by the code recognition model to be trained can be obtained according to the model output parameters.

[0151] Step 208: Calculate the loss value corresponding to the code recognition model to be trained based on the initial code result corresponding to the code training sample and the code prediction result.

[0152] The loss value refers to a numerical value used to determine the training degree of the code recognition model to be trained.

[0153] After obtaining the code prediction result, the initial code result and the code prediction result corresponding to the code training sample can be combined to calculate the loss value corresponding to the code recognition model to be trained.

[0154] After the loss value corresponding to the code recognition model to be trained is calculated, step 209 is executed.

[0155] Step 209: When the loss value is within a preset range, the trained code recognition model is used as the final target code recognition model.

[0156] The preset range refers to a range pre-set by business personnel for determining whether the loss value of the code recognition model to be trained meets business requirements. The specific value of the preset range can be determined according to business requirements, and this embodiment does not impose any restrictions on this.

[0157] After calculating the loss value corresponding to the code recognition model to be trained, it can be determined whether the loss value is within a preset range.

[0158] If the loss value is not within the preset range, it means that the trained code recognition model to be trained does not meet the business requirements. At this time, more code training samples can be obtained to continue training the trained code recognition model to be trained.

[0159] If the loss value is within the preset range, it means that the trained code recognition model to be trained can meet the business needs. At this time, the trained code recognition model to be trained can be used as the target code recognition model, and the target code recognition model can be used in subsequent code recognition scenarios.

[0160] The embodiments of the present disclosure allow users to customize the model training mode, model network structure and hyperparameters, as well as model input parameters and model output parameters of the model, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing code, thereby saving a lot of manpower, material resources and time.

[0161] In this embodiment, the user can also customize the loss function type on the model configuration page to determine the loss value calculation method of the code recognition model. Specifically, it can be described in detail in combination with the following specific implementation method.

[0162] In another specific implementation of the present disclosure, it may also include:

[0163] Step D1: Obtain the loss function type entered by the user in the model configuration page.

[0164] The above step 208 may include:

[0165] Sub-step E1: Based on the initial code result and the code prediction result, a loss value that matches the loss function type and corresponds to the code recognition model to be trained is calculated.

[0166] In the embodiments of the present disclosure, the loss function type refers to a function type used to calculate a loss value, that is, the loss function type indicates a specific way of calculating the loss value.

[0167] In the model configuration page, users can customize the loss function type to be used as the type of loss function calculated in the subsequent model training process.

[0168] After obtaining the code prediction result output by the code recognition model to be trained, the loss value corresponding to the code recognition model to be trained and matching the loss function type can be calculated based on the initial code result and the code prediction result.

[0169] The embodiments of the present disclosure allow users to customize the loss function type of the model and pre-set the calculation method of the loss value, thereby achieving autonomous configuration of model training and controllability of model training.

[0170] In this embodiment, before training the code recognition model to be trained, the validity of the parameters of the user-defined model training may be verified. Specifically, it may be described in detail in combination with the following specific implementation method.

[0171] In a specific implementation of the embodiment of the present disclosure, before step 209, the following may also be included:

[0172] Step F1: Verify the configuration validity of the model input parameters, the model output parameters and the hyperparameters.

[0173] In an embodiment of the present disclosure, configuration validity may be used to indicate whether the model parameters configured by the user are valid.

[0174] Before training the code recognition model to be trained, the validity of the model input parameters, model output parameters and hyperparameters configured by the user may be verified.

[0175] After verifying the configuration validity of the model input parameters, model output parameters and hyperparameters, execute step F2.

[0176] Step F2: When the configuration validity does not meet the model training conditions, generate configuration error prompt information.

[0177] The configuration error prompt information refers to the prompt information used to indicate that the model parameters configured by the user are invalid.

[0178] In this example, the configuration error prompt information may be text prompt information or voice prompt information, etc. Specifically, the specific form of the configuration error prompt information may be determined according to business requirements, and this embodiment does not impose any limitation on this.

[0179] When the configuration validity of the configuration parameters does not meet the model training conditions, a configuration error prompt message may be generated, and then step F3 is executed.

[0180] Step F3: Sending the configuration error prompt information to the user, so that the user can reconfigure the model input parameters, and / or the model output parameters, and / or the hyperparameters according to the configuration error prompt information.

[0181] After generating the configuration error prompt information, the configuration error prompt information can be sent to the user, so that the user can configure the model input parameters, and / or model output parameters, and / or hyperparameters according to the configuration error prompt information. The task can only be executed after the user makes the correct modifications.

[0182] The embodiments of the present disclosure verify the validity of the model parameters configured by the user, and when the verification does not meet the training conditions, the user can be prompted to make modifications, thereby avoiding errors in the model training process, and avoiding the problems of occupying resources, blindly waiting, and even invalid results during operation.

[0183] In this embodiment, the hyperparameters can also be automatically adjusted when the loss value is outside a preset range. Specifically, it can be described in detail in combination with the following specific implementation method.

[0184] In another specific implementation of the present disclosure, the method may further include:

[0185] Step G1: When the loss value is outside the preset range, obtain the loss gradient corresponding to the loss value.

[0186] Step G2: adjusting the hyperparameters according to the loss gradient to obtain target hyperparameters.

[0187] Step G3: Load the target hyperparameters, and iteratively execute the training process of the code recognition model to be trained according to the code training samples until the loss value corresponding to the code recognition model to be trained is within the preset range.

[0188] In this embodiment, when the loss value is outside the preset range, the loss gradient corresponding to the loss value can be obtained. Specifically, during model training, the model will automatically measure whether it has converged according to the loss function defined by the user. If the result has not converged, the hyperparameters are adjusted along the gradient descent trend by calculating the gradient of the loss function, and the output of the algorithm is recalculated. This cycle is repeated through continuous model iteration until the result converges and the loss function reaches a minimum value.

[0189] The embodiments of the present disclosure can minimize the limitations of model training and the cost of user errors, reduce manpower costs and waste of resources, and make the model training platform more intelligent.

[0190] The visualization-based code recognition model training method provided by the embodiment of the present disclosure displays the model configuration page, obtains the model training mode, model network structure and hyperparameters input by the user in the model configuration page, obtains the code recognition model to be trained that matches the model network structure, obtains the code training sample corresponding to the pre-saved code recognition model to be trained according to the model training mode, loads the hyperparameters, and trains the code recognition model to be trained according to the code training sample. The embodiment of the present disclosure allows the user to customize the model training mode, model network structure and hyperparameters, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing codes, thereby saving a lot of manpower, material resources and time, reducing the amount of code development, saving model training time, and improving the training efficiency of the model.

[0191] Embodiment 3

[0192] Reference Figure 3 , showing a schematic diagram of the structure of a visualization-based code recognition model training device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the visualization-based code recognition model training device 300 may specifically include the following modules:

[0193] Configuration page display module 310, used to display the model configuration page;

[0194] A model parameter acquisition module 320 is used to acquire the model training mode, model network structure and hyperparameters input by the user in the model configuration page;

[0195] A model acquisition module 330 to be trained is used to acquire a code recognition model to be trained that matches the model network structure;

[0196] A code sample acquisition module 340 is used to acquire a pre-saved code training sample corresponding to the code recognition model to be trained according to the model training mode;

[0197] The code model training module 350 is used to load the hyperparameters and train the code recognition model to be trained according to the code training samples.

[0198] Optionally, the code model training module 350 includes:

[0199] A hyperparameter assignment unit, used for assigning a value to the hyperparameter to obtain an assigned hyperparameter;

[0200] The code model training unit is used to load the assigned hyperparameters and train the code recognition model to be trained according to the code training samples.

[0201] Optionally, it also includes:

[0202] A hook function acquisition module, used to acquire the hook method input by the user in the model configuration page;

[0203] The code model training module 350 includes:

[0204] The hook function loading unit is used to automatically load the hook function during the training process of the code recognition model to be trained according to the code training sample.

[0205] The visualization-based code recognition model training device provided by the embodiment of the present disclosure obtains the model training mode, model network structure and hyperparameters input by the user in the model configuration page by displaying the model configuration page, obtains the code recognition model to be trained that matches the model network structure, obtains the code training sample corresponding to the pre-saved code recognition model to be trained according to the model training mode, loads the hyperparameters, and trains the code recognition model to be trained according to the code training sample. The embodiment of the present disclosure allows the user to customize the model training mode, model network structure and hyperparameters, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing codes, thereby saving a lot of manpower, material resources and time, reducing the amount of code development, saving model training time, and improving the training efficiency of the model.

[0206] Embodiment 4

[0207] Reference Figure 4 , showing a schematic diagram of the structure of another visualization-based code recognition model training device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the visualization-based code recognition model training device 400 may specifically include the following modules:

[0208] Configuration page display module 410, used to display the model configuration page;

[0209] A model parameter acquisition module 420 is used to acquire the model training mode, model network structure and hyperparameters input by the user in the model configuration page;

[0210] An input and output parameter acquisition module 430 is used to acquire the model input parameters and model output parameters input by the user in the model configuration page;

[0211] A model acquisition module 440 to be trained is used to acquire a code recognition model to be trained that matches the model network structure;

[0212] A code sample acquisition module 450 is used to acquire a pre-saved code training sample corresponding to the code recognition model to be trained according to the model training mode;

[0213] The code model training module 460 is used to load the hyperparameters and train the code recognition model to be trained according to the code training samples.

[0214] Optionally, refer to Figure 5 , which shows a schematic diagram of a code model training module provided by an embodiment of the present disclosure, such as Figure 5 As shown, the code model training module 460 includes:

[0215] A code sample input unit 461, used for inputting the code training sample into the code recognition model to be trained according to the model input parameters;

[0216] A prediction result output unit 462 is used to obtain a code prediction result corresponding to the code training sample output by the code recognition model to be trained according to the model output parameter;

[0217] A loss value calculation unit 463 is used to calculate the loss value corresponding to the code recognition model to be trained according to the initial code result corresponding to the code training sample and the code prediction result;

[0218] The target code model acquisition unit 464 is used to use the trained code recognition model as the final target code recognition model when the loss value is within a preset range.

[0219] Optionally, it also includes:

[0220] A loss function type acquisition module, used to acquire the loss function type entered by the user in the model configuration page;

[0221] The loss value calculation unit 473 includes:

[0222] The loss value calculation subunit is used to calculate the loss value that matches the loss function type and corresponds to the code recognition model to be trained based on the initial code result and the code prediction result.

[0223] Optionally, it also includes:

[0224] A loss gradient acquisition module, used for acquiring the loss gradient corresponding to the loss value when the loss value is outside the preset range;

[0225] A target hyperparameter acquisition module, used to adjust the hyperparameter according to the loss gradient to obtain a target hyperparameter;

[0226] The model iteration training module is used to load the target hyperparameters and iteratively execute the training process of the code recognition model to be trained according to the code training samples until the loss value corresponding to the code recognition model to be trained is within the preset range.

[0227] Optionally, it also includes:

[0228] A configuration validity verification module is used to verify the configuration validity of the model input parameters, the model output parameters and the hyperparameters;

[0229] A configuration prompt information generation module, used to generate configuration error prompt information when the configuration validity does not meet the model training conditions;

[0230] A configuration prompt information sending module is used to send the configuration error prompt information to the user, so that the user can reconfigure the model input parameters, and / or the model output parameters, and / or the hyperparameters according to the configuration error prompt information.

[0231] The visualization-based code recognition model training device provided by the embodiment of the present disclosure obtains the model training mode, model network structure and hyperparameters input by the user in the model configuration page by displaying the model configuration page, obtains the code recognition model to be trained that matches the model network structure, obtains the code training sample corresponding to the pre-saved code recognition model to be trained according to the model training mode, loads the hyperparameters, and trains the code recognition model to be trained according to the code training sample. The embodiment of the present disclosure allows the user to customize the model training mode, model network structure and hyperparameters, which can avoid the problem of experimentally manually adjusting the type and number of layers, connection methods, nodes and other hyperparameters, and the problem of users repeatedly developing and writing codes, thereby saving a lot of manpower, material resources and time, reducing the amount of code development, saving model training time, and improving the training efficiency of the model.

[0232] An embodiment of the present disclosure also provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the visualization-based code recognition model training method of the aforementioned embodiment is implemented.

[0233] An embodiment of the present disclosure also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the visualization-based code recognition model training method of the aforementioned embodiment.

[0234] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0235] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such systems is. In addition, the embodiments of the present disclosure are not directed to any particular programming language either. It should be understood that the contents of the embodiments of the present disclosure described herein may be realized using various programming languages, and the description of the specific languages ​​above is intended to disclose the best mode of implementation of the embodiments of the present disclosure.

[0236] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0237] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present disclosure, the various features of the embodiments of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present disclosure require more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the embodiments of the present disclosure.

[0238] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0239] The various component embodiments of the embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the dynamic picture generation device according to the embodiments of the present disclosure. The embodiments of the present disclosure may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program implementing an embodiment of the present disclosure may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0240] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

[0241] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0242] The above description is only a preferred embodiment of the embodiments of the present disclosure and is not intended to limit the embodiments of the present disclosure. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.

[0243] The above is only a specific implementation of the embodiment of the present disclosure, but the protection scope of the embodiment of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the embodiment of the present disclosure, which should be included in the protection scope of the embodiment of the present disclosure. Therefore, the protection scope of the embodiment of the present disclosure should be based on the protection scope of the claims.

Claims

1. A visualization-based code recognition model training method, characterized in that: include: Display the model configuration page; Obtain the model training mode, model network structure and hyperparameters entered by the user in the model configuration page; Obtaining a code recognition model to be trained that matches the model network structure; According to the model training mode, obtaining a pre-saved code training sample corresponding to the code recognition model to be trained; Loading the hyperparameters, and training the code recognition model to be trained according to the code training samples; Wherein, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, it also includes: Obtaining model input parameters and model output parameters input by the user in the model configuration page; The loading of the hyperparameters and training of the code recognition model to be trained according to the code training samples includes: According to the model input parameters, the code training sample is input into the code recognition model to be trained; According to the model output parameters, obtaining a code prediction result corresponding to the code training sample output by the code recognition model to be trained; According to the initial code result corresponding to the code training sample and the code prediction result, a loss value corresponding to the code recognition model to be trained is calculated; When the loss value is within a preset range, the trained code recognition model is used as the final target code recognition model; Wherein, after calculating the loss value corresponding to the code recognition model to be trained according to the initial code result corresponding to the code training sample and the code prediction result, the method further includes: When the loss value is outside the preset range, obtaining a loss gradient corresponding to the loss value; Adjust the hyperparameter according to the loss gradient to obtain a target hyperparameter; The target hyperparameter is loaded, and according to the code training sample, the training process of the code recognition model to be trained is iteratively performed until the loss value corresponding to the code recognition model to be trained is within the preset range; Wherein, before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, it also includes: Verifying the configuration validity of the model input parameters, the model output parameters, and the hyperparameters; If the configuration validity does not meet the model training conditions, generate a configuration error prompt message; The configuration error prompt information is sent to the user, so that the user can reconfigure the model input parameters, and / or the model output parameters, and / or the hyperparameters according to the configuration error prompt information.

2. The method according to claim 1, characterized in that Before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes: Obtaining the loss function type entered by the user in the model configuration page; The calculating, according to the initial code result corresponding to the code training sample and the code prediction result, a loss value corresponding to the code recognition model to be trained includes: According to the initial code result and the code prediction result, a loss value that matches the loss function type and corresponds to the code recognition model to be trained is calculated.

3. The method according to claim 1, characterized in that The loading of the hyperparameters and training of the code recognition model to be trained according to the code training samples includes: Assigning a value to the hyperparameter to obtain an assigned hyperparameter; The assigned hyperparameters are loaded, and the code recognition model to be trained is trained according to the code training samples.

4. The method according to claim 1, characterized in that Before loading the hyperparameters and training the code recognition model to be trained according to the code training samples, the method further includes: Obtaining the hook function entered by the user in the model configuration page; The training of the code recognition model to be trained according to the code training sample includes: During the training process of the code recognition model to be trained according to the code training sample, the hook function is automatically loaded.

5. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the visualization-based code recognition model training method described in any one of claims 1 to 4 when executing the program.

6. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the visualization-based code recognition model training method described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Three-dimensional object detection method based on view cone point cloud

    CN109523552A

  • Click rate prediction method, click rate determination method and server

    CN110020877A