CN116756555A - A method for generating a training model tool, a model training method and a device - Google Patents
A method for generating a training model tool, a model training method and a device Download PDFInfo
- Publication number
- CN116756555A CN116756555A CN202310084557.7A CN202310084557A CN116756555A CN 116756555 A CN116756555 A CN 116756555A CN 202310084557 A CN202310084557 A CN 202310084557A CN 116756555 A CN116756555 A CN 116756555A
- Authority
- CN
- China
- Prior art keywords
- function
- parameter information
- training
- parameter
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/15—Correlation function computation including computation of convolution operations
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
本申请公开了一种训练模型工具的生成方法、模型训练方法和装置,属于计算机技术领域。所述方法包括:从第一函数库中获取第一函数,以及,从第二函数库中获取与所述第一函数功能相同的第二函数,其中,所述第一函数为在CPU上运行的函数,所述第二函数为在GPU上运行的函数;获取第一函数的第一参数信息和第二函数的第二参数信息;根据所述第一参数信息和所述第二参数信息,生成参数集;根据所述参数集,调整第一函数和/或第二函数;根据调整后的第一函数和调整后的第二函数,生成基函数;根据所述基函数,得到基函数库工具。
This application discloses a method for generating a training model tool, a model training method and a device, and belongs to the field of computer technology. The method includes: obtaining a first function from a first function library, and obtaining a second function with the same function as the first function from a second function library, wherein the first function is run on a CPU function, the second function is a function running on the GPU; obtain the first parameter information of the first function and the second parameter information of the second function; according to the first parameter information and the second parameter information, Generate a parameter set; adjust the first function and/or the second function according to the parameter set; generate a basis function according to the adjusted first function and the adjusted second function; obtain a basis function library according to the basis function tool.
Description
技术领域Technical field
本申请属于计算机技术领域,具体涉及一种训练模型工具的生成方法、模型训练方法和装置。The present application belongs to the field of computer technology, and specifically relates to a method for generating a training model tool, a model training method and a device.
背景技术Background technique
随着社会发展,数据量以每年成倍的速度在增长,实现机器学习模型训练加速的需求也越来越重要。With the development of society, the amount of data is increasing at a rate of doubling every year, and the need to accelerate machine learning model training is becoming more and more important.
在相关技术中,通常使用训练终端的中央处理器(Central Processing Unit,CPU)处理对应的训练数据;使用训练终端的图形处理器(Graphics Processing Unit,GPU)处理对应的训练数据,GPU具有更快的数据处理速度,起到了加速训练流程的作用,上述CPU和GPU运行时所需的软件工具包只能处理各自对应的训练数据类型。因此,现有技术中对于实现同一个功能模块,需要针对CPU或GPU分别编写对应的用于训练数据的模块代码,代码编写工作量大,导致人工成本高。In related technologies, the central processing unit (CPU) of the training terminal is usually used to process the corresponding training data; the graphics processing unit (GPU) of the training terminal is used to process the corresponding training data, and the GPU has faster The data processing speed plays a role in accelerating the training process. The above-mentioned software toolkits required for CPU and GPU runtime can only process their corresponding training data types. Therefore, in the existing technology, to implement the same functional module, it is necessary to write corresponding module codes for training data respectively for the CPU or GPU. The code writing workload is large, resulting in high labor costs.
发明内容Contents of the invention
本申请实施例的目的是提供一种训练模型工具的生成方法、模型训练方法和装置,能够解决现有的模型训练方法的代码编写工作量大、人工成本高的问题。The purpose of the embodiments of the present application is to provide a method for generating a training model tool, a model training method and a device, which can solve the problems of heavy code writing workload and high labor cost in the existing model training methods.
第一方面,本申请实施例提供了一种训练模型工具的生成方法,所述方法包括:In a first aspect, embodiments of the present application provide a method for generating a training model tool. The method includes:
从第一函数库中获取第一函数,以及,从第二函数库中获取与所述第一函数功能相同的第二函数,其中,所述第一函数为在CPU上运行的函数,所述第二函数为在GPU上运行的函数;Obtain a first function from the first function library, and obtain a second function with the same function as the first function from the second function library, wherein the first function is a function running on the CPU, and the The second function is a function that runs on the GPU;
获取第一函数的第一参数信息和第二函数的第二参数信息;Obtain the first parameter information of the first function and the second parameter information of the second function;
根据所述第一参数信息和所述第二参数信息,生成参数集;Generate a parameter set according to the first parameter information and the second parameter information;
根据所述参数集,调整第一函数和/或第二函数;adjusting the first function and/or the second function according to the parameter set;
根据调整后的第一函数和调整后的第二函数,生成基函数;Generate a basis function based on the adjusted first function and the adjusted second function;
根据所述基函数,得到基函数库工具。Based on the basis functions, a basis function library tool is obtained.
可选地,所述根据所述第一参数信息和所述第二参数信息,生成参数集包括:Optionally, generating a parameter set according to the first parameter information and the second parameter information includes:
比较所述第一参数信息和所述第二参数信息,得到比较结果;Compare the first parameter information and the second parameter information to obtain a comparison result;
根据所述比较结果、所述第一参数信息和所述第二参数信息,生成参数集。A parameter set is generated according to the comparison result, the first parameter information and the second parameter information.
可选地,所述第一参数信息和/或所述第二参数信息包括下述至少之一:函数名称、参数数量以及参数类型。Optionally, the first parameter information and/or the second parameter information includes at least one of the following: function name, parameter number, and parameter type.
可选地,所述根据所述比较结果、所述第一参数信息和所述第二参数信息,生成参数集包括:Optionally, generating a parameter set based on the comparison result, the first parameter information and the second parameter information includes:
在比较结果为相同的情况下,将所述第一参数信息或所述第二参数信息,作为参数集;If the comparison result is the same, use the first parameter information or the second parameter information as a parameter set;
在比较结果不同的情况下,从所述第一参数信息和所述第二参数信息中,获取包含参数数量较大的一者作为基准参数信息;If the comparison results are different, obtain the one containing a larger number of parameters from the first parameter information and the second parameter information as the reference parameter information;
根据所述基准参数信息,得到所述参数集。According to the reference parameter information, the parameter set is obtained.
可选地,所述根据所述参数集,调整第一函数和第二函数包括:Optionally, adjusting the first function and the second function according to the parameter set includes:
基于所述参数集,对所述第一函数和所述第二函数中包含参数数量较小者进行函数参数增强调整。Based on the parameter set, function parameter enhancement adjustment is performed on the first function or the second function that contains a smaller number of parameters.
可选地,所述方法还包括:Optionally, the method also includes:
在第一函数库不包括与第二函数对应的第一函数的情况下,根据所述第二函数的第二参数信息,编译生成与所述第二函数对应的第一函数;或者,When the first function library does not include the first function corresponding to the second function, compile and generate the first function corresponding to the second function according to the second parameter information of the second function; or,
在第二函数库不包括与第一函数对应的第二函数的情况下,根据所述第一函数的第一参数信息,编译生成与所述第一函数对应的第二函数。When the second function library does not include a second function corresponding to the first function, a second function corresponding to the first function is compiled and generated according to the first parameter information of the first function.
第二方面,本申请实施例提供了一种模型训练方法,所述方法包括:In a second aspect, embodiments of the present application provide a model training method, which method includes:
响应于模型训练任务,获取训练数据以及模型训练工作流的配置信息;In response to the model training task, obtain training data and configuration information of the model training workflow;
根据所述配置信息调用与所述模型训练工作流相关联的基函数,其中,所述基函数被配置为第一方面所述的基函数;Call the basis function associated with the model training workflow according to the configuration information, wherein the basis function is configured as the basis function described in the first aspect;
通过所述基函数和所述训练数据,对模型进行迭代训练。Through the basis function and the training data, the model is iteratively trained.
可选地,所述通过所述基函数和所述训练数据,对模型进行迭代训练包括:Optionally, the iterative training of the model through the basis function and the training data includes:
根据所述训练数据的数据类型,确定调用的目标运行资源,其中,所述目标运行资源包括CPU资源或GPU资源;Determine the target running resource to be called according to the data type of the training data, where the target running resource includes CPU resources or GPU resources;
基于所述基函数,调用所述目标运行资源,以对模型进行迭代训练。Based on the base function, the target running resource is called to iteratively train the model.
第三方面,本申请实施例提供了一种用于训练模型的工具生成装置,所述装置包括:In a third aspect, embodiments of the present application provide a tool generation device for training a model. The device includes:
第一获取模块,用于从第一函数库中获取第一函数,以及,从第二函数库中获取与所述第一函数功能相同的第二函数,其中,所述第一函数为在CPU上运行的函数,所述第二函数为在GPU上运行的函数;The first acquisition module is used to acquire the first function from the first function library, and acquire the second function with the same function as the first function from the second function library, wherein the first function is configured on the CPU. A function that runs on the GPU, and the second function is a function that runs on the GPU;
第二获取模块,用于获取第一函数的第一参数信息和第二函数的第二参数信息;The second acquisition module is used to acquire the first parameter information of the first function and the second parameter information of the second function;
第一生成模块,用于根据所述第一参数信息和所述第二参数信息,生成参数集;A first generation module, configured to generate a parameter set according to the first parameter information and the second parameter information;
调整模块,用于根据所述参数集,调整第一函数和/或第二函数;an adjustment module, configured to adjust the first function and/or the second function according to the parameter set;
第二生成模块,用于根据调整后的第一函数和调整后的第二函数,生成基函数;The second generation module is used to generate the basis function according to the adjusted first function and the adjusted second function;
第三生成模块,用于根据所述基函数,得到基函数库工具。The third generation module is used to obtain a basis function library tool according to the basis function.
第四方面,本申请实施例提供了一种模型训练装置,所述装置包括:In a fourth aspect, embodiments of the present application provide a model training device, which includes:
获取模块,用于响应于模型训练任务,获取训练数据以及模型训练工作流的配置信息;The acquisition module is used to obtain training data and configuration information of the model training workflow in response to the model training task;
调用模块,用于根据所述配置信息调用与所述模型训练工作流相关联的基函数,其中,所述基函数被配置为第一方面所述的基函数;A calling module, configured to call a base function associated with the model training workflow according to the configuration information, wherein the base function is configured as the base function described in the first aspect;
训练模块,用于通过所述基函数和所述训练数据,对模型进行迭代训练。A training module, configured to iteratively train the model through the basis function and the training data.
第五方面,本申请实施例提供了一种电子设备,所述电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的训练模型工具的生成方法或如第二方面所述的模型训练方法的步骤。In a fifth aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor and a memory. The memory stores programs or instructions that can be run on the processor. The program or instructions are processed by the processor. When executed by the processor, the steps of the method for generating a training model tool as described in the first aspect or the method for model training as described in the second aspect are implemented.
第六方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的训练模型工具的生成方法或如第二方面所述的模型训练方法的步骤。In a sixth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the training model tool as described in the first aspect is implemented. The steps of the generation method or the model training method as described in the second aspect.
在本申请实施例中,通过获取在CPU上运行的第一函数的第一参数信息,以及,在GPU上运行的第二函数的第二参数信息,利用第一参数信息和所述第二参数信息,生成参数集,从而利用该参数集对第一函数、第二函数进行调整,并得到基函数。本发明方案通过对CPU上运行的函数和GPU上运行的函数进行调整,从而抽象得到基函数库工具,然后在使用CPU或GPU进行模型自动化训练时,,再通过基函数库中的基函数来调用第一函数或第二函数,无需分别针对CPU和GPU来编写用于模型训练的模块代码,减少了重复工作量和成本,避免了转换不便的问题,提高了效率。In this embodiment of the present application, by obtaining the first parameter information of the first function running on the CPU and the second parameter information of the second function running on the GPU, the first parameter information and the second parameter are used Information is generated to generate a parameter set, thereby using the parameter set to adjust the first function and the second function, and obtain the basis function. The solution of the present invention abstracts and obtains a basic function library tool by adjusting the functions running on the CPU and the functions running on the GPU. Then, when using the CPU or GPU for automatic model training, it uses the basic functions in the basic function library. By calling the first function or the second function, there is no need to write module codes for model training separately for the CPU and GPU, which reduces repeated workload and cost, avoids the problem of inconvenient conversion, and improves efficiency.
附图说明Description of the drawings
图1为本申请实施例提供的用于训练模型的工具生成方法的流程示意图;Figure 1 is a schematic flowchart of a tool generation method for training a model provided by an embodiment of the present application;
图2为本申请实施例提供的模型训练方法的流程示意图;Figure 2 is a schematic flow chart of the model training method provided by the embodiment of the present application;
图3为一种训练模型工具的应用的示意图;Figure 3 is a schematic diagram of the application of a training model tool;
图4为本申请实施例提供的用于训练模型的工具生成装置的结构示意图Figure 4 is a schematic structural diagram of a tool generation device for training models provided by an embodiment of the present application.
图5为本申请实施例提供的模型训练装置的结构示意图;Figure 5 is a schematic structural diagram of a model training device provided by an embodiment of the present application;
图6为本申请实施例提供的电子设备的结构示意图。Figure 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的用于训练模型的工具生成方法进行详细地说明。The tool generation method for training models provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
如图1所示,本申请实施例提供的模型训练方法,包括如下步骤:As shown in Figure 1, the model training method provided by the embodiment of this application includes the following steps:
步骤S11,从第一函数库中获取第一函数,以及,从第二函数库中获取与所述第一函数功能相同的第二函数,其中,所述第一函数为在CPU上运行的函数,所述第二函数为在GPU上运行的函数。Step S11: Obtain a first function from the first function library, and obtain a second function with the same function as the first function from the second function library, where the first function is a function that runs on the CPU. , the second function is a function that runs on the GPU.
在模型训练过程中,可以在CPU或GPU上通过算法搭建自动机器学习框架实现自动化地处理数据清洗、特征工程、超参数优化、模型选择、模型评估、模型融合等一系列模型训练流程。在CPU上进行模型训练时所用到的工具库以及调用的函数与在GPU上进行模型训练时所用到的工具库以及调用的函数是不同的。CPU工具库主要包括Pandas、Numpy和Scikit-learn。GPU工具库主要包括cuDF(数据处理库)、cuPY(矩阵数学库)、cuML(机器学习库),GPU工具库具备与CPU工具库相似的应用程序界面(Application Program Interface,API)接口。During the model training process, an automatic machine learning framework can be built on the CPU or GPU through algorithms to automatically handle a series of model training processes such as data cleaning, feature engineering, hyperparameter optimization, model selection, model evaluation, and model fusion. The tool libraries and functions called when performing model training on the CPU are different from the tool libraries and functions called when performing model training on the GPU. The CPU tool library mainly includes Pandas, Numpy and Scikit-learn. The GPU tool library mainly includes cuDF (data processing library), cuPY (matrix mathematics library), and cuML (machine learning library). The GPU tool library has an Application Program Interface (API) interface similar to the CPU tool library.
从CPU工具库中选择出模型训练过程中需要调用的第一函数,第一函数被包含于第一函数库内。从GPU工具库中选择出模型训练过程中需要调用的第二函数,第二函数被包含于第二函数库内。函数功能相同的第一函数与第二函数是相对应的。Select the first function that needs to be called during the model training process from the CPU tool library, and the first function is included in the first function library. Select the second function that needs to be called during the model training process from the GPU tool library, and the second function is included in the second function library. The first function and the second function with the same function function correspond to each other.
步骤S12,获取第一函数的第一参数信息和第二函数的第二参数信息。Step S12: Obtain the first parameter information of the first function and the second parameter information of the second function.
第一参数信息包括第一函数的函数接口、函数功能,类似的,第二参数信息包括第二函数的函数接口、函数功能。The first parameter information includes the function interface and function functions of the first function. Similarly, the second parameter information includes the function interface and function functions of the second function.
步骤S13,根据所述第一参数信息和所述第二参数信息,生成参数集。Step S13: Generate a parameter set based on the first parameter information and the second parameter information.
参数集中包含第一函数库中所有第一函数对应的第一参数信息,即第一函数对应的函数接口、函数功能,同样的,参数集中还包含第二函数库中所有第二函数对应的第二函数信息。The parameter set contains the first parameter information corresponding to all the first functions in the first function library, that is, the function interface and function function corresponding to the first function. Similarly, the parameter set also contains the first parameter information corresponding to all the second functions in the second function library. Two function information.
针对功能相同的一对第一函数和第二函数,对比对应的第一参数信息和第二参数信息,当第一参数信息和第二参数信息相同时,第一参数信息和第二参数信息无需修改。当第一参数信息和第二参数信息不同时,对第一参数信息或第二参数信息进行调整,使得第一参数信息和第二参数信息相同。For a pair of first function and second function with the same function, compare the corresponding first parameter information and second parameter information. When the first parameter information and the second parameter information are the same, the first parameter information and the second parameter information do not need to be Revise. When the first parameter information and the second parameter information are different, the first parameter information or the second parameter information is adjusted so that the first parameter information and the second parameter information are the same.
步骤S14,根据所述参数集,调整第一函数和/或第二函数。Step S14: Adjust the first function and/or the second function according to the parameter set.
可以理解地,当参数集中目标第一参数信息或目标第二参数信息进行调整后,需要对应的调整第一函数库中的目标第一函数或目标第二函数,使得调整后的目标第一函数的第一参数信息与目标第一参数信息一致或目标第二函数的第二参数信息与目标第二参数信息一致。It can be understood that when the target first parameter information or the target second parameter information in the parameter set is adjusted, the target first function or the target second function in the first function library needs to be adjusted accordingly, so that the adjusted target first function The first parameter information of the function is consistent with the target first parameter information or the second parameter information of the target second function is consistent with the target second parameter information.
步骤S15,根据调整后的第一函数和调整后的第二函数,生成基函数。Step S15: Generate a basis function based on the adjusted first function and the adjusted second function.
进行调整后,每对函数功能相同的第一函数和第二函数的第一参数信息和第二参数信息也相同,即函数接口也相同,对每对函数功能相同、函数接口相同的第一函数和第二函数进行抽象,形成对应的基函数,基函数用于调用对应的第一函数或第二函数。After adjustment, the first parameter information and second parameter information of each pair of the first function and the second function with the same function function are also the same, that is, the function interface is also the same. For each pair of the first function with the same function function and the same function interface Abstract with the second function to form a corresponding base function, which is used to call the corresponding first function or second function.
步骤S16,根据所述基函数,得到基函数库工具。Step S16: Obtain a basis function library tool based on the basis function.
基函数库工具中包括多个基函数,所述基函数用于调用对应的第一函数或对应的第二函数,因此,通过基函数库工具可以在第一函数库上调用第一函数或在第二函数库中调用第二函数。The base function library tool includes a plurality of base functions, and the base functions are used to call the corresponding first function or the corresponding second function. Therefore, through the base function library tool, the first function can be called on the first function library or on the first function library. The second function is called in the second function library.
通过以下示例对生成基函数的过程进行说明,要实现加法这个功能,CPU的工具Pandas和GPU的工具库cuDF都要用到add()这个函数,对应的第一函数为pandas.DataFrame.add(other,axis='columns',level=None,fill_value=None)。The following example illustrates the process of generating a basis function. To implement the addition function, the CPU tool Pandas and the GPU tool library cuDF both use the add() function. The corresponding first function is pandas.DataFrame.add( other, axis='columns', level=None, fill_value=None).
对应的第二函数为cudf.DataFrame.add(other,axis='columns',level=None,fill_value=None)。The corresponding second function is cudf.DataFrame.add(other, axis='columns', level=None, fill_value=None).
将实现加法的第一函数和第二函数代码进行抽象,得到统一接口的基函数:Abstract the first and second function codes that implement addition to obtain the base function of a unified interface:
basetoolbox.DataFrame.add(other,axis='columns',level=None,fill_value=None)。basetoolbox.DataFrame.add(other, axis='columns', level=None, fill_value=None).
需要说明的是,每个基函数包括对应的函数功能。It should be noted that each basis function includes corresponding function functions.
通过上述步骤,获取在CPU上运行的第一函数的第一参数信息,以及,在GPU上运行的第二函数的第二参数信息,利用第一参数信息和所述第二参数信息,生成参数集,从而利用该参数集对第一函数、第二函数进行调整,并得到基函数。本发明方案通过对CPU上运行的函数和GPU上运行的函数进行调整,从而抽象得到基函数库工具,然后在使用CPU或GPU进行模型自动化训练时,再通过基函数库工具中的基函数来调用第一函数或第二函数,无需分别针对CPU和GPU来编写用于模型训练的模块代码,减少了重复工作量和成本,避免了转换不便的问题,提高了效率。Through the above steps, the first parameter information of the first function running on the CPU and the second parameter information of the second function running on the GPU are obtained, and parameters are generated using the first parameter information and the second parameter information. set, thereby using the parameter set to adjust the first function and the second function, and obtain the basis function. The solution of the present invention abstracts and obtains a basic function library tool by adjusting the functions running on the CPU and the functions running on the GPU, and then uses the basic functions in the basic function library tool when using the CPU or GPU for automatic model training. By calling the first function or the second function, there is no need to write module codes for model training separately for the CPU and GPU, which reduces repeated workload and cost, avoids the problem of inconvenient conversion, and improves efficiency.
可选地,所述根据所述第一参数信息和所述第二参数信息,生成参数集,包括:Optionally, generating a parameter set based on the first parameter information and the second parameter information includes:
比较所述第一参数信息和所述第二参数信息,得到比较结果;Compare the first parameter information and the second parameter information to obtain a comparison result;
根据所述比较结果、所述第一参数信息和所述第二参数信息,生成参数集。A parameter set is generated according to the comparison result, the first parameter information and the second parameter information.
将功能相同的一对第一函数、第二函数的第一参数信息和第二参数信息进行对比,得到比较结果,根据比较结果来判断是否需要对第一参数信息或第二参数信息进行修改,以使每对功能相同的第一函数和第二函数的第一参数信息和第二参数信息一致,从而保证基函数库工具能够通过基函数准确地在第一函数库、第二函数库中调用功能相同的第一函数和第二函数。Compare the first parameter information and the second parameter information of a pair of the first function and the second function with the same function to obtain the comparison result, and determine whether the first parameter information or the second parameter information needs to be modified based on the comparison result, In order to make the first parameter information and the second parameter information of each pair of the first function and the second function with the same function consistent, thereby ensuring that the base function library tool can be accurately called in the first function library and the second function library through the base function The first function and the second function have the same function.
可选地,所述第一参数信息和/或所述第二参数信息包括下述至少之一:函数名称、参数数量以及参数类型。Optionally, the first parameter information and/or the second parameter information includes at least one of the following: function name, parameter number, and parameter type.
函数名称与函数的功能相对应,便于基函数调用。参数数量表示函数能够处理的参数的个数,参数类型表示函数能够处理的参数的数据类型。将上述函数名称、参数数量以及参数类型综合考虑进行第一参数信息和第二参数信息的比对,根据比对结果调整第一参数信息和/或第二参数信息,从而在后续过程中调整第一函数和/或第二函数,进一步保证了基函数库工具能够通过基函数准确地在第一函数库、第二函数库中调用功能相同的第一函数和第二函数。The function name corresponds to the function's function, making it easy to call the base function. The number of parameters indicates the number of parameters that the function can handle, and the parameter type indicates the data type of the parameters that the function can handle. Compare the first parameter information and the second parameter information by comprehensively considering the above-mentioned function name, number of parameters, and parameter types, and adjust the first parameter information and/or the second parameter information according to the comparison results, so as to adjust the third parameter information in the subsequent process. The first function and/or the second function further ensures that the base function library tool can accurately call the first function and the second function with the same function in the first function library and the second function library through the base function.
可选地,所述根据所述比较结果、所述第一参数信息和所述第二参数信息,生成参数集包括:Optionally, generating a parameter set based on the comparison result, the first parameter information and the second parameter information includes:
在比较结果为相同的情况下,将所述第一参数信息或所述第二参数信息,作为参数集,When the comparison result is the same, the first parameter information or the second parameter information is used as a parameter set,
比较结果为相同的情况下,即当函数功能相同的一对第一函数与第二函数的函数接口也相同,即函数能够处理的参数个数、能够处理的参数的数据类型、函数的名称均相同时,无需对第一参数信息和第二参数信息进行调整,也无需对第一参数信息对应的第一函数和第二参数信息对应的第二函数进行调整,直接生成对应的基函数,在后续模型训练过程中,只需要通过基函数库工具中的基函数调用第一函数库中对应的第一函数或第二函数库中对应的第二函数就能完成数据处理,无需针对CPU和GPU来重新编写训练模块代码。When the comparison result is the same, that is, when a pair of the first function and the second function with the same function function also have the same function interface, that is, the number of parameters that the function can handle, the data type of the parameters that can be processed, and the name of the function are all the same. At the same time, there is no need to adjust the first parameter information and the second parameter information, and there is no need to adjust the first function corresponding to the first parameter information and the second function corresponding to the second parameter information, and the corresponding basis function is directly generated. In the subsequent model training process, you only need to call the corresponding first function in the first function library or the corresponding second function in the second function library through the basic function in the basic function library tool to complete the data processing. There is no need to target the CPU and GPU. to rewrite the training module code.
在比较结果不同的情况下,从所述第一参数信息和所述第二参数信息中,获取包含参数数量较大的一者作为基准参数信息,根据所述基准参数信息,得到所述参数集。When the comparison results are different, the one containing a larger number of parameters is obtained from the first parameter information and the second parameter information as the reference parameter information, and the parameter set is obtained based on the reference parameter information. .
针对功能相同的一对第一函数和第二函数,比较结果不同的情况,即该对函数的第一参数信息和第二参数信息不同,即函数接口不同时,对第一参数信息或第二参数信息进行调整,以生成参数集。具体的,函数接口不同可以是函数处理的参数个数不同、函数数据类型不同或函数的名称不同。若是第一参数信息的函数接口参数少于第二参数信息的函数接口参数,第二参数信息为基准参数信息,根据基准参数信息增加第一参数信息的函数接口;若是第二参数信息的函数接口参数少于第一参数信息的函数接口参数,第一参数信息为基准参数信息,根据基准参数信息增加第二参数信息。根据基准参数信息对包含参数数量较少的一方进行补充,便于后续根据基准参数信息对于包含参数数量较少的一方所对应的函数进行调整。For a pair of first function and second function with the same function, the comparison results are different, that is, the first parameter information and the second parameter information of the pair of functions are different, that is, when the function interfaces are different, the first parameter information or the second parameter information is different. Parameter information is adjusted to generate parameter sets. Specifically, the different function interfaces may be due to the different number of parameters processed by the function, different function data types, or different function names. If the function interface parameters of the first parameter information are less than the function interface parameters of the second parameter information, the second parameter information is the base parameter information, and the function interface of the first parameter information is added according to the base parameter information; if it is the function interface of the second parameter information For function interface parameters whose parameters are less than the first parameter information, the first parameter information is the reference parameter information, and the second parameter information is added according to the reference parameter information. The party containing a smaller number of parameters is supplemented according to the benchmark parameter information, so as to facilitate subsequent adjustments to the function corresponding to the party containing a smaller number of parameters based on the benchmark parameter information.
可选地,所述根据所述参数集,调整第一函数和第二函数包括:Optionally, adjusting the first function and the second function according to the parameter set includes:
基于所述参数集,对所述第一函数和所述第二函数中包含参数数量较小者进行函数参数增强调整。Based on the parameter set, function parameter enhancement adjustment is performed on the first function or the second function that contains a smaller number of parameters.
示例性的,第一函数为Scikit-learn中的函数,根据第一函数对应的第一参数信息可知,第一函数可以支持整数、浮点数、文本等数据类型,而第二函数为cuML中的函数,根据第二函数对应的第二参数信息可知,第二函数仅支持整数、浮点数。在这种情况下,第一函数的第一参数信息为基准参数信息,根据基准参数信息,需要增加第二函数的第二参数信息中的函数接口参数,即对第二参数信息中的函数接口参数进行标签编码的功能增强。当有文本特征出现时,对文本进行类别识别,然后再进行标签编码,用数字的标签代替文本。进行功能增强后的第一参数信息和第二参数信息的函数功能和函数接口一致,便于对第一函数和第二函数进行抽象处理,得到对应的基函数,以生成基函数库工具。For example, the first function is a function in Scikit-learn. According to the first parameter information corresponding to the first function, the first function can support data types such as integers, floating point numbers, and text, while the second function is a function in cuML. function, according to the second parameter information corresponding to the second function, the second function only supports integers and floating point numbers. In this case, the first parameter information of the first function is the reference parameter information. According to the reference parameter information, the function interface parameter in the second parameter information of the second function needs to be added, that is, the function interface parameter in the second parameter information needs to be added. Enhancements to parameter encoding for tags. When text features appear, the text is classified into categories, and then label encoding is performed to replace the text with numeric labels. The function functions and function interfaces of the enhanced first parameter information and the second parameter information are consistent, which facilitates abstract processing of the first function and the second function, and obtains corresponding base functions to generate base function library tools.
可选地,本申请实施例提供的用于训练模型的工具生成方法,还包括:Optionally, the tool generation method for training the model provided by the embodiment of this application also includes:
在第一函数库不包括与第二函数对应的第一函数的情况下,根据所述第二函数的第二参数信息,编译生成与所述第二函数对应的第一函数;或者,When the first function library does not include the first function corresponding to the second function, compile and generate the first function corresponding to the second function according to the second parameter information of the second function; or,
在第二函数库不包括与第一函数对应的第二函数的情况下,根据所述第一函数的第一参数信息,编译生成与所述第一函数对应的第二函数。When the second function library does not include a second function corresponding to the first function, a second function corresponding to the first function is compiled and generated according to the first parameter information of the first function.
需要说明的是,由于支持CPU运行的软件生态相较于支持GPU运行的软件生态更加成熟,一般而言第一函数库中的第一函数能够实现的功能多于第二函数库中的第二函数,因此,大部分情况下在第二函数库中每个第二函数均能在第一函数库中找到对应的第一函数,第一函数则不一定能够在第二函数库中找到对应的第二函数,因此需要根据第一函数的第一参数信息,编译生成对应的第二函数。It should be noted that since the software ecosystem that supports CPU operation is more mature than the software ecosystem that supports GPU operation, generally speaking, the first function in the first function library can implement more functions than the second function in the second function library. function, therefore, in most cases, each second function in the second function library can find the corresponding first function in the first function library, but the first function may not necessarily be able to find the corresponding first function in the second function library. The second function therefore needs to be compiled to generate the corresponding second function based on the first parameter information of the first function.
通过以下示例对编译过程进行说明,cuML的一些函数只支持对ndarray数据进行处理,而不支持机器学习算法的主流数据格式DataFrame,当目标第一函数用于对DataFrame格式的数据进行某一特定功能的处理时,cuML由于只支持对ndarray数据进行处理而不存在与目标第一函数对应的第二函数,因此,只能参照目标第一函数的第一参数信息对应的算法逻辑,在GPU工具库中重新以DataFrame的方式实现一遍,生成目标第二函数与目标第一函数进行对应,再根据目标第一函数和目标第二函数生成目标基函数,保证了模型训练过程中的每个步骤都可以通过调用基函数的方式来实现。The compilation process is explained through the following example. Some functions of cuML only support processing ndarray data, but do not support DataFrame, the mainstream data format of machine learning algorithms. When the target first function is used to perform a specific function on data in DataFrame format When processing, cuML only supports processing ndarray data and there is no second function corresponding to the first function of the target. Therefore, you can only refer to the algorithm logic corresponding to the first parameter information of the first function of the target in the GPU tool library. Implement it again in the form of DataFrame, generate the second target function to correspond to the first target function, and then generate the target base function based on the first target function and the second target function, ensuring that every step in the model training process can This is achieved by calling base functions.
本申请实施例还提供了一种模型训练方法,如图2所示,模型训练方法,包括:The embodiment of the present application also provides a model training method. As shown in Figure 2, the model training method includes:
步骤S21,响应于模型训练任务,获取训练数据以及模型训练工作流的配置信息。Step S21: In response to the model training task, obtain training data and configuration information of the model training workflow.
模型训练方法的执行主体可以是模型训练应用,模型训练应用可以装载至手机、电脑等设备上。基于模型训练任务,模型训练方法的执行主体进行响应,并获取训练数据以及模型训练工作流的配置信息。训练数据的一般要求为:数据样本尽可能大、数据多样化、数据样本质量较高。配置信息包括算子模块、算子模型间的运行关系,算子模型包括:数据清洗、缺失值处理、归一化处理、特征工程、超参数优化、模型选择、模型评估、模型融合。将训练数据和配置信息输入至模型训练应用中,进行全流程自动机器学习。The execution subject of the model training method may be a model training application, and the model training application may be loaded on a mobile phone, computer, or other devices. Based on the model training task, the execution subject of the model training method responds and obtains training data and configuration information of the model training workflow. The general requirements for training data are: the data sample should be as large as possible, the data should be diverse, and the data sample should be of high quality. Configuration information includes the operating relationship between operator modules and operator models. Operator models include: data cleaning, missing value processing, normalization processing, feature engineering, hyperparameter optimization, model selection, model evaluation, and model fusion. Input training data and configuration information into the model training application to perform full-process automatic machine learning.
步骤S22,根据所述配置信息调用与所述模型训练工作流相关联的基函数,其中,所述基函数被配置为上述训练模型工具的生产方法中所述的基函数,Step S22: Call the base function associated with the model training workflow according to the configuration information, wherein the base function is configured as the base function described in the production method of the above training model tool,
根据配置信息来确定与模型训练工作流相关联的基函数,如需要对训练数据进行数据清洗,则调用具有数据清洗功能的基函数,再通过基函数在第一函数库、第二函数库中调用对应功能的第一函数和第二函数。Determine the base function associated with the model training workflow according to the configuration information. If the training data needs to be cleaned, the base function with the data cleaning function is called, and then the base function is used in the first function library and the second function library. Call the first function and the second function of the corresponding function.
步骤S23,通过所述基函数和所述训练数据,对模型进行迭代训练。Step S23: Iteratively train the model through the basis function and the training data.
根据基函数与功能相同的第一函数、第二函数的对应关系,可在第一函数库中调用对应的第一函数或在第二函数库中调用对应的第二函数,对训练数据进行处理,以进行模型训练。因此,在对训练数据进行处理时,既可以选择CPU也可以选择GPU。CPU具备少量但运算能力强大的运算单元,适用于复杂度较高的少量计算。GPU具有成百上千个内核,可以进行大量的并行计算,计算速度远大于CPU的计算速度,但是能够处理的运算逻辑的复杂程度较低。在对训练数据进行处理时,根据训练步骤所需要的算法逻辑和数据量,合理选择调用第一函数在CPU上进行处理或调用第二函数在GPU上进行处理。通过上述基函数的调用以及基函数对应的第一函数或第二函数的调用,使得CPU和GPU均可以完成全流程自动机器学习的训练任务。此外,由于GPU的特点,通常情况下,采用GPU的速度性能优于CPU,且训练数据的数据量越大,GPU的加速优势越明显。According to the corresponding relationship between the base function and the first function and the second function with the same function, the corresponding first function can be called in the first function library or the corresponding second function can be called in the second function library to process the training data. , for model training. Therefore, when processing training data, you can choose either CPU or GPU. The CPU has a small number of computing units with powerful computing capabilities, and is suitable for a small amount of calculations with high complexity. The GPU has hundreds or thousands of cores and can perform a large number of parallel calculations. The calculation speed is much greater than that of the CPU, but the complexity of the computational logic it can handle is low. When processing training data, according to the algorithm logic and data volume required for the training step, it is reasonable to choose to call the first function for processing on the CPU or the second function for processing on the GPU. Through the invocation of the above-mentioned base function and the invocation of the first function or the second function corresponding to the base function, both the CPU and the GPU can complete the full-process automatic machine learning training task. In addition, due to the characteristics of GPU, usually the speed performance of GPU is better than that of CPU, and the larger the amount of training data, the more obvious the acceleration advantage of GPU.
可选地,所述通过所述基函数和所述训练数据,对模型进行迭代训练,包括:Optionally, iteratively training the model through the basis function and the training data includes:
根据所述训练数据的数据类型,确定调用的目标运行资源,其中,所述目标运行资源包括CPU资源或GPU资源;Determine the target running resource to be called according to the data type of the training data, where the target running resource includes CPU resources or GPU resources;
基于所述基函数,调用所述目标运行资源,以对模型进行迭代训练。Based on the base function, the target running resource is called to iteratively train the model.
可以理解地,当训练数据的数据类型为更适合CPU处理的类型时,通过基函数调用第一函数,在CPU上进行训练;当训练数据的数据类型为更适合GPU处理的类型时,通过基函数调用第二函数,在GPU上进行训练。Understandably, when the data type of the training data is a type more suitable for CPU processing, the first function is called through the base function to perform training on the CPU; when the data type of the training data is a type more suitable for GPU processing, the first function is called through the base function. The function calls the second function to perform training on the GPU.
如图3所示,是一种训练模型工具的应用的示意图。输入训练数据集,训练集数据train data,就能够完成自动机器学习模型的训练。该模型训练应用包括通过调整后的第一函数和通过调整后的第二函数共同确定的基函数库,即图3示出的抽象层,上述抽象层又称为基函数库工具(BaseToolbox),BaseToolbox可识别训练集数据的数据类型。该应用还包括工具包,工具包包括CPU函数库cpuToolbox,即第一函数库,以及GPU函数库gpuToolbox,即第二函数库。基函数库工具根据训练集数据及模型训练工作流的配置信息,来确定对应功能的基函数后,再根据识别到的训练集数据的数据类型选择调用CPU函数库中的第一函数或GPU函数库中的第二函数。例如,当训练集数据的格式为GPU支持的cuDFDaraFrame时,在GPU函数库中调用第二函数,并在GPU中执行自动机器学习模型训练流程。As shown in Figure 3, it is a schematic diagram of the application of a training model tool. Input the training data set and train data to complete the training of the automatic machine learning model. The model training application includes a base function library determined by the adjusted first function and the adjusted second function, that is, the abstraction layer shown in Figure 3. The above abstraction layer is also called the base function library tool (BaseToolbox). BaseToolbox identifies the data type of the training set data. The application also includes a toolkit, which includes a CPU function library cpuToolbox, which is the first function library, and a GPU function library gpuToolbox, which is the second function library. The basis function library tool determines the basis function of the corresponding function based on the training set data and the configuration information of the model training workflow, and then selects to call the first function or GPU function in the CPU function library based on the identified data type of the training set data. Second function in the library. For example, when the format of the training set data is cuDFDaraFrame supported by the GPU, the second function is called in the GPU function library and the automatic machine learning model training process is executed in the GPU.
既可以使用CPU也可以使用GPU来进行模型训练,使用更加灵活,且根据训练数据的数据类型来确定使用CPU或GPU,进一步保证了模型训练过程的稳定性。Both CPU and GPU can be used for model training, which is more flexible. The use of CPU or GPU is determined according to the data type of the training data, further ensuring the stability of the model training process.
本申请实施例提供的训练模型工具生成方法,执行主体可以为训练模型工具的生成装置。For the training model tool generation method provided by the embodiment of the present application, the execution subject may be a training model tool generation device.
本申请实施例中以训练模型工具的生成装置执行训练模型工具的生成方法为例,并结合附图4说明本申请实施提供的训练模型工具的生成装置400。所述训练模型工具的生成装置400包括:In the embodiment of the present application, a method for generating a training model tool executed by a training model tool generating device is taken as an example, and the training model tool generating device 400 provided by the present application is explained with reference to FIG. 4 . The generating device 400 of the training model tool includes:
第一获取模块401,用于从第一函数库中获取第一函数,以及,从第二函数库中获取与所述第一函数功能相同的第二函数,其中,所述第一函数为在CPU上运行的函数,所述第二函数为在GPU上运行的函数;The first acquisition module 401 is used to acquire the first function from the first function library, and acquire the second function with the same function as the first function from the second function library, wherein the first function is A function that runs on the CPU, and the second function is a function that runs on the GPU;
第二获取模块402,用于获取第一函数的第一参数信息和第二函数的第二参数信息;The second acquisition module 402 is used to acquire the first parameter information of the first function and the second parameter information of the second function;
第一生成模块403,用于根据所述第一参数信息和所述第二参数信息,生成参数集;The first generation module 403 is used to generate a parameter set according to the first parameter information and the second parameter information;
调整模块404,用于根据所述参数集,调整第一函数和/或第二函数;Adjustment module 404, configured to adjust the first function and/or the second function according to the parameter set;
第二生成模块405,用于根据调整后的第一函数和调整后的第二函数,生成基函数;The second generation module 405 is used to generate a basis function according to the adjusted first function and the adjusted second function;
第三生成模块406,用于根据所述基函数,得到基函数库工具。The third generation module 406 is used to obtain a basis function library tool according to the basis function.
可选地,第一生成模块403还用于:Optionally, the first generation module 403 is also used to:
比较所述第一参数信息和所述第二参数信息,得到比较结果;Compare the first parameter information and the second parameter information to obtain a comparison result;
根据所述比较结果、所述第一参数信息和所述第二参数信息,生成参数集。A parameter set is generated according to the comparison result, the first parameter information and the second parameter information.
可选地,所述第一参数信息和/或所述第二参数信息包括下述至少之一:函数名称、参数数量以及参数类型。Optionally, the first parameter information and/or the second parameter information includes at least one of the following: function name, parameter number, and parameter type.
可选地,第一生成模块403还用于:Optionally, the first generation module 403 is also used to:
在比较结果为相同的情况下,将所述第一参数信息或所述第二参数信息,作为参数集;If the comparison result is the same, use the first parameter information or the second parameter information as a parameter set;
在比较结果不同的情况下,从所述第一参数信息和所述第二参数信息中,获取包含参数数量较大的一者作为基准参数信息;If the comparison results are different, obtain the one containing a larger number of parameters from the first parameter information and the second parameter information as the reference parameter information;
根据所述基准参数信息,得到所述参数集。According to the reference parameter information, the parameter set is obtained.
可选地,调整模块404还用于:Optionally, the adjustment module 404 is also used to:
基于所述参数集,对所述第一函数和所述第二函数中包含参数数量较小者进行函数参数增强调整。Based on the parameter set, function parameter enhancement adjustment is performed on the first function or the second function that contains a smaller number of parameters.
可选地,用于训练模型的工具生成装置400还包括编译模块,编译模块用于:Optionally, the tool generation device 400 for training the model also includes a compilation module, and the compilation module is used for:
在第一函数库不包括与第二函数对应的第一函数的情况下,根据所述第二函数的第二参数信息,编译生成与所述第二函数对应的第一函数;或者,When the first function library does not include the first function corresponding to the second function, compile and generate the first function corresponding to the second function according to the second parameter information of the second function; or,
在第二函数库不包括与第一函数对应的第二函数的情况下,根据所述第一函数的第一参数信息,编译生成与所述第一函数对应的第二函数。When the second function library does not include a second function corresponding to the first function, a second function corresponding to the first function is compiled and generated according to the first parameter information of the first function.
上述用于训练模型的工具生成装置可以根据第一函数库中的第一函数和第二函数库中的第二函数生成对应基函数库工具,再通过基函数库工具中基函数来调用对应的第一函数或第二函数。The above-mentioned tool generation device for training a model can generate a corresponding base function library tool based on the first function in the first function library and the second function in the second function library, and then call the corresponding base function library tool through the base function in the base function library tool. first function or second function.
需要说明的是,本申请实施例所提供的用于训练模型的工具生成装置能够实现上述用于训练模型的工具生成方法的全部技术过程,并能达到相同的技术效果,为避免重复,此处不再赘述。It should be noted that the tool generation device for training a model provided by the embodiment of the present application can implement all the technical processes of the tool generation method for training a model and can achieve the same technical effect. To avoid duplication, here No longer.
本申请实施例提供的模型训练方法,执行主体可以为模型训练装置。本申请实施例中以模型训练装置执行模型训练方法为例,并结合附图5说明本申请实施提供的模型训练装置500。所述模型训练装置包括:For the model training method provided by the embodiments of the present application, the execution subject may be a model training device. In the embodiment of the present application, a model training device executing a model training method is used as an example, and the model training device 500 provided by the present application is described with reference to FIG. 5 . The model training device includes:
获取模块501,用于响应于模型训练任务,获取训练数据以及模型训练工作流的配置信息;The acquisition module 501 is used to obtain training data and configuration information of the model training workflow in response to the model training task;
调用模块502,用于根据所述配置信息调用与所述模型训练工作流相关联的基函数,其中,所述基函数被配置为上述训练模型工具的生成方法中所述的基函数;The calling module 502 is configured to call the base function associated with the model training workflow according to the configuration information, wherein the base function is configured as the base function described in the method for generating the training model tool;
训练模块503,用于通过所述基函数和所述训练数据,对模型进行迭代训练。The training module 503 is used to iteratively train the model through the basis function and the training data.
可选地,训练模块503还用于:Optionally, the training module 503 is also used to:
根据所述训练数据的数据类型,确定调用的目标运行资源,其中,所述目标运行资源包括CPU资源或GPU资源;Determine the target running resource to be called according to the data type of the training data, where the target running resource includes CPU resources or GPU resources;
基于所述基函数,调用所述目标运行资源,以对模型进行迭代训练。Based on the base function, the target running resource is called to iteratively train the model.
上述模型训练装置500可根据基函数和训练数据在CPU或GPU上调用对应的第一函数或第二函数来进行全自动机器学习训练。The above-mentioned model training device 500 can call the corresponding first function or second function on the CPU or GPU according to the basis function and training data to perform fully automatic machine learning training.
需要说明的是,本申请实施例所提供的模型训练装置能够实现上述模型训练方法的全部技术过程,并能达到相同的技术效果,为避免重复,此处不再赘述。It should be noted that the model training device provided by the embodiment of the present application can implement all the technical processes of the above model training method and can achieve the same technical effect. To avoid duplication, the details will not be described here.
本申请实施例中的装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(MobileInternet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR). Equipment, robots, wearable devices, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA), etc. Non-mobile electronic devices can also be servers, network-attached storage (Network Attached Storage (NAS), personal computer (PC), television (TV), teller machine or self-service machine, etc., are not specifically limited in the embodiments of this application.
可选地,如图5所示,本申请实施例还提供一种电子设备600,包括处理器601和存储器602,存储器602上存储有可在处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现上述训练模型工具的生成方法或模型训练方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 5, this embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores programs or instructions that can be run on the processor 601. The program or When the instructions are executed by the processor 601, each step of the above training model tool generation method or model training method embodiment is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述训练模型工具的生成方法或模型训练方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium, which stores a program or instructions. When the program or instructions are executed by a processor, the method for generating a training model tool or the method for training a model can be implemented. Each process can achieve the same technical effect. To avoid duplication, it will not be described again here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , CD), including several instructions to cause a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of this application.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or replacements within the technical scope disclosed in the present application, and all of them should be covered. within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310084557.7A CN116756555A (en) | 2023-01-18 | 2023-01-18 | A method for generating a training model tool, a model training method and a device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310084557.7A CN116756555A (en) | 2023-01-18 | 2023-01-18 | A method for generating a training model tool, a model training method and a device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116756555A true CN116756555A (en) | 2023-09-15 |
Family
ID=87955869
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310084557.7A Pending CN116756555A (en) | 2023-01-18 | 2023-01-18 | A method for generating a training model tool, a model training method and a device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116756555A (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102103567A (en) * | 2009-12-21 | 2011-06-22 | 英特尔公司 | Passing data from a cpu to a graphics processor by writing multiple versions of the data in a shared memory |
| CN102523054A (en) * | 2011-12-07 | 2012-06-27 | 清华大学 | Multiple Input Multiple Output (MIMO) detecting method |
| CN102741828A (en) * | 2009-10-30 | 2012-10-17 | 英特尔公司 | Bi-directional communication support for heterogeneous processors of computer platforms |
| CN110825380A (en) * | 2019-09-30 | 2020-02-21 | 上海寒武纪信息科技有限公司 | Kernel function generation method, target code generation method and combined processing device |
| US20220198296A1 (en) * | 2020-12-23 | 2022-06-23 | EMC IP Holding Comnpany LLC | User context migration based on computation graph in artificial intelligence application executing in edge computing environment |
-
2023
- 2023-01-18 CN CN202310084557.7A patent/CN116756555A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102741828A (en) * | 2009-10-30 | 2012-10-17 | 英特尔公司 | Bi-directional communication support for heterogeneous processors of computer platforms |
| CN102103567A (en) * | 2009-12-21 | 2011-06-22 | 英特尔公司 | Passing data from a cpu to a graphics processor by writing multiple versions of the data in a shared memory |
| CN102523054A (en) * | 2011-12-07 | 2012-06-27 | 清华大学 | Multiple Input Multiple Output (MIMO) detecting method |
| CN110825380A (en) * | 2019-09-30 | 2020-02-21 | 上海寒武纪信息科技有限公司 | Kernel function generation method, target code generation method and combined processing device |
| US20220198296A1 (en) * | 2020-12-23 | 2022-06-23 | EMC IP Holding Comnpany LLC | User context migration based on computation graph in artificial intelligence application executing in edge computing environment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113641701B (en) | Data query method, system, heterogeneous acceleration platform and storage medium | |
| CN113094125B (en) | Business process processing method, device, server and storage medium | |
| WO2021016475A1 (en) | Container orchestration framework | |
| CN102971688A (en) | Cross-platform application framework | |
| CN105677353A (en) | Feature extraction method, machine learning method and device thereof | |
| US20190087160A1 (en) | System and method for creating domain specific language | |
| CN112052000A (en) | Component multiplexing and rendering method and device | |
| CN114925591A (en) | An automatic parallel strategy search method and related equipment based on polyhedral model modeling | |
| US10509641B2 (en) | Optimizing feature deployment based on usage pattern | |
| JP2023553220A (en) | Process mining for multi-instance processes | |
| CN108845844A (en) | A kind of state transition method and device | |
| WO2020015087A1 (en) | Method and system for large-scale processing of images, computer device, and computer storage medium | |
| JP7589260B2 (en) | Method and apparatus for processing information - Patents.com | |
| CN112882698A (en) | Development environment generation method and device, computer storage medium and electronic device | |
| CN118013376B (en) | RPA multi-task multi-label classification method, equipment and medium based on knowledge graph | |
| CN114201729A (en) | Method, device and equipment for selecting matrix operation mode and storage medium | |
| CN116756555A (en) | A method for generating a training model tool, a model training method and a device | |
| CN104424525B (en) | Auxiliary is identified project the method and apparatus of scope | |
| CN117724815A (en) | Task processing method, device, storage medium and processor | |
| CN116701144A (en) | Performance analysis method, device, storage medium and program product | |
| CN113971074B (en) | Transaction processing method, transaction processing device, electronic equipment and computer readable storage medium | |
| CN114330732B (en) | Quantum computation-based multitasking asynchronous scheduling method, device and medium | |
| US8495033B2 (en) | Data processing | |
| CN114741294A (en) | Page debugging method, device, equipment and storage medium | |
| WO2021176982A1 (en) | Display method, control program, and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |