WO2020248440A1 - 一种机器学习方法与装置 - Google Patents
一种机器学习方法与装置 Download PDFInfo
- Publication number
- WO2020248440A1 WO2020248440A1 PCT/CN2019/108984 CN2019108984W WO2020248440A1 WO 2020248440 A1 WO2020248440 A1 WO 2020248440A1 CN 2019108984 W CN2019108984 W CN 2019108984W WO 2020248440 A1 WO2020248440 A1 WO 2020248440A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- utility
- optimal
- data
- optimal utility
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
Definitions
- the present invention relates to the field of machine learning, and more specifically, to a machine learning method and device, and a corresponding computer.
- the prior art uses AutoML (auto machine learning) to input sample data, and generates a machine learning model suitable for a specific task through a model generator.
- AutoML's machine learning model is based on traditional methods such as generating decision trees, but with the rise of deep learning, AutoML for neural network structures has gradually attracted attention.
- the core of this type of algorithm is to construct a neural network structure-oriented search space (Neural architecture space, NAS), and to find a model structure suitable for a specific task by optimizing the search strategy. Because the given tasks and sample data are different, this type of AutoML algorithm can only be constructed for specific tasks and cannot be generalized.
- the purpose of the embodiments of the present invention is to provide a machine learning method and device, which can build structural models for different generalized tasks or different types of tasks to perform automated machine learning, liberate labor, improve work efficiency, and reduce costs. .
- an aspect of the embodiments of the present invention provides a machine learning method, including the following steps:
- Step 1 Extract multiple sets of data, send each set of data to the corresponding model generator generated according to the network parameters, and generate corresponding multiple model codes;
- Step 2 Use a decoder to generate corresponding multiple utility models according to multiple model codes
- Step 3 In the first execution, use multiple sets of data to train multiple utility models one by one so that each utility model generates multiple error values; in at least the second execution, use multiple sets of data to train one by one Multiple utility models and optimal utility models, so that each utility model and optimal utility model generate multiple error values;
- Step 4 In the first execution, calculate based on multiple error values to update the network parameters and calculate the optimal utility model; in at least the second execution, iteratively calculate based on multiple error values to update the network parameters and the maximum Superior utility model;
- Step 5 Determine whether the predetermined learning end conditions are met, and output the optimal utility model when the predetermined learning end conditions are met, and use the network parameters and the optimal utility model to re-execute steps 1 to 4 when the predetermined learning end conditions are not met. .
- using multiple sets of data to train multiple utility models and optimal utility models one by one includes:
- the iterative calculation based on multiple error values to update the network parameters and the optimal utility model includes:
- updating the network parameters and the optimal utility model according to multiple profit functions includes:
- determining the computational complexity loss of each utility model and the optimal utility model includes:
- the indicator bit includes a normal position indicator bit, a reduced position indicator bit, and an empty layer indicator bit, and the normal position indicator bit and the reduced position indicator bit have the same or different calculation amount, and the empty layer indicator bit has zero calculation. the amount.
- the parallel processing method in the first execution, is used to execute step 1, step 2, and step 3 for multiple utility models at the same time; in at least the second execution, the parallel processing method is used for multiple utility models.
- the utility model and the optimal utility model execute steps one, two, and three simultaneously.
- the predetermined learning end condition includes at least one of the following: learning reaches a specified number of iterations; multiple model codes do not change within the specified number of iterations; and the profit function of the optimal utility model reaches a predetermined threshold.
- a machine learning device including:
- the memory stores a program code executable by the processor, and the program code executes the above-mentioned method when being executed.
- a computer including:
- Storage and computing unit clusters are set at the bottom of the computer to perform parallel computing tasks
- the multi-threaded distributed task scheduling module is set on the upper layer of the storage and computing unit cluster to receive parallel computing tasks and selectively send different parallel computing tasks to different storage and computing unit clusters according to configuration parameters. Unit to optimize computing performance;
- the interface module is set on the upper layer of the multi-threaded distributed task scheduling module. It encapsulates multiple deep learning frameworks that can be called to maintain the update and compatibility of the deep learning framework.
- the deep learning framework is used to classify and The training tasks are converted into parallel computing tasks and sent to the multi-threaded distributed task scheduling module;
- the model class is set on the upper layer of the interface module and includes a model generator group and a utility model group.
- the model generator group generates model codes according to the data samples, and the utility model group performs classification tasks on the data samples according to the model codes;
- the model training class is set in the upper layer of the interface module, including the model generator training group and the utility model training group.
- the model generator training group uses the backpropagation method to perform training tasks on the model generator group, and the utility model training group uses Reinforce the Q learning method to perform training tasks on the utility model group;
- the error calculation module is set in the upper layer of the model class and the model training class. According to the data sample classification and output of the utility model group, different types of methods are used to calculate various errors respectively, and an optimal utility is determined in the utility model group according to the error model;
- the output module is used to determine whether the predetermined learning end condition is satisfied, and output the current optimal utility model accordingly.
- the present invention has the following beneficial technical effects: the machine learning method and device provided by the embodiments of the present invention extract multiple sets of data, send each set of data to a corresponding model generator generated according to network parameters, and generate corresponding multiple sets of data.
- Model codes use decoders to generate corresponding multiple utility models according to multiple model codes; use multiple sets of data to train multiple utility models and optimal utility models one by one, so that each utility model and optimal utility model are generated Multiple error values; iterative calculation based on multiple error values to update the network parameters and optimal utility model; determine whether the predetermined learning end conditions are met, and output the optimal utility model when the predetermined learning end conditions are met, and when the predetermined learning end conditions are not met.
- the technical solution of using network parameters and optimal utility model to re-execute the above steps at the end of learning conditions can build structural models for different generalized tasks or different types of tasks for automated machine learning, and liberate labor through automated machine learning. Improve work efficiency and reduce costs.
- Fig. 1 is a schematic flow chart of the machine learning method provided by the present invention
- Figure 2 is a flow chart of iterative training of the machine learning method provided by the present invention.
- Figure 3 is a model output flow chart of the machine learning method provided by the present invention.
- Fig. 5 is a calculation complexity matrix diagram of the machine learning method provided by the present invention.
- Fig. 6 is a schematic diagram of parallel calculation of the machine learning method provided by the present invention.
- Figure 7 is a line chart of the learning effect of the machine learning method provided by the present invention.
- Fig. 8 is a hierarchical structure diagram of the computer provided by the present invention.
- the first aspect of the embodiments of the present invention proposes an embodiment of a machine learning method capable of constructing structural models for different generalized tasks or different types of tasks.
- Figure 1 shows a schematic flowchart of an embodiment of a machine learning method provided by the present invention.
- the machine learning method includes the following steps:
- Step S101 Extract multiple sets of data, send each set of data to a corresponding model generator generated according to network parameters, and generate corresponding multiple model codes;
- Step S103 using a decoder to generate corresponding multiple utility models respectively according to multiple model codes
- Step S105 in the first execution, use multiple sets of data to train multiple utility models one by one, so that each utility model generates multiple error values; in at least the second execution, use multiple sets of data to train one by one Multiple utility models and optimal utility models, so that each utility model and optimal utility model generate multiple error values;
- Step S107 In the first execution, calculate based on multiple error values to update the network parameters and calculate the optimal utility model; in at least the second execution, iteratively calculate based on the multiple error values to update the network parameters and the maximum Superior utility model;
- Step S109 Determine whether the predetermined learning end condition is met, and output the optimal utility model when the predetermined learning end condition is met, and use the network parameters and the optimal utility model to re-execute steps one to step four when the predetermined learning end condition is not met. .
- using multiple sets of data to train multiple utility models and optimal utility models one by one includes:
- the iterative calculation based on multiple error values to update the network parameters and the optimal utility model includes:
- updating the network parameters and the optimal utility model according to multiple profit functions includes:
- determining the computational complexity loss of each utility model and the optimal utility model includes:
- the indicator bit includes a normal position indicator bit, a reduced position indicator bit, and an empty layer indicator bit, and the normal position indicator bit and the reduced position indicator bit have the same or different calculation amount, and the empty layer indicator bit has zero calculation. the amount.
- the parallel processing method in the first execution, is used to execute step 1, step 2, and step 3 for multiple utility models at the same time; in at least the second execution, the parallel processing method is used for multiple utility models.
- the utility model and the optimal utility model execute steps one, two, and three simultaneously.
- the predetermined learning end condition includes at least one of the following: learning reaches a specified number of iterations; multiple model codes do not change within the specified number of iterations; and the profit function of the optimal utility model reaches a predetermined threshold.
- Model Decoder receives the model code and parses it into a utility model (ie, the aforementioned utility model, hereinafter referred to as UM) according to the decoding rules, and trains each UM with m sets of batch data.
- the embodiment of the present invention retains the model with the smallest loss (that is, the aforementioned error) value in the current UM (referred to as the Hb Model) in the next generation, and compares it with the model generated later.
- the MG with the best accuracy performance can be obtained by comprehensively calculating the loss value and loss total of UM.
- the accuracy loss is calculated using the following formula:
- ⁇ is the weight parameter.
- the embodiment of the present invention takes the complexity loss f of the model into consideration as a penalty function.
- the complexity loss consists of the following two parts:
- f comp represents the calculation amount of the UM generated by the current MG
- f cost represents the additional calculation amount that needs to be paid if other UMs are used.
- each MG can get a score under the given sample and parameter conditions.
- st (x sample , ⁇ ⁇ MG ⁇ )
- the embodiment of the present invention defines the Q value of learning from any UM (that is, generating the selected UM next time) under the current sample and MG model parameters:
- the reference model as the learning object i.e. the aforementioned optimal utility model
- the number of times the MG learns for each set of batch data epoch_MG can be set according to the training time of the UM to maximize the overlap of the model training time.
- loss H is used to train GM.
- the output of the last model is recorded as For the Kth completion of training, the loss total of the model corresponding to MG is:
- the computational complexity of a model is usually determined by the model code, and the model complexity can be specified as follows:
- Normal_cell is the aforementioned normal position indicator
- Reduce_cell is the aforementioned protocol position indicator
- Empty layer is the aforementioned empty layer indicator. The calculation is performed by multiple cells, and each cell has different computational complexity due to its different functions and operation modes. For the i-th UM, its computational complexity is:
- f comp, N and f comp, R can be specified in advance or calculated by Normal cell and Reduce cell.
- I in the above formula is the cell indicator bit.
- the current computational complexity of each UM can be calculated.
- the complexity loss is now:
- Figure 5 shows the f matrix at this time.
- the return function r is the return of each UM to the sample at time t.
- the Q matrix is a two-dimensional matrix in which the number of rows increases with time, and the number of columns is equal to the number of MGs+1 (one more Hb model).
- the embodiment of the present invention regards the reference model learning and the Q value as the reward of the MG, and uses the policy gradient method to update the probability of making different choices in the process of generating the cell of the MG.
- the core problem of updating MG parameters is to construct a reasonable loss function, and to increase the probability of generating an ideal UM by minimizing the loss function.
- the embodiment of the present invention regards the ideal MG as being able to maximize the expected benefit of the um model, namely:
- ⁇ I(t) represents the number of models where the t-th code of all UMs is the same as the t-th code of the k-th UM, that is, for the k-th model, the frequency of each bit of the same code in the batch is counted .
- the independent distribution assumption is adopted to approximate the joint probability distribution of the MG generated code.
- R k represents the reward obtained by the k-th MG.
- Figure 6 shows a schematic diagram of parallel computing.
- the MG receives the network parameters ⁇ c and the number of MGs L from the CPU, and uses the model parallel method to build L MGs with the same structure and different parameters in GPU0, sharing the same session. But the input and output do not interfere with each other.
- Each MG generates m UMs and calculates errors and rewards. For the m UMs created by each MG, after completing the calculation of m R values, they will be packaged and transferred to the Reward buffer.
- the CPU sequentially takes out the data packet from the reward buffer, calculates the parameter set ⁇ c of the MG corresponding to the data packet, and then updates the corresponding parameters.
- the parameters are updated iteratively as follows:
- the embodiment of the present invention adopts RNN (Circular Neural Network) as the GM, and the step size is 5, that is, 5 coded values are output every time to represent two inputs and respective operations, and the combination of the two inputs.
- the above five inputs are used as a group, and the five groups of outputs are repeated five times and merged into one cell.
- GM generates two different types of cells and codes for their stacking methods.
- the decoder will generate UM according to the preset coding rules. Since the data in the cifar-10 dataset is a color picture, the number of input channels needs to be forcibly modified to 3 for the first layer network that receives input data.
- the calculation of the loss value of UM adopts the cross entropy function (see formula (5)), the training adopts the error back propagation method, and the training process selects SGD (random steepest descent) as the optimizer.
- UM When UM has been trained for a specified epoch, the output of the last model is recorded as For the Kth completion of training, the model corresponding to MG Calculate according to formula (6); for the i-th UM, its calculation complexity can be calculated according to formula (8); according to formulas (7)(9)-(14), calculate the loss value corresponding to each MG; and use the formula (15) Update the corresponding parameters.
- Fig. 7 shows the error change of the MG when the reinforcement learning is used for 29 iterations, where each UM model undergoes 10 epoch training in each iteration. It can be seen from Figure 7 that the error is greatly reduced with the number of iterations.
- the machine learning method extracts multiple sets of data, sends each set of data to the corresponding model generator generated according to the network parameters, and generates corresponding multiple models Encoding; use the decoder to generate corresponding multiple utility models according to multiple model codes; use multiple sets of data to train multiple utility models and optimal utility models one by one, so that each utility model and optimal utility model generate multiple Error value; iteratively calculate based on multiple error values to update network parameters and optimal utility model; determine whether the predetermined learning end condition is met, and output the optimal utility model when the predetermined learning end condition is met, and when the predetermined learning is not met
- the technical solution of using the network parameters and the optimal utility model to re-execute the above steps at the end of the conditions can build structural models for different generalized tasks or different types of tasks for automated machine learning, and use automated machine learning to liberate labor and improve work Efficiency and cost reduction.
- the second aspect of the embodiments of the present invention proposes an embodiment of a machine learning device capable of constructing structural models for different tasks or different types of generalized tasks.
- the device includes:
- the memory stores a program code executable by the processor, and the program code executes the above-mentioned method when being executed.
- the program code also includes the following parts:
- the network structure search module is used to extract multiple sets of data, send each set of data to the corresponding model generator generated according to the network parameters, and generate corresponding multiple model codes;
- the decoding module is used to encode multiple models using a decoder to generate multiple corresponding utility models
- the calculation module is used to use multiple sets of data to train multiple utility models and the existing optimal utility model one by one, so that each utility model and the optimal utility model generate multiple error values, and iteratively calculate and update according to the multiple error values
- the network parameters and the updated optimal utility model are used, and the updated network parameters and updated optimal utility model are used to cover the existing network parameters and the existing optimal utility model. Call the network structure search module and the decoding module to perform the above steps again ;
- the machine learning device uses the above modules to execute the above method, and outputs the current optimal utility model when the predetermined learning end condition is satisfied.
- the machine learning device extracts multiple sets of data, sends each set of data to a corresponding model generator generated according to network parameters, and generates corresponding multiple models Encoding; use the decoder to generate corresponding multiple utility models according to multiple model codes; use multiple sets of data to train multiple utility models and optimal utility models one by one, so that each utility model and optimal utility model generate multiple Error value; iteratively calculate based on multiple error values to update network parameters and optimal utility model; determine whether the predetermined learning end condition is met, and output the optimal utility model when the predetermined learning end condition is met, and when the predetermined learning is not met
- the technical solution of using the network parameters and the optimal utility model to re-execute the above steps at the end of the conditions can build structural models for different generalized tasks or different types of tasks for automated machine learning, and use automated machine learning to liberate labor and improve work Efficiency and cost reduction.
- the embodiment of the machine learning device described above uses the embodiment of the machine learning method to specifically describe the working process of each module. Those skilled in the art can easily think of applying these modules to the machine learning. In other embodiments of the method. Of course, since the various steps in the embodiment of the machine learning method can be crossed, replaced, added, or deleted, these reasonable permutations and combinations should also belong to the protection scope of the present invention for the machine learning device. And the protection scope of the present invention should not be limited to the embodiments.
- the third aspect of the embodiment of the present invention proposes an embodiment of a computer capable of constructing a structural model for different tasks or different types of generalized tasks.
- the computer includes:
- Storage and computing unit clusters are set at the bottom of the computer to perform parallel computing tasks
- the multi-threaded distributed task scheduling module is set on the upper layer of the storage and computing unit cluster to receive parallel computing tasks and selectively send different parallel computing tasks to different storage and computing unit clusters according to configuration parameters. Unit to optimize computing performance;
- the interface module is set on the upper layer of the multi-threaded distributed task scheduling module. It encapsulates multiple deep learning frameworks that can be called to maintain the update and compatibility of the deep learning framework.
- the deep learning framework is used to classify and The training tasks are converted into parallel computing tasks and sent to the multi-threaded distributed task scheduling module;
- the model class is set on the upper layer of the interface module and includes a model generator group and a utility model group.
- the model generator group generates model codes according to the data samples, and the utility model group performs classification tasks on the data samples according to the model codes;
- the model training class is set in the upper layer of the interface module, including the model generator training group and the utility model training group.
- the model generator training group uses the backpropagation method to perform training tasks on the model generator group, and the utility model training group uses Reinforce the Q learning method to perform training tasks on the utility model group;
- the error calculation module is set in the upper layer of the model class and the model training class. According to the data sample classification and output of the utility model group, different types of methods are used to calculate various errors respectively, and an optimal utility is determined in the utility model group according to the error model;
- the output module is used to determine whether the predetermined learning end condition is satisfied, and output the current optimal utility model accordingly.
- the hardware or virtual resources of the computer's underlying storage and computing resources have task scheduling modules built on them.
- the task scheduling module is responsible for receiving parallel computing tasks and assigning them to the underlying computing resources based on the given parameter settings.
- the task scheduling module is responsible for optimizing computing performance.
- the embodiment of the present invention uses an interface module to encapsulate the used operations. All subsequent operations used are implemented using encapsulated functions.
- the rewritten layer operation is used to construct the model class.
- the model class There are two derivations of the model class. Two derivations inherit the basic attributes and methods of the model class (such as the number of model parameters, model graph drawing, super parameter list, reasoning training method, etc.), one is GM, which receives input samples to generate model Code and Cell; the other is UM, which receives input Model Code and samples to build a model to complete a given classification task.
- the model code is used to construct UM, and the sample is used to train UM.
- MG and UM need to be trained, but because MG needs to be trained using the R-QL (reinforced Q-learning) method, and UM is trained using the BP (back propagation) method, the embodiment of the present invention constructs a model training class to include different training methods , And instantiate different trainers.
- the input data of the optimizer is the final calculated loss value.
- the loss value calculation is separately constructed as a module, and different loss calculation methods (such as cross entropy, mean square error, etc.) and the definition of loss (such as the probability of generating a specified reference model in enhanced Q learning) are encapsulated in it.
- the error calculation module receives the output of UM and the label of the sample and calculates loss, loss total and Q value. Among them, loss is used to train UM. When the model reaches the training times specified in the search process, loss will be used to calculate loss total and Q. The latter two are used to update the MG.
- the computer provided by the embodiment of the present invention extracts multiple sets of data, sends each set of data to a corresponding model generator generated according to network parameters, and generates corresponding multiple model codes;
- Use decoders to generate corresponding multiple utility models according to multiple model codes; use multiple sets of data to train multiple utility models and optimal utility models one by one, so that each utility model and optimal utility model generate multiple error values Calculate iteratively according to multiple error values to update the network parameters and the optimal utility model; determine whether the predetermined learning end conditions are met, and output the optimal utility model when the predetermined learning end conditions are met, and when the predetermined learning end conditions are not met
- the technical solution of using network parameters and optimal utility models to re-execute the above steps can build structural models for different general tasks or different types of tasks for automated machine learning, and use automated machine learning to free labor and improve work efficiency. cut costs.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Medical Informatics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种机器学习方法与装置,包括:通过抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;使用解码器根据多个模型编码分别生成相应的多个效用模型;使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;根据多个误差值迭代计算以更新网络参数和最优效用模型;判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行上述步骤的技术方案,能够解放人工,提高工作效率,降低成本。
Description
本申请要求于2019年6月13日提交中国专利局、申请号为201910511173.2、发明名称为“一种机器学习方法与装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及机器学习领域,并且更具体地,特别是涉及一种机器学习方法与装置,以及相应的计算机。
基于神经网络的人工智能算法在人工智能技术兴起后吸引了众多学者和产业应用的兴趣。然而,由于实际生产生活中面临的任务不尽相同,针对不同的任务目前需要人为地设计解决问题用的模型和算法。另一方面,深度神经网络、卷积网络等神经网络结构因在各项任务中的突出表现而引起了学界和工业界的浓厚兴趣。但是,面向网络结构搜索的自动机器学习算法由于计算量庞大,系统设计复杂,始终限制了这一技术在算法研究人员和算法工程师中的普及和应用。
现有技术使用AutoML(auto machine learning)来输入样本数据,通过模型生成器生成适用于特定任务的机器学习模型。AutoML的机器学习模型以生成决策树等传统手段为主,但随着深度学习的兴起,面向神经网络结构的AutoML开始逐渐受到关注。此类算法的核心是构造面向神经网络结构的搜索空间(Neural architecture space,NAS),通过优化搜索策略寻找适用于特定任务的模型结构。由于所给定的任务和样本数据不同,这一类AutoML算法只能针对特定任务进行构建而不能一般化。
针对现有技术中针对神经网络结构的AutoML使用的人工设计方式耗时高、依赖个人经验、而自动化机器学习方法效率低耗时长的问题,目前尚未有有效的解决方案。
发明内容
有鉴于此,本发明实施例的目的在于提出一种机器学习方法与装置,能够针对一般化的不同任务或不同类型的任务构建结构模型来进行自动化机器学习,解放人工,提高工作效率,降低成本。
基于上述目的,本发明实施例的一方面提供了一种机器学习方法,包括以下步骤:
步骤一:抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;
步骤二:使用解码器根据多个模型编码分别生成相应的多个效用模型;
步骤三:在第一次执行时,使用多组数据一一训练多个效用模型,使每个效用模型均生成多个误差值;在至少是第二次执行时,使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;
步骤四:在第一次执行时,根据多个误差值计算以更新网络参数,并计算最优效用模型;在至少是第二次执行时,根据多个误差值迭代计算以更新网络参数和最优效用模型;
步骤五:判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行步骤一至步骤四。
在一些实施方式中,使用多组数据一一训练多个效用模型和最优效用模型包括:
将多组数据一一输入多个效用模型和最优效用模型,获得多个预测输出;
根据多个预测输出和由用户指定的与其相对应的样本标签确定交叉熵损失函数;
使用交叉熵损失函数来训练多个效用模型和最优效用模型。
在一些实施方式中,根据多个误差值迭代计算以更新网络参数和最优效用模型包括:
根据多个误差值确定每个效用模型和最优效用模型的总体误差;
根据多个误差值和多个总体误差确定每个效用模型和最优效用模型的 精度损失;
根据多个精度损失确定每个效用模型和最优效用模型相对于多组数据的收益函数;
根据多个收益函数更新网络参数和最优效用模型。
在一些实施方式中,根据多个收益函数更新网络参数和最优效用模型包括:
确定每个效用模型和最优效用模型的计算复杂度损失;
根据多个计算复杂度损失和多个收益函数确定每个效用模型和最优效用模型的强化学习损失;
根据多个强化学习损失更新网络参数;
根据多个计算复杂度损失和多个收益函数确定每个效用模型和最优效用模型的辅助矩阵;
根据多个辅助矩阵和多个收益函数确定每个效用模型和最优效用模型的偏移值;
根据多个偏移值更新最优效用模型。
在一些实施方式中,确定每个效用模型和最优效用模型的计算复杂度损失包括:
根据与每个效用模型和最优效用模型相对应的多个模型编码的各指示位数量和计算量分别确定每个效用模型和最优效用模型的当前计算量;
根据多个当前计算量确定每个效用模型和最优效用模型的额外计算量;
根据多个当前计算量和多个额外计算量确定每个效用模型和最优效用模型的计算复杂度损失。
在一些实施方式中,指示位包括通常位置指示位、规约位置指示位、和空层指示位,并且通常位置指示位和规约位置指示位具有相同或不同的计算量,空层指示位具有零计算量。
在一些实施方式中,在第一次执行时,使用并行处理方法针对多个效用模型同时执行步骤一、步骤二、和步骤三;在至少是第二次执行时,使用并行处理方法针对多个效用模型和最优效用模型同时执行步骤一、步骤 二、和步骤三。
在一些实施方式中,预定的学习结束条件包括以下至少之一:学习达到指定的迭代次数;多个模型编码在指定的迭代次数内不发生改变;最优效用模型的收益函数达到预定阈值。
基于上述目的,本发明实施例的另一方面提供了一种机器学习装置,包括:
处理器;和
存储器,存储有处理器可运行的程序代码,所述程序代码在被运行时执行上述的方法。
基于上述目的,本发明实施例的另一方面提供了一种计算机,包括:
存储和计算单元集群,设置于计算机底层,用于执行并行计算任务;
多线程分布式任务调度模块,设置于存储和计算单元集群的上一层,用于接收并行计算任务,并根据配置参数将不同的并行计算任务选择性地下发到存储和计算单元集群中的不同单元以优化计算性能;
接口模块,设置于多线程分布式任务调度模块的上一层,封装有多个可被调用的深度学习框架,用于维护深度学习框架的更新和兼容性,其中深度学习框架用于将分类和训练任务转化为并行计算任务并下发到多线程分布式任务调度模块;
模型类,设置于接口模块的上一层,包括模型生成器组和效用模型组,其中模型生成器组根据数据样本生成模型编码,效用模型组根据模型编码来对数据样本执行分类任务;
模型训练类,设置于接口模块的上一层,包括模型生成器训练组和效用模型训练组,其中模型生成器训练组使用反向传播方法对模型生成器组执行训练任务,效用模型训练组使用强化Q学习方法对效用模型组执行训练任务;
误差计算模块,设置于模型类和模型训练类的上一层,根据效用模型组的数据样本分类输出使用不同类型的方法分别计算多种误差,并根据误差在效用模型组中确定一个最优效用模型;
输出模块,用于判断是否满足预定的学习结束条件,并据此输出当前 的所述最优效用模型。
本发明具有以下有益技术效果:本发明实施例提供的机器学习方法与装置,通过抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;使用解码器根据多个模型编码分别生成相应的多个效用模型;使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;根据多个误差值迭代计算以更新网络参数和最优效用模型;判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行上述步骤的技术方案,能够针对一般化的不同任务或不同类型的任务构建结构模型来进行自动化机器学习,通过自动化机器学习来解放人工,提高工作效率,降低成本。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的实施例。
图1为本发明提供的机器学习方法的流程示意图;
图2为本发明提供的机器学习方法的迭代训练流程图;
图3为本发明提供的机器学习方法的模型输出流程图;
图4为本发明提供的机器学习方法的误差计算示意图;
图5为本发明提供的机器学习方法的计算复杂度矩阵图;
图6为本发明提供的机器学习方法的并行计算示意图;
图7为本发明提供的机器学习方法的学习效果折线图;
图8为本发明提供的计算机的层级结构图。
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明实施例进一步详细说明。
需要说明的是,本发明实施例中所有使用“第一”和“第二”的表述均是为了区分两个相同名称非相同的实体或者非相同的参量,可见“第一”、“第二”仅为了表述的方便,不应理解为对本发明实施例的限定,后续实施例对此不再一一说明。
基于上述目的,本发明实施例的第一个方面,提出了一种能够针对一般化的不同任务或不同类型的任务构建结构模型的机器学习方法的实施例。图1示出的是本发明提供的机器学习方法的实施例的流程示意图。
所述机器学习方法,包括以下步骤:
步骤S101,抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;
步骤S103,使用解码器根据多个模型编码分别生成相应的多个效用模型;
步骤S105,在第一次执行时,使用多组数据一一训练多个效用模型,使每个效用模型均生成多个误差值;在至少是第二次执行时,使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;
步骤S107,在第一次执行时,根据多个误差值计算以更新网络参数,并计算最优效用模型;在至少是第二次执行时,根据多个误差值迭代计算以更新网络参数和最优效用模型;
步骤S109,判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行步骤一至步骤四。
在一些实施方式中,使用多组数据一一训练多个效用模型和最优效用模型包括:
将多组数据一一输入多个效用模型和最优效用模型,获得多个预测输出;
根据多个预测输出和由用户指定的与其相对应的样本标签确定交叉熵 损失函数;
使用交叉熵损失函数来训练多个效用模型和最优效用模型。
在一些实施方式中,根据多个误差值迭代计算以更新网络参数和最优效用模型包括:
根据多个误差值确定每个效用模型和最优效用模型的总体误差;
根据多个误差值和多个总体误差确定每个效用模型和最优效用模型的精度损失;
根据多个精度损失确定每个效用模型和最优效用模型相对于多组数据的收益函数;
根据多个收益函数更新网络参数和最优效用模型。
在一些实施方式中,根据多个收益函数更新网络参数和最优效用模型包括:
确定每个效用模型和最优效用模型的计算复杂度损失;
根据多个计算复杂度损失和多个收益函数确定每个效用模型和最优效用模型的强化学习损失;
根据多个强化学习损失更新网络参数;
根据多个计算复杂度损失和多个收益函数确定每个效用模型和最优效用模型的辅助矩阵;
根据多个辅助矩阵和多个收益函数确定每个效用模型和最优效用模型的偏移值;
根据多个偏移值更新最优效用模型。
在一些实施方式中,确定每个效用模型和最优效用模型的计算复杂度损失包括:
根据与每个效用模型和最优效用模型相对应的多个模型编码的各指示位数量和计算量分别确定每个效用模型和最优效用模型的当前计算量;
根据多个当前计算量确定每个效用模型和最优效用模型的额外计算量;
根据多个当前计算量和多个额外计算量确定每个效用模型和最优效用模型的计算复杂度损失。
在一些实施方式中,指示位包括通常位置指示位、规约位置指示位、和空层指示位,并且通常位置指示位和规约位置指示位具有相同或不同的计算量,空层指示位具有零计算量。
在一些实施方式中,在第一次执行时,使用并行处理方法针对多个效用模型同时执行步骤一、步骤二、和步骤三;在至少是第二次执行时,使用并行处理方法针对多个效用模型和最优效用模型同时执行步骤一、步骤二、和步骤三。
在一些实施方式中,预定的学习结束条件包括以下至少之一:学习达到指定的迭代次数;多个模型编码在指定的迭代次数内不发生改变;最优效用模型的收益函数达到预定阈值。
下面根据具体实施例进一步阐述本发明的详细实施方式。
本发明实施例的迭代训练流程参见图2。首先,抽取m组Batch数据(即前述的数据组),将m组Batch数据分别送入m个Model Generator(即前述的模型生成器,以下简称MG)中,每个MG输出一个model code(即前述的模型编码)。Model Decoder(即前述的解码器)接收model code后按照解码规则将其解析为一个utility model(即前述的效用模型,以下简称UM),用m组Batch数据训练每一个UM。为了保证MG的学习收敛性,本发明实施例将当前UM中loss(即前述的误差)值最小的一个模型(被称为Hb Model)保留到下一代中,与之后生成的模型做比较。
Batch数据经过所有UM后会产生m个loss值。考虑到每个模型每次仅采用了一批采样数据进行训练,为了保持模型对整体样本集的适用性,本发明实施例需要对模型的loss值进行累计,得到loss
total。由于每一次采样后,MG生成的UM不同,因此这个loss
total表征的不是UM而是所对应的MG的性能。
通过综合计算UM的loss值和loss
total可以得到具有最好精度性能的MG。精度损失采用如下公式计算:
Acc=λ·loss+(1-λ)loss
total (1)
其中λ是权重参数,精度损失越小则则对应的模型越理想。为了平衡计算精度和计算负载,本发明实施例将模型的复杂度损失f作为惩罚函数纳 入考量。复杂度损失包含以下两个部分:
f=f
comp+f
cost (2)
其中,f
comp表示当前MG所生成UM的计算量,f
cost表示如果采用其他UM,所需要额外付出的计算量。综合上述精度和计算性能指标,每个MG在给定的样本和参数条件下,都可以得到一个评分。为了方便表述,本发明实施例对任意一个MG,令s
t:(x
sample,θ
{MG}),a:utility model,并且使用r
t+1表示采用该UM所得到的收益,其数值与各个模型的loss和loss
total成反比,由此得f
cost=f
comp(a
t+1)-f
comp。基于上述符号系统,本发明实施例定义再当前样本和MG模型参数下,向任意UM学习(即下一次生成所选的UM)的Q值为:
O(s
{t+1},a
t)=r
{t+1}(s
{t+1},a
t)-f(a
t) (3)
Q值越大则对应的模型越理想。其中,O为观测矩阵,表示在t+1时刻采用t时刻的模型进行预测所获得的收益和代价。对第i个MG可以确定作为学习对象的参考模型(即前述的最优效用模型)
在对应的样本输入下,每个MG分别学习自己对应的参考模型,MG对每一组batch数据的学习次数epoch_MG可根据UM的训练时间来设定以最大限度保证模型训练时间重叠。
处理完所有样本数据称为完成了一次搜索。当搜索次数达到用户指定的次数上限,或最后一批数据经过MG所产生的Model code在指定的学习代数内不发生改变时AutoML学习结束,如图3所示地输出经过解码和预训练后的r值最高的UM。也可以选择继续对返回的UM进行进一步训练。
关于精度损失和复杂度损失的详细计算方法参见以下实施例。
应注意上式是迭代更新公式而不是等式。此时精度损失为:
需要注意,应先计算Acc的值,然后迭代更新loss
total;K=1时,loss
total取0。
模型的计算复杂度通常由model code决定,模型复杂度可规定如下:
Normal_cell即前述的通常位置指示位,Reduce_cell即前述的规约位置指示位,Empty layer即前述的空层指示位。计算由多个cell执行,每个cell因其功能与运算方式不同而具有不同的计算复杂度。对于第i个UM,其计算复杂度为:
f
comp=ΣI
Nf
comp,N+ΣI
Rf
comp,R (8)
其中f
comp,N和f
comp,R可以提前指定或由Normal cell和Reduce cell计算 求得。上式中的I为cell指示位。根据上式可以计算出每一个UM当前的计算复杂度,则对于模型i,复杂度损失此时为:
图5示出的是此时的f矩阵。
关于网络参数更新的详细计算方法参见以下实施例。
首先,基于精度损失定义收益函数r:
收益函数r为在t时刻各UM对样本 的收益。Q矩阵为行数随时间增长的二维矩阵,其列数等于MG的数量+1(多一个Hb模型)。为了更新MG的参数,本发明实施例将参考模型学习和Q值看作MG的奖励,并采用策略梯度法更新MG生成cell过程中做出不同选择的概率。
更新MG参数的核心问题是构建合理的损失函数,并通过最小化损失函数提高生成理想的UM的概率。本发明实施例把理想的MG视为能够最大化um模型的期望收益,即:
其中m表示用于训练MG的一个batch中UM的数量,T表示UMde编码长度。上式中,ΣI(t)表示对于所有UM的第t位编码与第k个UM的 第t位编码相同的模型数量,即对第k个模型统计每一位在batch中出现相同编码的频率。本发明实施例采用独立分布假设对MG生成编码的联合概率分布进行近似。R
k表示第k个MG获得的奖励,使用观测矩阵带入R
k,则上式可以改写为:
由于TensorFlow自带的优化器只能向极小值方向优化,因此对优化函数取反,最终MG训练的优化函数为:
图6示出的是并行计算示意图。如图6所示,在AutoML系统训练阶段,MG从CPU接受网络参数θ
c和MG个数L,在GPU0中采用模型并行的方式构建L个结构相同、参数不同的MG,共用同一个会话,但是输入和输出互不干扰。每个MG生成m个UM并计算误差和奖励。对每一个MG所创建的m个UM,当完成m个R值计算后即打包并传入Reward buffer(奖励缓冲)。CPU依次从reward buffer中取出数据包,计算数据包所对应的MG的参数集合θ
c,然后更新相应参数。参数进行如下迭代更新:
实验证明了本发明实施例的有效性。本发明实施例将在Cifar-10图像数据集上生成图像分类模型作为测试实例展示本发明实施例的有益效果。
本发明实施例采用RNN(循环神经网络)作为GM,步长为5,即每一次输出5个编码值来表示两个输入和各自的操作,以及这两个输入的合并方式。上述5个输入作为一组,重复五次构成的五组输出并合并为一个cell。GM生成两类不同的cell以及其堆叠方式的编码。解码器将根据预先给定的编码规则对照生成UM。由于cifar-10数据集中的数据为彩色图片,因此对于接收输入数据的第一层网络,需要将输入通道数强制修改为 3。对UM的loss值计算采用交叉熵函数(见公式(5)),训练采用误差反传法,训练过程选取SGD(随机最速下降)作为优化器。
当UM被训练过指定个epoch后,最后一次模型的输出记为
对于第K次完成训练时,MG所对应的模型的
按照公式(6)计算;对于第i个UM,其计算复杂度可根据公式(8)计算;根据公式(7)(9)-(14)计算出每个MG对应的loss值;并使用公式(15)更新相应参数。图7示出了采用强化学习迭代29次时,MG的误差变化情况,其中每次迭代每个UM模型经过10个epoch训练。由图7可见,误差随迭代次数而大幅度降低。
从上述实施例可以看出,本发明实施例提供的机器学习方法,通过抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;使用解码器根据多个模型编码分别生成相应的多个效用模型;使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;根据多个误差值迭代计算以更新网络参数和最优效用模型;判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行上述步骤的技术方案,能够针对一般化的不同任务或不同类型的任务构建结构模型来进行自动化机器学习,通过自动化机器学习来解放人工,提高工作效率,降低成本。
需要特别指出的是,上述机器学习方法的各个实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于机器学习方法也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在所述实施例之上。
基于上述目的,本发明实施例的第二个方面,提出了一种能够针对一般化的不同任务或不同类型的任务构建结构模型的机器学习装置的实施例。所述装置包括:
处理器;和
存储器,存储有处理器可运行的程序代码,所述程序代码在被运行时执行如上述的方法。其中,程序代码还包括以下部分:
网络结构搜索模块,用于抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;
解码模块,用于对多个模型编码使用解码器分别生成相应的多个效用模型;
计算模块,用于使用多组数据一一训练多个效用模型和已有的最优效用模型,使每个效用模型和最优效用模型均生成多个误差值,根据多个误差值迭代计算更新的网络参数和更新的最优效用模型,并使用更新的网络参数和更新的最优效用模型覆盖已有的网络参数和已有的最优效用模型调用网络结构搜索模块和解码模块重新执行上述步骤;
其中机器学习装置使用上述模块执行上述方法,并在满足预定的学习结束条件时输出当前的最优效用模型。
从上述实施例可以看出,本发明实施例提供的机器学习装置,通过抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;使用解码器根据多个模型编码分别生成相应的多个效用模型;使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;根据多个误差值迭代计算以更新网络参数和最优效用模型;判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行上述步骤的技术方案,能够针对一般化的不同任务或不同类型的任务构建结构模型来进行自动化机器学习,通过自动化机器学习来解放人工,提高工作效率,降低成本。
需要特别指出的是,上述机器学习装置的实施例采用了所述机器学习方法的实施例来具体说明各模块的工作过程,本领域技术人员能够很容易 想到,将这些模块应用到所述机器学习方法的其他实施例中。当然,由于所述机器学习方法实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于所述机器学习装置也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在所述实施例之上。
基于上述目的,本发明实施例的第三个方面,提出了一种能够针对一般化的不同任务或不同类型的任务构建结构模型的计算机的实施例。计算机包括:
存储和计算单元集群,设置于计算机底层,用于执行并行计算任务;
多线程分布式任务调度模块,设置于存储和计算单元集群的上一层,用于接收并行计算任务,并根据配置参数将不同的并行计算任务选择性地下发到存储和计算单元集群中的不同单元以优化计算性能;
接口模块,设置于多线程分布式任务调度模块的上一层,封装有多个可被调用的深度学习框架,用于维护深度学习框架的更新和兼容性,其中深度学习框架用于将分类和训练任务转化为并行计算任务并下发到多线程分布式任务调度模块;
模型类,设置于接口模块的上一层,包括模型生成器组和效用模型组,其中模型生成器组根据数据样本生成模型编码,效用模型组根据模型编码来对数据样本执行分类任务;
模型训练类,设置于接口模块的上一层,包括模型生成器训练组和效用模型训练组,其中模型生成器训练组使用反向传播方法对模型生成器组执行训练任务,效用模型训练组使用强化Q学习方法对效用模型组执行训练任务;
误差计算模块,设置于模型类和模型训练类的上一层,根据效用模型组的数据样本分类输出使用不同类型的方法分别计算多种误差,并根据误差在效用模型组中确定一个最优效用模型;
输出模块,用于判断是否满足预定的学习结束条件,并据此输出当前 的所述最优效用模型。
如图8所示,计算机底层存储和计算资源的硬件或虚拟资源,其上构建有任务调度模块。任务调度模块负责接收并行计算任务,通过给定的参数设置将其合理分配给底层计算资源。任务调度模块负责优化计算性能。在其上是目前主流的深度学习框架。为了避免由于深度学习框架更新迭代导致大量的代码维护工作,以及维持多框架的兼容性,本发明实施例用接口模块对所用到的操作进行封装。后续所有用到的操作均采用封装后的函数进行实现。
在定义了专用的接口模块后,采用重写的层操作构建模型类。模型类有两个派生,两个派生继承模型类中的基础属性和方法(如模型参数数量、模型图绘制、超参列表、推理训练方法等),一个是GM,接收输入的样本来生成model code和Cell;另一个是UM,接收输入的Model Code和样本来构建完成给定分类任务的模型。其中model code用于构造UM,样本用于训练UM。MG和UM都需要被训练,但由于MG需要采用R-QL(强化Q学习)方法训练,而UM采用BP(反向传播)方法训练,本发明实施例构造模型训练类来包含不同的训练方法,并实例化不同的训练器。
虽然不同模型训练过程中都需要接收标签信息来计算不同类型的loss值,但是优化器的输入数据是最终计算出来的loss值。本发明实施例把loss值计算单独构建成一个模块,在其中封装不同loss计算方式(如交叉熵、均方差等)和loss的定义(如强化Q学习中生成指定参考模型的概率)。
误差计算模块接收UM的输出和样本的标签并计算loss、loss
total以和Q值。其中loss用于训练UM,当模型达到搜索过程所指定的训练次数后,loss将被用于计算loss
total和Q。后两者用于更新MG。
从上述实施例可以看出,本发明实施例提供的计算机,通过抽取多组数据,将每组数据分别送入根据网络参数生成的相应的模型生成器中,并 生成相应的多个模型编码;使用解码器根据多个模型编码分别生成相应的多个效用模型;使用多组数据一一训练多个效用模型和最优效用模型,使每个效用模型和最优效用模型均生成多个误差值;根据多个误差值迭代计算以更新网络参数和最优效用模型;判断是否满足预定的学习结束条件,并在满足预定的学习结束条件时输出最优效用模型,在不满足预定的学习结束条件时使用网络参数和最优效用模型重新执行上述步骤的技术方案,能够针对一般化的不同任务或不同类型的任务构建结构模型来进行自动化机器学习,通过自动化机器学习来解放人工,提高工作效率,降低成本。
需要特别指出的是,上述计算机的实施例采用了所述机器学习方法的实施例来具体说明各模块的工作过程,本领域技术人员能够很容易想到,将这些模块应用到所述机器学习方法的其他实施例中。当然,由于所述机器学习方法实施例中的各个步骤均可以相互交叉、替换、增加、删减,因此,这些合理的排列组合变换之于所述计算机也应当属于本发明的保护范围,并且不应将本发明的保护范围局限在所述实施例之上。
以上是本发明公开的示例性实施例,但是应当注意,在不背离权利要求限定的本发明实施例公开的范围的前提下,可以进行多种改变和修改。根据这里描述的公开实施例的方法权利要求的功能、步骤和/或动作不需以任何特定顺序执行。此外,尽管本发明实施例公开的元素可以以个体形式描述或要求,但除非明确限制为单数,也可以理解为多个。
应当理解的是,在本文中使用的,除非上下文清楚地支持例外情况,单数形式“一个”旨在也包括复数形式。还应当理解的是,在本文中使用的“和/或”是指包括一个或者一个以上相关联地列出的项目的任意和所有可能组合。本发明实施例公开实施例序号仅仅为了描述,不代表实施例的优劣。
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本发明实施例公开的范围(包括权利要求)被限于这些例子;在本发明实施例的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,并存在如上所述的本发明实施例的不同方面的 许多其它变化,为了简明它们没有在细节中提供。因此,凡在本发明实施例的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。
Claims (10)
- 一种机器学习方法,其特征在于,包括以下步骤:步骤一:抽取多组数据,将每组所述数据分别送入根据网络参数生成的相应的模型生成器中,并生成相应的多个模型编码;步骤二:使用解码器根据多个所述模型编码分别生成相应的多个效用模型;步骤三:在第一次执行时,使用多组所述数据一一训练多个所述效用模型,使每个所述效用模型均生成多个误差值;在至少是第二次执行时,使用多组所述数据一一训练多个所述效用模型和所述最优效用模型,使每个所述效用模型和所述最优效用模型均生成多个所述误差值;步骤四:在第一次执行时,根据多个所述误差值计算以更新所述网络参数,并计算最优效用模型;在至少是第二次执行时,根据多个所述误差值迭代计算以更新所述网络参数和所述最优效用模型;步骤五:判断是否满足预定的学习结束条件,并在满足所述预定的学习结束条件时输出所述最优效用模型,在不满足所述预定的学习结束条件时使用所述网络参数和所述最优效用模型重新执行步骤一至步骤四。
- 根据权利要求1所述的方法,其特征在于,使用多组所述数据一一训练多个所述效用模型和所述最优效用模型包括:将多组所述数据一一输入多个所述效用模型和所述最优效用模型,获得多个预测输出;根据多个预测输出和由用户指定的与其相对应的样本标签确定交叉熵损失函数;使用所述交叉熵损失函数来训练多个所述效用模型和所述最优效用模型。
- 根据权利要求1所述的方法,其特征在于,根据多个所述误差值迭代计算以更新所述网络参数和所述最优效用模型包括:根据多个所述误差值确定每个所述效用模型和所述最优效用模型的总体误差;根据多个所述误差值和多个所述总体误差确定每个所述效用模型和所述最优效用模型的精度损失;根据多个所述精度损失确定每个所述效用模型和所述最优效用模型相对于多组所述数据的收益函数;根据多个所述收益函数更新所述网络参数和所述最优效用模型。
- 根据权利要求3所述的方法,其特征在于,根据多个所述收益函数更新所述网络参数和所述最优效用模型包括:确定每个所述效用模型和所述最优效用模型的计算复杂度损失;根据多个所述计算复杂度损失和多个所述收益函数确定每个所述效用模型和所述最优效用模型的强化学习损失;根据多个所述强化学习损失更新所述网络参数;根据多个所述计算复杂度损失和多个所述收益函数确定每个所述效用模型和所述最优效用模型的辅助矩阵;根据多个所述辅助矩阵和多个所述收益函数确定每个所述效用模型和所述最优效用模型的偏移值;根据多个所述偏移值更新所述最优效用模型。
- 根据权利要求4所述的方法,其特征在于,确定每个所述效用模型和所述最优效用模型的所述计算复杂度损失包括:根据与每个所述效用模型和所述最优效用模型相对应的多个所述模型编码的各指示位数量和计算量分别确定每个所述效用模型和所述最优效用模型的当前计算量;根据多个所述当前计算量确定每个所述效用模型和所述最优效用模型的额外计算量;根据多个所述当前计算量和多个所述额外计算量确定每个所述效用模型和所述最优效用模型的所述计算复杂度损失。
- 根据权利要求5所述的方法,其特征在于,所述指示位包括通常位置指示位、规约位置指示位、和空层指示位,并且所述通常位置指示位和所述规约位置指示位具有相同或不同的计算量,所述空层指示位具有零计算量。
- 根据权利要求1所述的方法,其特征在于,在第一次执行时,使用并行处理方法针对多个所述效用模型同时执行步骤一、步骤二、和步骤三;在至少是第二次执行时,使用并行处理方法针对多个所述效用模型和所述最优效用模型同时执行步骤一、步骤二、和步骤三。
- 根据权利要求1所述的方法,其特征在于,所述预定的学习结束条件包括以下至少之一:学习达到指定的迭代次数;多个所述模型编码在指定的迭代次数内不发生改变;所述最优效用模型的收益函数达到预定阈值。
- 一种机器学习装置,其特征在于,包括:处理器;和存储器,存储有处理器可运行的程序代码,所述程序代码在被运行时执行如权利要求1-8中任意一项所述的方法。
- 一种计算机,其特征在于,包括:存储和计算单元集群,设置于计算机底层,用于执行并行计算任务;多线程分布式任务调度模块,设置于所述存储和计算单元集群的上一层,用于接收所述并行计算任务,并根据配置参数将不同的所述并行计算任务选择性地下发到所述存储和计算单元集群中的不同单元以优化计算性能;接口模块,设置于所述多线程分布式任务调度模块的上一层,封装有多个可被调用的深度学习框架,用于维护所述深度学习框架的更新和兼容 性,其中所述深度学习框架用于将分类和训练任务转化为所述并行计算任务并下发到所述多线程分布式任务调度模块;模型类,设置于所述接口模块的上一层,包括模型生成器组和效用模型组,其中所述模型生成器组根据数据样本生成模型编码,所述效用模型组根据所述模型编码来对所述数据样本执行所述分类任务;模型训练类,设置于所述接口模块的上一层,包括模型生成器训练组和效用模型训练组,其中所述模型生成器训练组使用反向传播方法对所述模型生成器组执行所述训练任务,所述效用模型训练组使用强化Q学习方法对所述效用模型组执行所述训练任务;误差计算模块,设置于所述模型类和所述模型训练类的上一层,根据所述效用模型组的所述数据样本分类输出使用不同类型的方法分别计算多种误差,并根据所述误差在所述效用模型组中确定一个最优效用模型;输出模块,用于判断是否满足预定的学习结束条件,并据此输出当前的所述最优效用模型。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910511173.2A CN110222847A (zh) | 2019-06-13 | 2019-06-13 | 一种机器学习方法与装置 |
| CN201910511173.2 | 2019-06-13 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020248440A1 true WO2020248440A1 (zh) | 2020-12-17 |
Family
ID=67816860
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/108984 Ceased WO2020248440A1 (zh) | 2019-06-13 | 2019-09-29 | 一种机器学习方法与装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110222847A (zh) |
| WO (1) | WO2020248440A1 (zh) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110222847A (zh) * | 2019-06-13 | 2019-09-10 | 苏州浪潮智能科技有限公司 | 一种机器学习方法与装置 |
| CN111597224B (zh) * | 2020-04-17 | 2023-09-15 | 北京百度网讯科技有限公司 | 结构化信息的生成方法、装置、电子设备和存储介质 |
| CN114091666B (zh) * | 2021-10-09 | 2025-03-07 | 北京理工大学 | 面向无监督学习模型的模型生成及实时构建方法 |
| CN119539084B (zh) * | 2024-11-13 | 2025-10-28 | 同济大学 | 一种支持规则链的智能模型构建系统 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109472366A (zh) * | 2018-11-01 | 2019-03-15 | 郑州云海信息技术有限公司 | 一种机器学习模型的编码解码方法与装置 |
| CN109816116A (zh) * | 2019-01-17 | 2019-05-28 | 腾讯科技(深圳)有限公司 | 机器学习模型中超参数的优化方法及装置 |
| CN110222847A (zh) * | 2019-06-13 | 2019-09-10 | 苏州浪潮智能科技有限公司 | 一种机器学习方法与装置 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109344968A (zh) * | 2018-10-10 | 2019-02-15 | 郑州云海信息技术有限公司 | 一种神经网络的超参数处理的方法及装置 |
-
2019
- 2019-06-13 CN CN201910511173.2A patent/CN110222847A/zh active Pending
- 2019-09-29 WO PCT/CN2019/108984 patent/WO2020248440A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109472366A (zh) * | 2018-11-01 | 2019-03-15 | 郑州云海信息技术有限公司 | 一种机器学习模型的编码解码方法与装置 |
| CN109816116A (zh) * | 2019-01-17 | 2019-05-28 | 腾讯科技(深圳)有限公司 | 机器学习模型中超参数的优化方法及装置 |
| CN110222847A (zh) * | 2019-06-13 | 2019-09-10 | 苏州浪潮智能科技有限公司 | 一种机器学习方法与装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110222847A (zh) | 2019-09-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110533183B (zh) | 流水线分布式深度学习中异构网络感知的任务放置方法 | |
| WO2020248440A1 (zh) | 一种机器学习方法与装置 | |
| CN109891438B (zh) | 数值量子实验方法和系统 | |
| CN111026549A (zh) | 一种电力信息通信设备自动化测试资源调度方法 | |
| Liu et al. | Research on multi-digital twin and its application in wind power forecasting | |
| CN109815537B (zh) | 一种基于时间预测的高通量材料仿真计算优化方法 | |
| CN118211623A (zh) | 软硬件加速的循环神经网络加速系统、方法及存储介质 | |
| CN119623911B (zh) | 基于知识图谱与大语言模型的柔性生产计划预测系统和方法 | |
| CN114281535B (zh) | 一种dnn分区方法及采用该方法的边缘计算架构和存储介质 | |
| CN117034100A (zh) | 基于分层池化架构自适应图分类方法、系统、设备和介质 | |
| CN118966321A (zh) | 一种面向人工智能大模型高效训练的并行策略搜索方法 | |
| CN115544307B (zh) | 基于关联矩阵的有向图数据特征提取与表达方法和系统 | |
| CN116502779A (zh) | 基于局部注意力机制的旅行商问题生成式求解方法 | |
| Zhou et al. | TaiChi: Efficient Execution for Multi-DNNs Using Graph-Based Scheduling | |
| CN112801264B (zh) | 一种动态可微分的空间架构搜索方法与系统 | |
| CN118917353B (zh) | 基于性能层级代理辅助的演化神经架构搜索方法和系统 | |
| CN118643887A (zh) | 一种神经网络架构搜索方法、系统、装置及存储介质 | |
| Wang et al. | A coordinated two-stages virtual network embedding algorithm based on reinforcement learning | |
| Qi et al. | Deep reinforcement learning for large-scale scientific workflow scheduling with improved structure feature extraction and sampling | |
| Wiggins et al. | Evaluating multi-agent reinforcement learning on heterogeneous platforms | |
| Guo et al. | Improved CS algorithm and its application in parking space prediction | |
| Jian et al. | AN IMPROVED VIRUS EVOLUTIONARY GENETIC ALGORITHM FOR WORKFLOW MINING. | |
| Yan et al. | A Weight Inheritance and Guidance Strategy based Evolutionary Network Architecture Search | |
| CN121501816B (zh) | 一种面向Text2SQL的多智能体模型自进化方法 | |
| CN118822508B (zh) | 一种用于多团队灾后修复性维修决策的深度Actor-Critic架构系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19932658 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19932658 Country of ref document: EP Kind code of ref document: A1 |






