CN116756555A - Method for generating training model tool, model training method and device - Google Patents

Method for generating training model tool, model training method and device Download PDF

Info

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
model
parameter
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
Application number
CN202310084557.7A
Other languages
Chinese (zh)
Inventor
李学峰
刘兆涵
杨健
方磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zetyun Tech Co ltd
Original Assignee
Beijing Zetyun Tech Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Zetyun Tech Co ltd filed Critical Beijing Zetyun Tech Co ltd
Priority to CN202310084557.7A priority Critical patent/CN116756555A/en
Publication of CN116756555A publication Critical patent/CN116756555A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/15Correlation function computation including computation of convolution operations
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy 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

The application discloses a generation method of a training model tool, a model training method and a model training device, and belongs to the technical field of computers. The method comprises the following steps: acquiring a first function from a first function library, and acquiring a second function which has the same function as the first function from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU; acquiring first parameter information of a first function and second parameter information of a second function; generating 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; generating a base function according to the adjusted first function and the adjusted second function; and obtaining a base function library tool according to the base function.

Description

Method for generating training model tool, model training method and device
Technical Field
The application belongs to the technical field of computers, and particularly relates to a method for generating a training model tool, a model training method and a model training device.
Background
With the development of society, the data volume is increasing at a annual doubling speed, and the need for realizing the acceleration of training of a machine learning model is also increasing.
In the related art, a central processing unit (Central Processing Unit, CPU) of a training terminal is generally used to process corresponding training data; the graphics processor (Graphics Processing Unit, GPU) of the training terminal is used for processing the corresponding training data, the GPU has higher data processing speed, the function of accelerating the training process is achieved, and the software tool kit required by the CPU and the GPU in operation can only process the respective corresponding training data types. Therefore, in the prior art, for realizing the same functional module, corresponding module codes for training data need to be written for a CPU or a GPU respectively, the code writing workload is large, and the labor cost is high.
Disclosure of Invention
The embodiment of the application aims to provide a generation method of a training model tool, a model training method and a device, which can solve the problems of large code writing workload and high labor cost of the existing model training method.
In a first aspect, an embodiment of the present application provides a method for generating a training model tool, where the method includes:
acquiring a first function from a first function library, and acquiring a second function which has the same function as the first function from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU;
acquiring first parameter information of a first function and second parameter information of a second function;
generating 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;
generating a base function according to the adjusted first function and the adjusted second function;
and obtaining a base function library tool according to the base function.
Optionally, the generating a parameter set according to the first parameter information and the second parameter information includes:
comparing the first parameter information with the second parameter information to obtain a comparison result;
and generating a parameter set 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: function name, number of parameters, and type of parameters.
Optionally, the generating a parameter set according to the comparison result, the first parameter information and the second parameter information includes:
if the comparison result is the same, the first parameter information or the second parameter information is used as a parameter set;
when the comparison results are different, acquiring one of the first parameter information and the second parameter information, which contains a larger number of parameters, as reference parameter information;
and obtaining the parameter set according to the reference parameter information.
Optionally, the adjusting the first function and the second function according to the parameter set includes:
and carrying out function parameter enhancement adjustment on the smaller parameter quantity included in the first function and the second function based on the parameter set.
Optionally, the method further comprises:
under the condition that the first function library does not comprise a first function corresponding to a second function, compiling and generating the first function corresponding to the second function according to second parameter information of the second function; or alternatively, the process may be performed,
and compiling and generating a second function corresponding to the first function according to the first parameter information of the first function under the condition that the second function library does not comprise the second function corresponding to the first function.
In a second aspect, an embodiment of the present application provides a model training method, where the method includes:
responding to the model training task, acquiring training data and configuration information of a model training workflow;
invoking a base function associated with the model training workflow according to the configuration information, wherein the base function is configured as the base function of the first aspect;
and carrying out iterative training on the model through the basis functions and the training data.
Optionally, the performing iterative training on the model through the basis function and the training data includes:
determining a called target operation resource according to the data type of the training data, wherein the target operation resource comprises a CPU resource or a GPU resource;
and calling the target operation resource based on the basis function to perform iterative training on the model.
In a third aspect, an embodiment of the present application provides a tool generating apparatus for training a model, the apparatus comprising:
the first acquisition module is used for acquiring a first function from a first function library and acquiring a second function with the same function as the first function from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU;
the second acquisition module is used for acquiring the first parameter information of the first function and the second parameter information of the second function;
the first generation module is used for generating a parameter set according to the first parameter information and the second parameter information;
the adjusting module is used for adjusting the first function and/or the second function according to the parameter set;
the second generation module is used for generating a base function according to the adjusted first function and the adjusted second function;
and the third generation module is used for obtaining a base function library tool according to the base function.
In a fourth aspect, an embodiment of the present application provides a model training apparatus, including:
the acquisition module is used for responding to the model training task and acquiring training data and configuration information of a model training workflow;
a calling module, configured to call a base function associated with the model training workflow according to the configuration information, where the base function is configured as the base function of the first aspect;
and the training module is used for carrying out iterative training on the model through the basis function and the training data.
In a fifth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory storing a program or instructions executable on the processor, the program or instructions implementing the steps of the method of generating a training model tool as described in the first aspect or the model training method as described in the second aspect when executed by the processor.
In a sixth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the steps of the method of generating a training model tool as described in the first aspect or the model training method as described in the second aspect.
In the embodiment of the application, the first parameter information and the second 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 the parameter set is generated by utilizing the first parameter information and the second parameter information, so that the first function and the second function are regulated by utilizing the parameter set, and the base function is obtained. According to the scheme, the functions running on the CPU and the functions running on the GPU are adjusted, so that the basic function library tool is abstracted, then when the CPU or the GPU is used for model automatic training, the first function or the second function is called through the basic function in the basic function library, and module codes for model training do not need to be written for the CPU and the GPU respectively, so that the repeated workload and cost are reduced, the problem of inconvenient conversion is avoided, and the efficiency is improved.
Drawings
FIG. 1 is a flow chart of a tool generation method for training a model according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a model training method according to an embodiment of the present application;
FIG. 3 is a schematic illustration of an application of a training model tool;
FIG. 4 is a schematic diagram of a tool generating device for training a model according to an embodiment of the present application
FIG. 5 is a schematic structural diagram of a model training device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The tool generating method for training the model provided by the embodiment of the application is described in detail through specific embodiments and application scenes thereof with reference to the accompanying drawings.
As shown in fig. 1, the model training method provided by the embodiment of the application includes the following steps:
step S11, a first function is obtained from a first function library, and a second function which is the same as the first function is obtained from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU.
In the model training process, an automatic machine learning framework can be built on a CPU or a GPU through an algorithm to realize a series of model training processes of automatically processing data cleaning, feature engineering, super-parameter optimization, model selection, model evaluation, model fusion and the like. The tool library and called functions used in model training on the CPU are different from those used in model training on the GPU. The CPU tool library mainly includes Pandas, numpy and Scikit-learn. The GPU tool library mainly comprises cuDF (data processing library), cuPY (matrix math library) and cuML (machine learning library), and is provided with an application program interface (Application Program Interface, API) similar to the CPU tool library.
And selecting a first function to be called in the model training process from the CPU tool library, wherein the first function is contained in the first function library. And selecting a second function to be called in the model training process from the GPU tool library, wherein the second function is contained in the second function library. The first function and the second function having the same function are corresponding.
Step S12, acquiring first parameter information of a first function and second parameter information of a second function.
The first parameter information includes a function interface and a function of the first function, and similarly, the second parameter information includes a function interface and a function of the second function.
And step S13, generating a parameter set according to the first parameter information and the second parameter information.
The parameter set comprises first parameter information corresponding to all first functions in the first function library, namely function interfaces and function functions corresponding to the first functions, and similarly, the parameter set also comprises second function information corresponding to all second functions in the second function library.
And comparing the corresponding first parameter information with the corresponding second parameter information aiming at a pair of first functions and second functions with the same functions, wherein 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 modified. 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.
Step S14, according to the parameter set, the first function and/or the second function are/is adjusted.
It can be understood that, after 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 correspondingly adjusted, so that the adjusted first parameter information of the target first function is consistent with the target first parameter information or the adjusted second parameter information of the target second function is consistent with the target second parameter information.
Step S15, generating a base function according to the adjusted first function and the adjusted second function.
After adjustment, the first parameter information and the second parameter information of the first function and the second function with the same function of each pair are the same, namely the function interfaces are the same, the first function and the second function with the same function and the same function interface of each pair are abstracted to form corresponding basic functions, and the basic functions are used for calling the corresponding first functions or second functions.
And S16, obtaining a base function library tool according to the base function.
The base function library tool comprises a plurality of base functions for calling the corresponding first functions or the corresponding second functions, so that the base function library tool can call the first functions on the first function library or call the second functions in the second function library.
To implement this function by adding, the process of generating the base function will be described by the following example, where the add () function is used by both the tool Pandas of the CPU and the tool base cuDF of the GPU, and the corresponding first function is Pandas.
The corresponding second function is cudf.dataframe.add (other, axis= 'columns', level=none, fill_value=none).
Abstracting a first function and a second function code for realizing addition to obtain a basic function of a unified interface:
basetoolbox.DataFrame.add(other,axis='columns',level=None,fill_value=None)。
it should be noted that each base function includes a corresponding function.
Through the 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 a parameter set is generated by utilizing the first parameter information and the second parameter information, so that the first function and the second function are adjusted by utilizing the parameter set, and the base function is obtained. According to the scheme, the functions running on the CPU and the functions running on the GPU are adjusted, so that the basic function library tool is abstracted, then when the CPU or the GPU is used for model automatic training, the first function or the second function is called through the basic function in the basic function library tool, module codes for model training do not need to be written for the CPU and the GPU respectively, the repeated workload and cost are reduced, the problem of inconvenient conversion is avoided, and the efficiency is improved.
Optionally, the generating a parameter set according to the first parameter information and the second parameter information includes:
comparing the first parameter information with the second parameter information to obtain a comparison result;
and generating a parameter set according to the comparison result, the first parameter information and the second parameter information.
Comparing the first parameter information and the second parameter information of a pair of first functions and second functions with the same function to obtain a comparison result, and judging whether the first parameter information or the second parameter information needs to be modified according to the comparison result so that the first parameter information and the second parameter information of the first functions and the second functions with the same function of each pair are consistent, thereby ensuring that the base function library tool can accurately call the first functions and the second functions with the same function in the first function library and the second function library through the base functions.
Optionally, the first parameter information and/or the second parameter information includes at least one of: function name, number of parameters, and type of parameters.
The function name corresponds to the function of the function, facilitating the base function call. The number of parameters represents the number of parameters that the function can handle, and the type of parameters represents the type of data of the parameters that the function can handle. And comprehensively considering the function names, the parameter numbers and the parameter types to compare the first parameter information with the second parameter information, and adjusting the first parameter information and/or the second parameter information according to the comparison result, so that the first function and/or the second function are adjusted in the subsequent process, and further, the base function library tool is ensured to 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, the generating a parameter set according to the comparison result, the first parameter information and the second parameter information includes:
in case that the comparison result is the same, taking the first parameter information or the second parameter information as a parameter set,
under the condition that the comparison results are the same, namely when the function interfaces of a pair of first functions and second functions with the same function are the same, namely the number of parameters which can be processed by the functions, the data types of the parameters which can be processed and the names of the functions are the same, the adjustment of the first parameter information and the second parameter information is not needed, the adjustment of the first functions corresponding to the first parameter information and the second functions corresponding to the second parameter information is also not needed, the corresponding basic functions are directly generated, and in the subsequent model training process, the data processing can be completed only by calling the corresponding first functions in the first function library or the corresponding second functions in the second function library through the basic functions in the basic function library tool, and the re-writing of training module codes for the CPU and the GPU is not needed.
And under the condition that the comparison results are different, acquiring one of the first parameter information and the second parameter information, which contains a larger number of parameters, as reference parameter information, and obtaining the parameter set according to the reference parameter information.
And aiming at the condition that the comparison results are different for a pair of first functions and second functions with the same functions, namely, the first parameter information and the second parameter information of the pair of functions are different, namely, when the function interfaces are different, the first parameter information or the second parameter information is adjusted to generate a parameter set. Specifically, the function interfaces may be different numbers of parameters of function processing, different types of function data, or different names of functions. 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 reference parameter information, and the function interface of the first parameter information is added according to the reference parameter information; if the function interface parameters of the second parameter information are smaller than the function interface parameters of 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. And supplementing the party with the smaller number of parameters according to the reference parameter information, so that the function corresponding to the party with the smaller number of parameters can be conveniently adjusted according to the reference parameter information.
Optionally, the adjusting the first function and the second function according to the parameter set includes:
and carrying out function parameter enhancement adjustment on the smaller parameter quantity included in the first function and the second function based on the parameter set.
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, texts and the like, the second function is a function in cuML, 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 reference parameter information, and according to the reference parameter information, function interface parameters in the second parameter information of the second function need to be added, that is, function enhancement for performing tag coding on the function interface parameters in the second parameter information is required. When the text features appear, the text is identified by category, then the label is coded, and the digital label is used for replacing the text. The function functions and function interfaces of the first parameter information and the second parameter information after the function enhancement are consistent, so that the first function and the second function are convenient to abstract, and corresponding base functions are obtained to generate a base function library tool.
Optionally, the tool generating method for training a model provided by the embodiment of the present application further includes:
under the condition that the first function library does not comprise a first function corresponding to a second function, compiling and generating the first function corresponding to the second function according to second parameter information of the second function; or alternatively, the process may be performed,
and compiling and generating a second function corresponding to the first function according to the first parameter information of the first function under the condition that the second function library does not comprise the second function corresponding to the first function.
It should be noted that, because the software ecology supporting the CPU running is more mature than the software ecology supporting the GPU running, in general, the first functions in the first function library can implement more functions than the second functions in the second function library, so in most cases, each second function in the second function library can find the corresponding first function in the first function library, and the first function is not necessarily able to find the corresponding second function in the second function library, so that the corresponding second function needs to be compiled according to the first parameter information of the first function.
By describing the compiling process through the following example, some functions of the cuML only support processing of the target data, but do not support a main stream data format DataFrame of a machine learning algorithm, when the target first function is used for processing data in the DataFrame format, the cuML only supports processing of the target data, but does not have a second function corresponding to the target first function, so that only the algorithm logic corresponding to the first parameter information of the target first function can be referred to, the cuML is realized once again in a DataFrame manner in a GPU tool library, the target second function is generated to correspond to the target first function, and then the target base function is generated according to the target first function and the target second function, and each step in the model training process can be realized in a manner of calling the base function.
The embodiment of the application also provides a model training method, as shown in fig. 2, comprising the following steps:
step S21, in response to the model training task, training data and configuration information of a model training workflow are acquired.
The execution subject of the model training method can be a model training application, and the model training application can be loaded on a mobile phone, a computer and other equipment. Based on the model training task, the execution subject of the model training method responds, and training data and configuration information of the model training workflow are obtained. The general requirements of training data are: the data samples are as large as possible, the data are diversified, and the data sample quality is high. The configuration information comprises an operator module and an operation relation between operator models, and the operator models comprise: data cleaning, missing value processing, normalization processing, feature engineering, super-parameter optimization, model selection, model evaluation and model fusion. The training data and the configuration information are input into a model training application to perform full-flow automatic machine learning.
Step S22, calling a basic function associated with the model training workflow according to the configuration information, wherein the basic function is configured as the basic function in the production method of the training model tool,
and determining a base function associated with the model training workflow according to the configuration information, calling the base function with the data cleaning function if the training data is required to be subjected to data cleaning, and calling the first function and the second function of the corresponding functions in the first function library and the second function library through the base function.
And S23, performing iterative training on the model through the basis function and the training data.
According to the corresponding relation between the basic function and the first function and the corresponding relation between the basic function and the second 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, and training data can be processed to perform model training. Thus, both the CPU and GPU may be selected when processing the training data. The CPU is provided with a small amount of operation units with strong operation capability, and is suitable for small amount of computation with higher complexity. The GPU has hundreds of cores, can perform a large amount of parallel computation, and has a computation speed far higher than that of the CPU, but has lower complexity of the operational logic capable of being processed. When the training data is processed, the first function is reasonably selected to be called for processing on the CPU or the second function is reasonably selected to be called for processing on the GPU according to the arithmetic logic and the data volume required by the training step. Through the calling of the basic function and the calling of the first function or the second function corresponding to the basic function, the CPU and the GPU can complete the training task of full-flow automatic machine learning. In addition, due to the characteristics of the GPU, in general, the speed performance of the GPU is better than that of the CPU, and the larger the data size of the training data is, the more obvious the acceleration advantage of the GPU is.
Optionally, the performing iterative training on the model through the basis function and the training data includes:
determining a called target operation resource according to the data type of the training data, wherein the target operation resource comprises a CPU resource or a GPU resource;
and calling the target operation resource based on the basis function to perform iterative training on the model.
It can be appreciated that when the data type of the training data is a type more suitable for processing by the CPU, the first function is called by the base function to perform training on the CPU; when the data type of the training data is more suitable for GPU processing, a second function is called through the basic function, and training is carried out on the GPU.
As shown in fig. 3, is a schematic diagram of an application of a training model tool. And the training data set is input, and training of the automatic machine learning model can be completed by inputting training data set data train. The model training application comprises a base function library, i.e. the abstraction layer shown in fig. 3, which is also called base function library tool (BaseToolbox), which can identify the data type of the training set data, which is determined by the adjusted first function and by the adjusted second function together. The application also includes a tool kit including a CPU function library CPU toolbox, i.e., a first function library, and a GPU function library gputolbox, i.e., a second function library. And after determining the basic functions of the corresponding functions according to the training set data and the configuration information of the model training workflow, the basic function library tool selectively calls a first function in the CPU function library or a second function in the GPU function library according to the identified data type of the training set data. For example, when the training set data is in the format of a cuDF DaraFrame supported by the GPU, a second function is invoked in the GPU function library and an automatic machine learning model training procedure is performed in the GPU.
The model training can be performed by using the CPU or the GPU, the model training is more flexible to use, the CPU or the GPU is determined to be used according to the data type of the training data, and the stability of the model training process is further ensured.
According to the training model tool generating method provided by the embodiment of the application, the execution main body can be a generating device of the training model tool.
In the embodiment of the present application, taking an example of a method for generating a training model tool by using a generating device for training model tools as a generating device for training model tools, fig. 4 is used to describe a generating device 400 for training model tools according to the embodiment of the present application. The training model tool generating device 400 includes:
a first obtaining module 401, configured to obtain a first function from a first function library, and obtain a second function that is the same as the first function from a second function library, where the first function is a function running on a CPU, and the second function is a function running on a GPU;
a second obtaining module 402, configured to obtain first parameter information of a first function and second parameter information of a second function;
a first generating module 403, configured to generate a parameter set according to the first parameter information and the second parameter information;
an adjustment module 404, configured to adjust the first function and/or the second function according to the parameter set;
a second generating module 405, configured to generate a base function according to the adjusted first function and the adjusted second function;
and a third generating module 406, configured to obtain a base function library tool according to the base function.
Optionally, the first generating module 403 is further configured to:
comparing the first parameter information with the second parameter information to obtain a comparison result;
and generating a parameter set 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: function name, number of parameters, and type of parameters.
Optionally, the first generating module 403 is further configured to:
if the comparison result is the same, the first parameter information or the second parameter information is used as a parameter set;
when the comparison results are different, acquiring one of the first parameter information and the second parameter information, which contains a larger number of parameters, as reference parameter information;
and obtaining the parameter set according to the reference parameter information.
Optionally, the adjustment module 404 is further configured to:
and carrying out function parameter enhancement adjustment on the smaller parameter quantity included in the first function and the second function based on the parameter set.
Optionally, the tool generating device 400 for training a model further comprises a compiling module for:
under the condition that the first function library does not comprise a first function corresponding to a second function, compiling and generating the first function corresponding to the second function according to second parameter information of the second function; or alternatively, the process may be performed,
and compiling and generating a second function corresponding to the first function according to the first parameter information of the first function under the condition that the second function library does not comprise the second function corresponding to the first function.
The tool generating device for training the model can generate a corresponding base function library tool according to the first function in the first function library and the second function in the second function library, and call the corresponding first function or second function through the base function in the base function library tool.
It should be noted that, the tool generating device for training a model provided by the embodiment of the present application can implement all the technical processes of the tool generating method for training a model, and can achieve the same technical effects, so that repetition is avoided and no further description is provided here.
According to the model training method provided by the embodiment of the application, the execution subject can be a model training device. In the embodiment of the present application, a model training device is taken as an example to execute a model training method, and a model training device 500 provided by the embodiment of the present application is described with reference to fig. 5. The model training apparatus includes:
an obtaining module 501, configured to obtain training data and configuration information of a model training workflow in response to a model training task;
a calling module 502, configured to call a base function associated with the model training workflow according to the configuration information, where the base function is configured as the base function in the method for generating the training model tool;
and the training module 503 is configured to perform iterative training on the model through the basis function and the training data.
Optionally, the training module 503 is further configured to:
determining a called target operation resource according to the data type of the training data, wherein the target operation resource comprises a CPU resource or a GPU resource;
and calling the target operation resource based on the basis function to perform iterative training on the model.
The model training apparatus 500 may invoke a corresponding first function or a corresponding second function on the CPU or the GPU according to the base function and the training data to perform full-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 model training method, and can achieve the same technical effects, so that repetition is avoided, and no description is repeated here.
The device in the embodiment of the application can 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 may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile internet appliance (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a Television (TV), a teller machine, a self-service machine, etc., without limitation in the embodiments of the present application.
Optionally, as shown in fig. 5, the embodiment of the present application further provides an electronic device 600, including a processor 601 and a memory 602, where the memory 602 stores a program or an instruction that can be executed on the processor 601, and the program or the instruction implements each step of the foregoing method for generating a training model tool or the embodiment of the model training method when executed by the processor 601, and the steps achieve the same technical effects, so that repetition is avoided and redundant description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements the above-mentioned generating method of the training model tool or each process of the model training method embodiment, and can achieve the same technical effect, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods 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.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing is merely illustrative embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about variations or substitutions within the technical scope of the present application, and the application should be covered. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method of generating a training model tool, comprising:
acquiring a first function from a first function library, and acquiring a second function which has the same function as the first function from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU;
acquiring first parameter information of a first function and second parameter information of a second function;
generating 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;
generating a base function according to the adjusted first function and the adjusted second function;
and obtaining a base function library tool according to the base function.
2. The method of claim 1, wherein generating a parameter set from the first parameter information and the second parameter information comprises:
comparing the first parameter information with the second parameter information to obtain a comparison result;
and generating a parameter set according to the comparison result, the first parameter information and the second parameter information.
3. The method according to claim 2, wherein the first parameter information and/or the second parameter information comprises at least one of: function name, number of parameters, and type of parameters.
4. A method according to claim 3, wherein generating a parameter set from the comparison result, the first parameter information and the second parameter information comprises:
if the comparison result is the same, the first parameter information or the second parameter information is used as a parameter set;
when the comparison results are different, acquiring one of the first parameter information and the second parameter information, which contains a larger number of parameters, as reference parameter information;
and obtaining the parameter set according to the reference parameter information.
5. The method of claim 4, wherein adjusting the first function and the second function according to the set of parameters comprises:
and carrying out function parameter enhancement adjustment on the smaller parameter quantity included in the first function and the second function based on the parameter set.
6. The method according to claim 1, wherein the method further comprises:
under the condition that the first function library does not comprise a first function corresponding to a second function, compiling and generating the first function corresponding to the second function according to second parameter information of the second function; or alternatively, the process may be performed,
and compiling and generating a second function corresponding to the first function according to the first parameter information of the first function under the condition that the second function library does not comprise the second function corresponding to the first function.
7. A method of model training, comprising:
responding to the model training task, acquiring training data and configuration information of a model training workflow;
invoking a basis function associated with the model training workflow in accordance with the configuration information, wherein the basis function is configured as the basis function of any one of claims 1 to 6;
and carrying out iterative training on the model through the basis functions and the training data.
8. The method of claim 7, wherein the iteratively training the model by the basis function and the training data comprises:
determining a called target operation resource according to the data type of the training data, wherein the target operation resource comprises a CPU resource or a GPU resource;
and calling the target operation resource based on the basis function to perform iterative training on the model.
9. A device for generating a training model tool, the device comprising:
the first acquisition module is used for acquiring a first function from a first function library and acquiring a second function with the same function as the first function from a second function library, wherein the first function is a function running on a CPU, and the second function is a function running on a GPU;
the second acquisition module is used for acquiring the first parameter information of the first function and the second parameter information of the second function;
the first generation module is used for generating a parameter set according to the first parameter information and the second parameter information;
the adjusting module is used for adjusting the first function and/or the second function according to the parameter set;
the second generation module is used for generating a base function according to the adjusted first function and the adjusted second function;
and the third generation module is used for obtaining a base function library tool according to the base function.
10. A model training apparatus, the apparatus comprising:
the acquisition module is used for responding to the model training task and acquiring training data and configuration information of a model training workflow;
a calling module for calling a base function associated with the model training workflow according to the configuration information, wherein the base function is configured as the base function of any one of claims 1 to 6;
and the training module is used for carrying out iterative training on the model through the basis function and the training data.
CN202310084557.7A 2023-01-18 2023-01-18 Method for generating training model tool, model training method and device Pending CN116756555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310084557.7A CN116756555A (en) 2023-01-18 2023-01-18 Method for generating training model tool, model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310084557.7A CN116756555A (en) 2023-01-18 2023-01-18 Method for generating training model tool, model training method and 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 Method for generating training model tool, model training method and device

Country Status (1)

Country Link
CN (1) CN116756555A (en)

Similar Documents

Publication Publication Date Title
CN107577607B (en) User interface automatic testing method and device, electronic equipment and storage medium
CN110780853A (en) Front end framework, development method, storage medium and electronic device
CN112765023B (en) Test case generation method and device
US10387124B2 (en) System and method for creating domain specific language
CN105824974A (en) Method and system for analyzing and processing data
CN116028028A (en) Request function generation method, device, equipment and storage medium
CN114490116B (en) Data processing method and device, electronic equipment and storage medium
CN111290996A (en) Document format conversion method, device, equipment and readable storage medium
US20090241131A1 (en) Module interrogation
CN116756555A (en) Method for generating training model tool, model training method and device
US7506319B2 (en) Generating a model of software in execution
CN114357057A (en) Log analysis method and device, electronic equipment and computer readable storage medium
CN112612427A (en) Vehicle stop data processing method and device, storage medium and terminal
CN110928876A (en) Credit data storage method and device
CN111488286A (en) Method and device for independently developing Android module
CN113961279A (en) Page rendering method, device, server and storage medium
EP2782005A1 (en) Verifying state reachability in a statechart model having computer program code embedded therein
CN111126015B (en) Report form compiling method and equipment
CN114116877B (en) Data conversion method, device, computer equipment and medium
CN117075912B (en) Method for program language conversion, compiling method and related equipment
CN112035425B (en) Log storage method and device and computer system
CN111459576B (en) Data analysis processing system and model operation method
CN115292194B (en) Method for debugging flow, electronic equipment and computer readable storage medium
CN113190657B (en) NLP data preprocessing method, jvm and spark end server
CN117908866A (en) Visualization method and device for low-code platform, electronic equipment and medium

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