Model Training Method, System, Electronic Device, and Storage Medium
By splitting the data set into multiple subsets and processing it in the processor cluster, the problem of mismatch between the data processing equipment and the model training equipment is solved, and the efficiency of model training is improved.
Patent Information
- Application Number
- CN202111415941.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-11-25
AI Technical Summary
The data processing equipment and model training equipment in machine learning and deep learning do not match the speed of the data processing equipment, resulting in low utilization and slow training speed of the model training equipment.
The original data set is split into multiple data subsets, and data identification is allocated in the database. The data subset is processed through the processor cluster, and generated and stored as a new data subset for the main processor to train the model.
It improves the matching of data processing speed and model training speed, reduces the waiting time for model training, and improves the overall speed of model training.
Smart Images

Figure CN114239848B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technologies, and particularly to a model training method, system, electronic device, and storage medium. Background Art
[0002] Machine learning and deep learning are the most popular research directions in the current field of artificial intelligence. In machine learning, 80% of the time for machine learning tasks is spent on the data processing device to process the data and feature processing required for model input, and it is necessary to process different and large amounts of features multiple times. Effective features can only be obtained after multiple attempts, and each attempt requires waiting for a long time, resulting in a mismatch between the processing speed of the data processing device and the training speed of the model training device; while deep learning tasks require a large amount of data support. During training, the data is usually grouped into data groups of a certain size, and after certain data augmentation operations, gradient descent training based on the mini-batch of the data set is performed; the model training device resources for deep learning are expensive and scarce, but the speed is fast, while the data processing device is relatively cheap but the speed is relatively slow, which will also cause the processing speed of the data processing device to not keep up with the training speed of the model training device; the speed mismatch between the data processing device and the model training device in machine learning and deep learning results in low utilization rate of the model training device, thereby reducing the training speed of the machine learning model or the deep learning model. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a model training method, system, electronic device, and storage medium, so that the processing speed of the data matches the processing speed of the model training, thereby improving the speed of model training.
[0004] To solve the above technical problems, the embodiments of the present application provide a model training method, which is characterized in that it is applied in the main processor of the model training system, and the model training system further includes a processor cluster and a database; the method includes: splitting the original data set into multiple first data subsets, and assigning data identifiers to each of the first data subsets; storing each of the data identifiers and each of the first data subsets into a first table structure of the database; for each processor in the processor cluster to obtain each of the first data subsets and each of the data identifiers from the first table structure, process each of the first data subsets to generate each second data subset, and store each of the second data subsets into a second table structure of the database according to each of the data identifiers; obtaining each of the second data subsets from the second table structure, and performing model training based on each of the second data subsets.
[0005] Embodiments of the present application further provide a model training system, characterized in that the system includes: a main processor, a processor cluster, and a database; wherein, the main processor is configured to split an original data set into multiple first data subsets, assign data identifiers to each of the first data subsets, and store each of the data identifiers and each of the first data subsets into a first table structure of the database; each processor in the processor cluster is configured to obtain each of the first data subsets and each of the data identifiers from the first table structure, process each of the first data subsets to generate each second data subset, and store each of the second data subsets into a second table structure of the database according to each of the data identifiers; the main processor is further configured to obtain each of the second data subsets from the second table structure and perform model training based on each of the second data subsets.
[0006] Embodiments of the present application further provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned model training method.
[0007] Embodiments of the present application further provide a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned model training method is implemented.
[0008] In the embodiments of the present application, in the main processor of the model training system, the original data set is split into multiple first data subsets, and data identifiers are assigned to each of the first data subsets; each of the data identifiers and each of the first data subsets are stored into a first table structure of the database; for each processor in the processor cluster to obtain each of the first data subsets and each of the data identifiers from the first table structure, process each of the first data subsets to generate each second data subset, and store each of the second data subsets into a second table structure of the database according to each of the data identifiers; obtain each of the second data subsets from the second table structure and perform model training based on each of the second data subsets. By splitting the data into multiple small data subsets, distributing them to multiple processors for processing, and then performing model training based on the processed data, the present application can improve the processing speed of the data set, reduce the waiting time for model training, ensure that the processing speed of the data matches the processing speed of model training, thereby improving the speed of model training, and solving the technical problems of low utilization rate of the model training device and low model training speed due to the speed mismatch between the data processing device and the model training device in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] One or more embodiments are illustrated by way of example in the accompanying drawings, and such illustrations do not constitute a limitation on the embodiments.
[0010] Figure 1 is a flowchart of a model training method provided by an embodiment of the present application;
[0011] Figure 1a is a schematic structural diagram of a first table structure and a second table structure in a database provided by an embodiment of the present application;
[0012] Figure 2 is a flowchart of a model training method provided by an embodiment of the present application;
[0013] Figure 3 is a flowchart of a model training method provided by an embodiment of the present application;
[0014] Figure 4 is a flowchart of a model training method provided by an embodiment of the present application;
[0015] Figure 5 is a schematic structural diagram of a model training system provided by an embodiment of the present application;
[0016] Figure 6 is a schematic structural diagram of a model training system provided by an embodiment of the present application;
[0017] Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will elaborate on the various embodiments of the present application in conjunction with the accompanying drawings. However, those of ordinary skill in the art can understand that in the various embodiments of the present application, many technical details are proposed for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions required to be protected by the present application can be implemented. The following division of each embodiment is for convenience of description and should not constitute any limitation on the specific implementation manner of the present application. The various embodiments can be combined and cross-referenced with each other on the premise of not conflicting.
[0019] The embodiments of the present application relate to a model training method, which is applied to the main processor of a model training system. The model training system further includes a processor cluster and a database, as Figure 1 shown, and specifically includes the following steps.
[0020] Step 101: Split the original data set into multiple first data subsets, and assign data identifiers to each first data subset.
[0021] In an exemplary implementation, when the model to be trained is a machine learning model, the main processor in the model training system is a Central Processing Unit (CPU); when the model to be trained is a deep learning model, the main processor in the model training system is a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU); regardless of whether the model to be trained is a machine learning model or a deep learning model, the processor cluster in the model training system consists of Central Processing Units (CPUs).
[0022] In an exemplary implementation, after the main processor obtains the original data set, it does not perform relevant data processing on the original data set. Instead, it splits the original data set into multiple first data subsets according to the characteristics and requirements of deep learning or machine learning, and assigns a unique data identifier to each first data subset. The present application does not limit the specific form of each original data in the original data set.
[0023] In an exemplary implementation, the original data set obtained by the main processor stores the data storage addresses of each original data, and at this time, the model training system also includes a storage module, and the function of this storage module is to store each original data.
[0024] Step 102: Store each data identifier and each first data subset into the first table structure of the database; so that each processor in the processor cluster can obtain each first data subset and each data identifier from the first table structure, process each first data subset to generate each second data subset, and store each second data subset into the second table structure of the database according to each data identifier.
[0025] In an exemplary implementation, regardless of whether the model to be trained is a machine learning model or a deep learning model, the database in the model training system is a shared database, and both the main processor and each processor in the processor cluster can access this database, store data in the database or obtain data from the database; the database can be of various types such as Remote Dictionary Server (Redis) database, RabbitMQ, Apache RocketMQ, Apache ActiveMQ, ZeroMQ, MetaMQ, MySQL, MongoDB, Elastic Search, Click House, and Presto.
[0026] In an exemplary implementation, as an important intermediate medium in the model training system, the database can deploy multiple databases in the background in the model training system to improve the efficiency of storing data into and retrieving data from the database, thereby accelerating the insertion and acquisition of data by the main processor and each processor in the processor cluster.
[0027] In an exemplary implementation, after the main processor splits the original data set into multiple first data subsets, it stores each first data subset and the corresponding data identifier of each first data subset together into the first table structure of the database as shown in Figure 1a so that each processor in the processor cluster can obtain the first data subset and the data identifier of the first data subset from the first table structure. Each processor processes the obtained first data subset respectively to generate a second data subset, and stores the second data subset and the corresponding data identifier of the second data subset into the second table structure of the database as shown in Figure 1a or can directly store the second data subset into the second table structure of the database as shown in Figure 1a as shown.
[0028] In an exemplary implementation, when the original data set stores the data storage addresses of the original data, the data storage addresses are also stored in each of the first data subsets split from the original data set. After each processor obtains the first data subset, it retrieves the corresponding original data from the storage module according to the data storage address in the obtained first data subset, and then processes the retrieved original data. Each processor can store the processed original data into the database, and then form a second data subset based on the data identifier and the data storage address of the processed original data, and put it into the second table structure.
[0029] In an exemplary implementation, after the main processor stores each first data subset and each data identifier into the first table structure of the database, it can send a start instruction to the processor cluster. After receiving the start instruction, the processor cluster instructs each processor in the processor cluster to start a background program, obtain the first data subset and the data identifier from the first table structure of the database, and process the obtained first data subset.
[0030] In an exemplary implementation, the main processor may not need to send a startup instruction to the processor cluster. In this case, when the model training system starts, the processor cluster instructs each processor in the cluster to start a background program. Each processor actively accesses the first table structure of the database at preset time intervals. When a processor accesses the first table structure of the database this time and obtains a first data subset and a data identifier from the first table structure, it processes the obtained first data subset. When a processor accesses the first table structure of the database this time and does not obtain a first data subset and a data identifier from the first table structure, it continues to wait for the next time interval to access the first table structure of the database again.
[0031] In an exemplary implementation, since the styles of model training are different, the processing methods of the first data subset by each processor will also be different. For example, when the model to be trained is a machine learning model, each processor performs feature processing on each piece of original data in the first data subset. When the model to be trained is a deep learning model, each processor performs data augmentation operations or data preprocessing operations on each piece of original data in the first data subset. The specific processing method of the first data subset will change according to the requirements of the machine learning model or the deep learning model.
[0032] Step 103: Obtain each second data subset from the second table structure and perform model training based on each second data subset.
[0033] In an exemplary implementation, after each processor stores the second data subset and the data identifier in the second table structure in the database, the main processor can obtain each second data subset from the second table structure and perform model training based on the obtained second data subsets.
[0034] In an exemplary implementation, when the model to be trained is a machine learning model, the main processor needs to obtain the second data subsets corresponding to all data identifiers from the second table structure, summarize all the second data subsets, and then perform training of the machine learning model based on the summarized data set. When the model to be trained is a deep learning model, when the main processor obtains a second data subset from the second table structure, it adds the obtained second data subset to the cache queue of the main processor, and then performs training of the deep learning model based on the second data subsets in the cache queue.
[0035] In an embodiment of the present application, in the main processor of the model training system, the original data set is split into multiple first data subsets, and a data identifier is assigned to each first data subset; each data identifier and each first data subset are stored in a first table structure of the database; so that each processor in the processor cluster can obtain each first data subset and each data identifier from the first table structure, process each first data subset to generate each second data subset, and store each second data subset in a second table structure of the database according to each data identifier; obtain each second data subset from the second table structure, and perform model training based on each second data subset. By splitting the data into multiple small data subsets, distributing them to multiple processors for processing, and then performing model training based on the processed data, the present application can improve the processing speed of the data set, reduce the waiting time for model training, ensure that the processing speed of the data matches the processing speed of model training, thereby improving the speed of model training, and solving the technical problem in the prior art that the model training speed is low due to the mismatch between the speeds of the data processing device and the model training device.
[0036] An embodiment of the present application relates to a model training method, which is applied in the main processor of a model training system. The model training system further includes a processor cluster and a database, as Figure 2 shown, and specifically includes the following steps.
[0037] Step 201, split the original data set into each first data subset according to each preset feature requirement, and assign each data identifier to each first data subset according to each feature requirement.
[0038] In an exemplary implementation, when the model to be trained is a machine learning model, since the feature requirements on which the original data in the original data set of the machine learning model depend are different, and the data processing methods adopted for different feature requirements are different, therefore, the original data set can be split into multiple first data subsets according to the feature requirements on which each original data depends, and each first data subset has a data identifier used to distinguish which feature requirement this first data subset belongs to. When assigning data identifiers to each first data subset, it needs to be assigned according to the feature requirement on which this first data subset depends.
[0039] Step 202, store each data identifier and each first data subset in a first table structure of the database; so that each processor in the processor cluster can obtain each first data subset and each data identifier from the first table structure, process each first data subset to generate each second data subset, and store each second data subset in a second table structure of the database according to each data identifier.
[0040] In an exemplary implementation, this step is substantially the same as step 102 of the embodiment of the present application, and will not be elaborated here one by one.
[0041] Step 203: Poll each data identifier to detect whether each data identifier exists in the second table structure.
[0042] In an exemplary implementation, after the main processor stores each first data subset and each data identifier in the database, it can start polling each data identifier. Every time a data identifier is polled, it is detected whether the data identifier exists in the second table structure of the database. When it is monitored that the data identifier exists in the second table structure of the database, it indicates that the first data subset corresponding to the data identifier has been processed by the processor to generate a second data subset. At this time, the data identifier is marked and polling of the data identifier is no longer performed. When it is monitored that the data identifier does not exist in the second table structure of the database, it indicates that the first data subset corresponding to the data identifier has not been processed by the processor and needs to wait for processing, and the data identifier continues to wait for the next poll.
[0043] Step 204: When each data identifier exists in the second table structure, obtain each second data subset from the second table structure.
[0044] In an exemplary implementation, when the second table structure already contains all the data identifiers, all the second data subsets are obtained from the second table structure.
[0045] Step 205: Aggregate each second data subset into a training data set and perform model training based on the training data set.
[0046] In an exemplary implementation, since there is a certain correlation between the raw data in the original data set for machine learning model training, model training cannot be performed based on only one or several second data subsets alone. It is necessary to aggregate all the second data subsets into a training data set, and then perform machine learning model training based on the training data set.
[0047] In the embodiments of the present application, on the basis of other embodiments, the raw data can also be split according to feature requirements according to the characteristics of machine learning model training, so that the data in each first data subset is correlated, so that each processor can better process the data in each first data subset, and can improve the time-consuming feature processing process and improve the training speed.
[0048] The embodiments of the present application relate to a model training method applied to the main processor of a model training system. The model training system further includes a processor cluster and a database, as Figure 3 shown, and specifically includes the following steps.
[0049] Step 301: Split the original dataset into each first data subset according to the preset number of batches, and assign each data identifier to each first data subset according to each batch.
[0050] In an exemplary implementation, when the model to be trained is a deep learning model, since the original data in the original dataset of the deep learning model are independent of each other, at this time, the original dataset can be split into multiple first data subsets according to the preset number of batches (for example, if the preset number of batches is 10, the split first data subsets are also 10), and the data identifier of each first data subset is used to distinguish which batch this first data subset belongs to. When assigning data identifiers to each first data subset, it needs to be assigned according to the batch of this first data subset.
[0051] Step 302: Store each data identifier and each first data subset into the first table structure of the database; so that each processor in the processor cluster can obtain each first data subset and each data identifier from the first table structure, process each first data subset to generate each second data subset, and store each second data subset into the second table structure of the database according to each data identifier.
[0052] In an exemplary implementation, this step is substantially the same as step 102 of the embodiment of the present application, and will not be elaborated here one by one.
[0053] Step 303: Poll each data identifier to detect whether the data identifier polled this time exists in the second table structure.
[0054] In an exemplary implementation, after the main processor stores each first data subset and each data identifier into the database, it can start polling each data identifier. Every time a data identifier is polled, it is detected whether this data identifier exists in the second table structure of the database.
[0055] Step 304: When the data identifier polled this time exists in the second table structure, obtain the second data subset corresponding to the data identifier polled this time from the second table structure.
[0056] In an exemplary implementation, when it is monitored that this data identifier exists in the second table structure of the database, it means that the first data subset corresponding to this data identifier has been processed by the processor to generate a second data subset. At this time, obtain the second data subset corresponding to this data identifier and no longer poll this data identifier; while when it is monitored that this data identifier does not exist in the second table structure of the database, it means that the first data subset corresponding to this data identifier has not been processed by the processor and needs to wait for processing, and this data identifier continues to wait for the next poll.
[0057] Step 305: Add the second data subset corresponding to the data identifier polled this time to the cache queue, and perform model training based on each second data subset in the cache queue.
[0058] In an exemplary implementation, after obtaining the second data subset corresponding to the data identifier polled this time, instead of directly training the second data subset, the second data subset is added to the cache queue. When performing model training, the cache queue is continuously polled, and the second data subset is taken out from the cache queue for training in each batch until the set number of iterations is completed.
[0059] In the embodiment of the present application, on the basis of other embodiments, the original data set can also be divided into different first data subsets. The different first data subsets are distributed to multiple processors for independent data enhancement operations, and the processed first data subsets are immediately added to the cache queue. The model training continuously takes out the processed first data subsets from the cache queue for training, thereby reducing the time for the main processor to wait for the processor to process data during model training and improving the model training speed.
[0060] The embodiment of the present application relates to a model training method, which is applied to the main processor of a model training system. The model training system further includes a processor cluster and a database, as Figure 4 shown, and specifically includes the following steps.
[0061] Step 401: Split the original data set into multiple first data subsets, and assign data identifiers to each first data subset.
[0062] In an exemplary implementation, this step is substantially the same as step 101 of the embodiment of the present application, and will not be elaborated here one by one.
[0063] Step 402: Perform serialization processing on each first data subset to generate each serialized first data subset;
[0064] In an exemplary implementation, each first data subset is serialized in binary (Pickle) format to generate each serialized first data subset.
[0065] Step 403: Store each data identifier and each serialized first data subset in the first table structure of the database; so that each processor in the processor cluster can obtain each serialized first data subset and each data identifier from the first table structure, process each serialized first data subset to generate each second data subset, and store each second data subset in the second table structure of the database according to each data identifier.
[0066] In an exemplary implementation, this step is substantially the same as step 102 of the embodiment of the present application, and will not be elaborated here one by one.
[0067] In an exemplary implementation, since the first table structure of the database stores serialized first data subsets, after each processor obtains the serialized first data subsets, it is necessary to first perform a deserialization operation on each serialized first data subset to restore it to each first data subset before performing data processing operations to generate each second data subset. Before storing each second data subset into the second table structure of the database, it is also necessary to first perform serialization processing on each second data subset to generate each serialized second data subset, and then store each serialized second data subset into the second table structure of the database according to each data identifier.
[0068] Step 404: Obtain each second data subset from the second table structure and perform model training based on each second data subset.
[0069] In an exemplary implementation, this step is substantially the same as step 103 of the embodiments of the present application, and will not be elaborated here one by one.
[0070] In the embodiments of the present application, on the basis of other embodiments, serialization processing can also be performed on each first data subset so that each first data subset can be better transmitted or stored.
[0071] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of its algorithm and process are all within the protection scope of this patent.
[0072] The embodiments of the present application relate to a model training system, which is characterized in that the details of the model training system of this embodiment will be specifically described below. The following content is only implementation details provided for convenient understanding and is not necessary for implementing this example. Figure 5 It is a schematic diagram of the model training system of this embodiment, including: a main processor 501, a processor cluster 502, and a database 503.
[0073] Among them, the main processor 501 is used to split the original data set into multiple first data subsets, assign data identifiers to each first data subset, and store each data identifier and each first data subset into the first table structure of the database 503.
[0074] Each processor in the processor cluster 502 is used to obtain each first data subset and each data identifier from the first table structure, process each first data subset to generate each second data subset, and store each second data subset into the second table structure of the database 503 according to each data identifier.
[0075] The main processor 501 is further configured to obtain each second data subset from the second table structure, and perform model training based on each second data subset.
[0076] In one exemplary implementation, as Figure 6 shown, when the original data set consists of the data storage addresses of each piece of original data, the model training system further includes a storage module 601 for storing each piece of original data. Each processor in the processor cluster 502 is further configured to obtain, from the storage module, each piece of original data corresponding to each data storage address according to the data storage addresses in the obtained first data subset.
[0077] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in cooperation with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment. To avoid repetition, they are not elaborated here. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.
[0078] An embodiment of the present application relates to an electronic device, as Figure 7 shown, including: at least one processor 701; and a memory 702 communicatively connected to the at least one processor 701; wherein, the memory 702 stores instructions executable by the at least one processor 701, and the instructions are executed by the at least one processor 701 so that the at least one processor 701 can execute the model training method in each of the above embodiments.
[0079] Among them, the memory and the processor are connected in a bus manner. The bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and the memory together. The bus may also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, and thus will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver may be one component or multiple components, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted over the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor.
[0080] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. The memory can be used to store the data used by the processor when performing operations.
[0081] An embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiment is implemented.
[0082] That is, those skilled in the art can understand that all or part of the steps in implementing the above method embodiments can be completed by a program instructing relevant hardware. The program is stored in a storage medium, including several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc that can store program codes.
[0083] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present application. In actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A model training method, characterized in that, Applied in the main processor of a model training system, the model training system further includes a processor cluster and a database; the method includes: Splitting an original data set into multiple first data subsets and assigning data identifiers to each of the first data subsets; Storing each of the data identifiers and each of the first data subsets into a first table structure of the database; for each processor in the processor cluster to obtain each of the first data subsets and each of the data identifiers from the first table structure, process each of the first data subsets to generate each second data subset, and store each of the second data subsets into a second table structure of the database according to each of the data identifiers; Polling each of the data identifiers, when the model is a machine learning model, detecting whether each of the data identifiers exists in the second table structure, when each of the data identifiers exists in the second table structure, obtaining each of the second data subsets from the second table structure, aggregating each of the second data subsets into a training data set, and performing model training based on the training data set, or, Polling each of the data identifiers, when the model is a deep learning model, detecting whether the data identifier polled this time exists in the second table structure, when the data identifier polled this time exists in the second table structure, obtaining the second data subset corresponding to the data identifier polled this time from the second table structure, adding the second data subset corresponding to the data identifier polled this time to a cache queue, and performing model training based on each of the second data subsets in the cache queue.
2. The model training method according to claim 1, wherein The splitting the original data set into multiple first data subsets and assigning data identifiers to each of the first data subsets includes: When the model is a machine learning model, splitting the original data set into each of the first data subsets according to each preset feature requirement, and assigning each of the data identifiers to each of the first data subsets according to each preset feature requirement.
3. The model training method according to claim 1, wherein The splitting the original data set into multiple first data subsets and assigning data identifiers to each of the first data subsets includes: When the model is a deep learning model, splitting the original data set into each of the first data subsets according to a preset number of batches, and assigning each of the data identifiers to each of the first data subsets according to each of the batches.
4. The model training method according to claim 1, wherein Before storing each of the data identifiers and each of the first data subsets into the first table structure of the database, it further includes: performing serialization processing on each of the first data subsets.
5. A model training system, characterized in that, The system includes: a main processor, a processor cluster and a database; Wherein, the main processor is used for splitting an original data set into multiple first data subsets, assigning data identifiers to each of the first data subsets, and storing each of the data identifiers and each of the first data subsets into a first table structure of the database; Each processor in the processor cluster is configured to obtain each of the first data subsets and each of the data identifiers from the first table structure, process each of the first data subsets to generate each second data subset, and store each of the second data subsets into the second table structure of the database according to each of the data identifiers; The main processor is further configured to poll each of the data identifiers. When the model is a machine learning model, it detects whether each of the data identifiers exists in the second table structure. When each of the data identifiers exists in the second table structure, it obtains each of the second data subsets from the second table structure, aggregates each of the second data subsets into a training data set, and performs model training based on the training data set, or The main processor is further configured to poll each of the data identifiers. When the model is a deep learning model, it detects whether the data identifier polled this time exists in the second table structure. When the data identifier polled this time exists in the second table structure, it obtains the second data subset corresponding to the data identifier polled this time from the second table structure, adds the second data subset corresponding to the data identifier polled this time to the cache queue, and performs model training based on each of the second data subsets in the cache queue.
6. The model training system according to claim 5, wherein When the original data set consists of the data storage addresses of each piece of original data, the system further includes a storage module for storing each piece of original data; Each processor in the processor cluster is further configured to obtain each piece of original data corresponding to each of the data storage addresses from the storage module according to the data storage addresses in the obtained first data subsets.
7. An electronic device, characterized in that, Comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the model training method according to any one of claims 1 to 4.
8. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by a processor, implements the model training method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Data processing method and system
CN112035261A