WO2020248365A1 - 智能分配模型训练内存方法、装置及计算机可读存储介质 - Google Patents

智能分配模型训练内存方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2020248365A1
WO2020248365A1 PCT/CN2019/102202 CN2019102202W WO2020248365A1 WO 2020248365 A1 WO2020248365 A1 WO 2020248365A1 CN 2019102202 W CN2019102202 W CN 2019102202W WO 2020248365 A1 WO2020248365 A1 WO 2020248365A1
Authority
WO
WIPO (PCT)
Prior art keywords
training
data set
mini
batch gradient
unit data
Prior art date
Application number
PCT/CN2019/102202
Other languages
English (en)
French (fr)
Inventor
金戈
徐亮
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020248365A1 publication Critical patent/WO2020248365A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to a method, device and computer-readable storage medium for training memory of an intelligent allocation model based on gradient descent.
  • This application provides a method, device, and computer-readable storage medium for intelligently allocating model training memory. Its main purpose is to use cyclic neural network to calculate the capacity of model training memory, and based on the calculated capacity, use gradient descent algorithm to allocate Model training memory improves the efficiency of model training.
  • a method for intelligently allocating model training memory includes: constructing a PyTorch framework in a python environment, the PyTorch framework includes a variety of machine learning models, using the PyTorch framework to receive training data, and The training data is randomly divided into unit data set A and unit data set B; the unit data set A is calculated by batch gradient descent method to obtain a small batch gradient data set, and the PyTorch framework is used to create a recurrent neural network, and The mini-batch gradient data set is input into the recurrent neural network for back propagation training to obtain training values, until the training value of the recurrent neural network is less than a preset threshold, the recurrent neural network exits training and outputs the feedback To propagate the training memory space margin value; according to the memory space margin value, calculate the model training memory occupied by various machine learning models when training the unit data set B, and calculate the unit training memory according to the model training memory
  • the data set B is respectively imported into the multiple machine learning models
  • the present application also provides a device that includes a memory and a processor.
  • the memory stores an intelligent training program that can be run on the processor.
  • the processor executes the following steps: build a PyTorch framework in a python environment, the PyTorch framework includes a variety of machine learning models, use the PyTorch framework to receive training data, and randomly divide the training data into unit data sets A and units Data set B; the unit data set A is operated by batch gradient descent to obtain a mini-batch gradient data set, the PyTorch framework is used to create a recurrent neural network, and the mini-batch gradient data set is input to the recurrent neural network When the training value of the recurrent neural network is less than the preset threshold, the recurrent neural network exits training and outputs the memory space margin value of the backpropagation training; according to the Memory space margin value, calculate the model training memory occupied when the unit data set B is trained by various machine learning models, and import the unit
  • the present application also provides a computer-readable storage medium having an intelligent training program stored on the computer-readable storage medium, and the intelligent training program can be executed by one or more processors to achieve The steps of the smart allocation model training memory method as described above.
  • the intelligent allocation model training memory method, device, and computer-readable storage medium proposed in this application create a cyclic neural network model, import part of the data, and use the cyclic neural network model to calculate the memory capacity according to the part of the data, and based on the batch gradient
  • the descent method efficiently allocates the memory of multiple machine learning models, improves the efficiency of model training, and ensures the efficiency of users' use of memory space.
  • FIG. 1 is a schematic flowchart of a method for intelligently allocating model training memory provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of the internal structure of a device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of modules of an intelligent training program in a device provided by an embodiment of the application.
  • This application provides a method for intelligently allocating model training memory.
  • FIG. 1 it is a schematic flowchart of a method for intelligently allocating model training memory provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the method for intelligently allocating model training memory includes:
  • the PyTorch framework includes a variety of machine learning models, use the PyTorch framework to receive training data, and randomly divide the training data into a unit data set A and a unit data set B.
  • the training data is data for training the multiple machine learning models.
  • it is classified according to data formats such as text data, image data, etc., and classified according to business types such as information security, data prediction, Clustering judgment, etc.
  • the training data can be crawled from popular websites, and the original data is randomly divided into unit data set A and unit data set B.
  • the unit data set A is used to calculate the unit margin value of the storage memory
  • the unit data set B is used to train the multiple machine learning models.
  • the unit data set A and the unit The data volume ratio of data set B is 1:9.
  • the PyTorch framework is a Python-based deep learning framework that can implement the various machine learning models, such as naive Bayes, support vector machines, convolutional neural networks, and so on.
  • the batch gradient descent method has the advantages of faster calculation speed, can effectively avoid the interference of similar samples, and reduce the computational burden.
  • the unit data set A adopts the batch gradient descent method to obtain the mini-batch gradient data set including solving the loss function loss and solving the partial derivative of the loss function.
  • the loss function loss of the unit data set A is calculated as:
  • y ⁇ (x (i) ) is the predicted value of the unit data set A
  • y (i) is the true value of the unit data set A
  • is the estimated parameter value included in the unit data set A
  • the mini-batch gradient data set ⁇ j+1 is continuously updated:
  • ⁇ j is the pre-updated mini-batch gradient data set
  • ⁇ j+1 is the updated mini-batch gradient data set.
  • a preferred embodiment of the present application uses the PyTorch framework to create a recurrent neural network, and inputs the mini-batch gradient set to the recurrent neural network model, and compares it with the basic parameters of the hidden layer of the recurrent neural network model.
  • the convolution operation obtains the convolution gradient value. If the convolution gradient value is greater than the preset threshold, the basic parameter is randomly set again, and when the convolution gradient value is less than the preset threshold, the basic parameter The value no longer changes, and the recurrent neural network completes training.
  • the convolution operation :
  • ⁇ ' is the margin value of the memory space
  • is the mini-batch gradient data set
  • k is the size of the convolution kernel
  • s is the stride of the convolution operation
  • p is the data zero-filling matrix
  • the value of the memory space margin value is 80M, and the ratio of the unit data set A to the unit data set B is 1:9, therefore
  • a memory space margin value of 720M is required, and because the recurrent neural network is the most memory-occupied in the current machine learning model during the training process
  • the model training space occupied by the calculation of multiple machine learning models training the unit data set B can be intelligently allocated according to the gradient descent algorithm model training memory:
  • Is the gradient descent algorithm Is a collection of machine learning models, such as the Naive Bayes, Support Vector Machine, Convolutional Neural Network, etc.
  • b is the number of samples in the unit data set B
  • y (i) is the The estimated parameter value of the unit data set B
  • the memory space margin value of each machine learning model is constantly updated:
  • ⁇ j is the memory space margin value of each machine learning model before update, which can be obtained by random initialization
  • ⁇ j+1 is the memory space margin value of each machine learning model after update.
  • the memory space margin value of the unit data set B for support vector set training is 120M
  • the memory space margin value of unit data set B for naive Bayes training is 72M, etc. .
  • ⁇ j+1 a corresponding memory space is divided for each machine learning model, thereby achieving the purpose of intelligently allocating model training memory.
  • the application also provides a device 1.
  • FIG. 3 it is a schematic diagram of the internal structure of the device 1 provided by an embodiment of this application.
  • the device 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or a server.
  • the device 1 at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium.
  • the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, and optical disk.
  • the memory 11 may be an internal storage unit of the device 1 in some embodiments, such as a hard disk of the device 1. In other embodiments, the memory 11 may also be an external storage device of the device 1, such as a plug-in hard disk, a smart media card (SMC), or a secure digital (SD) card equipped on the device 1. Flash Card, etc. Further, the memory 11 may also include both an internal storage unit of the memory device 1 for smart allocation model training and an external storage device.
  • the memory 11 can be used not only to store application software and various types of data installed in the device 1, such as the code of the smart training program 01, etc., but also to temporarily store data that has been output or will be output.
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run the program code or processing stored in the memory 11 Data, such as executing smart training program 01, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip
  • the communication bus 13 is used to realize the connection and communication between these components.
  • the network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the device 1 and to display a visualized user interface.
  • Figure 3 only shows the smart allocation model training memory device 1 with components 11-14 and the smart training program 01. Those skilled in the art can understand that the structure shown in Figure 1 does not constitute a smart allocation model training memory device
  • the definition of 1 may include fewer or more components than shown, or a combination of certain components, or different component arrangements.
  • the smart training program 01 is stored in the memory 11; when the processor 12 executes the smart training program 01 stored in the memory 11, the following steps are implemented:
  • Step 1 Build a PyTorch framework in a python environment.
  • the PyTorch framework includes a variety of machine learning models.
  • the PyTorch framework is used to receive training data, and the training data is randomly divided into a unit data set A and a unit data set B.
  • the training data is data for training the multiple machine learning models.
  • it is classified according to data formats such as text data, image data, etc., and classified according to business types such as information security, data prediction, Clustering judgment, etc.
  • the training data can be crawled from popular websites, and the original data is randomly divided into unit data set A and unit data set B.
  • the unit data set A is used to calculate the unit margin value of the storage memory
  • the unit data set B is used to train the multiple machine learning models.
  • the unit data set A and the unit The data volume ratio of data set B is 1:9.
  • the PyTorch framework is a Python-based deep learning framework that can implement the various machine learning models, such as naive Bayes, support vector machines, convolutional neural networks, and so on.
  • Step 2 Use the batch gradient descent method to calculate the unit data set A to obtain a mini-batch gradient data set, use the PyTorch framework to create a recurrent neural network, and input the mini-batch gradient data set into the recurrent neural network Performing back propagation training to obtain the training value, until the training value of the recurrent neural network is less than the preset threshold, the recurrent neural network exits the training and outputs the memory space margin value of the back propagation training.
  • the batch gradient descent method has the advantages of faster calculation speed, can effectively avoid the interference of similar samples, and reduce the computational burden.
  • the unit data set A adopts the batch gradient descent method to obtain the mini-batch gradient data set including solving the loss function loss and solving the partial derivative of the loss function.
  • the loss function loss of the unit data set A is calculated as:
  • y ⁇ (x (i) ) is the predicted value of the unit data set A
  • y (i) is the true value of the unit data set A
  • is the estimated parameter value included in the unit data set A
  • the mini-batch gradient data set ⁇ j+1 is continuously updated:
  • ⁇ j is the pre-updated mini-batch gradient data set
  • ⁇ j+1 is the updated mini-batch gradient data set.
  • a preferred embodiment of the present application uses the PyTorch framework to create a recurrent neural network, and inputs the mini-batch gradient set to the recurrent neural network model, and compares it with the basic parameters of the hidden layer of the recurrent neural network model.
  • the convolution operation obtains the convolution gradient value. If the convolution gradient value is greater than the preset threshold, the basic parameter is randomly set again, and when the convolution gradient value is less than the preset threshold, the basic parameter The value no longer changes, and the recurrent neural network completes training.
  • the convolution operation :
  • ⁇ ' is the margin value of the memory space
  • is the mini-batch gradient data set
  • k is the size of the convolution kernel
  • s is the stride of the convolution operation
  • p is the data zero-filling matrix
  • Step 3 Calculate the model training memory occupied by various machine learning models when training the unit data set B according to the value of the memory space margin, and import the unit data set B into all the units according to the model training memory.
  • the multiple machine learning models are trained until the training values of the multiple machine learning models converge to a preset interval, and the training is exited, and the training values of the multiple machine learning models are output.
  • the value of the memory space margin value is 80M, and the ratio of the unit data set A to the unit data set B is 1:9, therefore
  • a memory space margin value of 720M is required, and because the recurrent neural network is the most memory-occupied in the current machine learning model during the training process
  • the model training space occupied by the calculation of multiple machine learning models training the unit data set B can be intelligently allocated according to the gradient descent algorithm model training memory:
  • Is the gradient descent algorithm Is a collection of machine learning models, such as the Naive Bayes, Support Vector Machine, Convolutional Neural Network, etc.
  • b is the number of samples in the unit data set B
  • y (i) is the The estimated parameter value of the unit data set B
  • the memory space margin value of each machine learning model is constantly updated:
  • ⁇ j is the memory space margin value of each machine learning model before update, which can be obtained by random initialization
  • ⁇ j+1 is the memory space margin value of each machine learning model after update.
  • the memory space margin value of the unit data set B for support vector set training is 120M
  • the memory space margin value of unit data set B for naive Bayes training is 72M, etc. .
  • ⁇ j+1 a corresponding memory space is divided for each machine learning model, thereby achieving the purpose of intelligently allocating model training memory.
  • the smart training program may also be divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processing The module 12) is executed to complete this application.
  • the module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, and is used to describe the execution process of the smart training program in the smart allocation model training memory device.
  • the intelligent training program can be divided into a data preprocessing module 10, a model training module 20, and Allocate the training memory module 30, exemplarily:
  • the data preprocessing module 10 is configured to: construct a PyTorch framework in a python environment, the PyTorch framework includes a variety of machine learning models, use the PyTorch framework to receive training data, and randomly divide the training data into unit data sets A And unit data set B.
  • the model training module 20 is configured to: use the batch gradient descent method to calculate the unit data set A to obtain a mini-batch gradient data set, use the PyTorch framework to create a recurrent neural network, and input the mini-batch gradient data set to Performing back propagation training in the recurrent neural network to obtain training values, until the training value of the recurrent neural network is less than a preset threshold, the recurrent neural network exits training and outputs the memory space margin of the back propagation training value.
  • the allocating training memory module 30 is configured to: according to the memory space margin value, calculate the model training memory occupied by various machine learning models when training the unit data set B, and calculate the unit training memory according to the model training memory
  • the data set B is respectively imported into the multiple machine learning models for training, and the training is completed when the training values of the multiple machine learning models converge to a preset interval.
  • an embodiment of the present application also proposes a computer-readable storage medium having an intelligent training program stored on the computer-readable storage medium, and the intelligent training program can be executed by one or more processors to implement the following operations:
  • the PyTorch framework includes a variety of machine learning models, use the PyTorch framework to receive training data, and randomly divide the training data into a unit data set A and a unit data set B;
  • the model training memory occupied by various machine learning models when training the unit data set B, and import the unit data set B into the various machines according to the model training memory.
  • the learning model is trained until the training values of the multiple machine learning models converge within the preset interval to complete the training.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (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)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Machine Translation (AREA)
  • Image Analysis (AREA)

Abstract

本申请涉及人工智能技术,揭露了一种智能分配模型训练内存的方法,包括构建PyTorch框架并接收训练数据,并将所述训练数据随机分为单元数据集A和单元数据集B,将所述单元数据集A运算后得到小批量梯度数据集,将所述小批量梯度数据集输入至循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出内存空间余量值,根据所述内存空间余量值计算多种机器学习模型所占用的模型训练内存,根据所述模型训练空间将所述单元数据集B分别导入所述多种机器学习模型进行训练。本申请还提出一种智能分配模型训练内存的装置以及一种计算机可读存储介质。本申请可以实现智能分配模型训练内存功能。

Description

智能分配模型训练内存方法、装置及计算机可读存储介质
本申请要求于2019年6月14日提交中国专利局,申请号为201910520760.8、发明名称为“智能分配模型训练内存方法、装置及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种基于梯度下降的智能分配模型训练内存方法、装置及计算机可读存储介质。
背景技术
目前机器学习技术应用广泛,集成化的机器学习系统也越来越多的被采用,所述集成化的机器学习系统就是同时应用多种机器学习模型进行训练。但所述集成化的机器学习效果和速度常常受制于内存性能和空间,这样导致了模型训练速度慢且准确度不高。如果通过单纯拓展内存空间的方式来提高模型训练的效率,成本高昂,效益不佳,应用范围很窄。
发明内容
本申请提供一种智能分配模型训练内存的方法、装置及计算机可读存储介质,其主要目的在于利用循环神经网络计算模型训练内存的容量,并基于所述计算出的容量,利用梯度下降算法分配模型训练内存,提高模型训练的效率。
为实现上述目的,本申请提供的一种智能分配模型训练内存的方法,包括:在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
此外,为实现上述目的,本申请还提供一种装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的智能训练程序,所述智能训练程序被所述处理器执行时实现如下步骤:在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收 训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有智能训练程序,所述智能训练程序可被一个或者多个处理器执行,以实现如上所述的智能分配模型训练内存方法的步骤。
本申请提出的智能分配模型训练内存方法、装置及计算机可读存储介质,通过创建循环神经网络模型,导入部分数据,利用所述循环神经网络模型根据所述部分数据计算内存容量,并基于批量梯度下降法高效分配多种机器学习模型的内存,提高了模型训练的效率,保证了用户对内存空间的使用效率。
附图说明
图1为本申请一实施例提供的智能分配模型训练内存的方法的流程示意图;
图2为本申请一实施例提供的装置的内部结构示意图;
图3为本申请一实施例提供的装置中智能训练程序的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种智能分配模型训练内存的方法。参照图1所示,为本申请一实施例提供的智能分配模型训练内存的方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,智能分配模型训练内存的方法包括:
S1、在python环境下构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B。
本申请较佳实施例,所述训练数据是训练所述多种机器学习模型的数据,较佳地,按照数据格式划分如文本数据、图片数据等,按照业务类型划分如信息安全、数据预测、聚类判断等,所述训练数据可从热门网站中爬取,并随机将所述原始数据分割为单元数据集A和单元数据集B。其中,所述单元 数据集A用于计算存储内存的单元余量值,所述单元数据集B用于训练所述多种机器学习模型,较佳地,所述单元数据集A与所述单元数据集B的数据量比为1:9。
所述PyTorch框架是一种基于Python的深度学习框架,能够实现所述多种机器学习模型,如朴素贝叶斯、支持向量机、卷积神经网络等。
S2、将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值。
本申请较佳实施例,所述批量梯度下降法具有运算速度更快,可有效避免相似样本的干扰,减轻计算负担等优点。较佳地,所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集包括求解损失函数loss和对所述损失函数求解偏导数。
较佳地,求出所述单元数据集A的损失函数loss为:
Figure PCTCN2019102202-appb-000001
其中,b为所述单元数据集A的样本个数,y θ(x (i))为所述单元数据集A的预测值,y (i)为所述单元数据集A的真实值,x为所述单元数据集A的加权平均值,θ为所述单元数据集A所包含的预估参数值;
对所述损失函数loss求解θ的偏导数:
Figure PCTCN2019102202-appb-000002
基于上述求解偏导数的过程,不断更新小批量梯度数据集θ j+1
Figure PCTCN2019102202-appb-000003
其中,θ j为更新前的小批量梯度数据集,θ j+1为更新后的小批量梯度数据集当达到预设迭代次数时,退出迭代,输出所述小批量梯度数据集θ j+1
进一步地,本申请较佳实施例利用所述PyTorch框架创建一个循环神经网络,将所述小批量梯度集输入至所述循环神经网络模型,并与所述循环神经网络模型隐藏层的基本参数进行卷积运算得到卷积梯度值,若所述卷积梯度值大于预设阈值,则重新随机设定所述基本参数,当所述卷积梯度值小于所述预设阈值,则所述基本参数值不再变动,所述循环神经网络完成训练。
较佳地,所述卷积运算:
Figure PCTCN2019102202-appb-000004
其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
S3、根据所述内存空间余量值,计算多种机器学习模型训练所述单元数 据集B时所占用的模型训练内存,根据所述模型训练内存,将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时退出训练,并输出所述多种机器学习模型的训练值。
较佳地,如根据所述循环神经网络智能的计算出所述内存空间余量值的值为80M,而所述单元数据集A与所述单元数据集B的数量比为1:9,因此在以所述循环神经网络为机器学习模型训练所述单元数据集B的话,则需要720M的内存空间余量值,而由于所述循环神经网络在训练过程中是当前机器学习模型中最占用内存空间的一种机器学习模型之一,因此,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练空间可根据梯度下降算法智能分配模型训练内存:
Figure PCTCN2019102202-appb-000005
其中,
Figure PCTCN2019102202-appb-000006
是所述梯度下降算法,
Figure PCTCN2019102202-appb-000007
为各机器学习模型集合,如所述朴素贝叶斯、支持向量机、卷积神经网络等,b为所述单元数据集B的样本个数,
Figure PCTCN2019102202-appb-000008
为所述各机器学习模型下训练所述单元数据集B所占用的内存数,可随机设置,但不大于所述内存空间余量值,如不大于上述720M,y (i)为所述所述单元数据集B的预估参数值,
对所述损失函数loss求解
Figure PCTCN2019102202-appb-000009
的偏导数:
Figure PCTCN2019102202-appb-000010
基于上述求解偏导数的过程,不断更新各机器学习模型的内存空间余量值:
Figure PCTCN2019102202-appb-000011
其中,θ j为更新前的所述各机器学习模型的内存空间余量值,可随机初始化得到,θ j+1为更新后的所述各机器学习模型的内存空间余量值。根据θ j+1的值可得到,如支持向量集训练所述单元数据集B的内存空间余量值为120M,朴素贝叶斯训练所述单元数据集B的内存空间余量值为72M等。
进一步地,根据所述θ j+1的值,给各个机器学习模型划分出对应的内存空间,由此达到智能分配模型训练内存的目的。
本申请还提供一种装置1。参照图3所示,为本申请一实施例提供的装置1的内部结构示意图。
在本实施例中,所述装置1可以是PC(Personal Computer,个人电脑),或者是智能手机、平板电脑、便携计算机等终端设备,也可以是一种服务器等。该装置1至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁 性存储器、磁盘、光盘等。存储器11在一些实施例中可以是装置1的内部存储单元,例如该装置1的硬盘。存储器11在另一些实施例中也可以是装置1的外部存储设备,例如装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括智能分配模型训练内存装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于装置1的应用软件及各类数据,例如智能训练程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行智能训练程序01等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在装置1中处理的信息以及用于显示可视化的用户界面。
图3仅示出了具有组件11-14以及智能训练程序01的智能分配模型训练内存装置1,本领域技术人员可以理解的是,图1示出的结构并不构成对智能分配模型训练内存装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
在图3所示的装置1实施例中,存储器11中存储有智能训练程序01;处理器12执行存储器11中存储的智能训练程序01时实现如下步骤:
步骤一、在python环境下构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B。
本申请较佳实施例,所述训练数据是训练所述多种机器学习模型的数据,较佳地,按照数据格式划分如文本数据、图片数据等,按照业务类型划分如信息安全、数据预测、聚类判断等,所述训练数据可从热门网站中爬取,并随机将所述原始数据分割为单元数据集A和单元数据集B。其中,所述单元数据集A用于计算存储内存的单元余量值,所述单元数据集B用于训练所述多种机器学习模型,较佳地,所述单元数据集A与所述单元数据集B的数据量比为1:9。
所述PyTorch框架是一种基于Python的深度学习框架,能够实现所述多种机器学习模型,如朴素贝叶斯、支持向量机、卷积神经网络等。
步骤二、将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值。
本申请较佳实施例,所述批量梯度下降法具有运算速度更快,可有效避免相似样本的干扰,减轻计算负担等优点。较佳地,所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集包括求解损失函数loss和对所述损失函数求解偏导数。
较佳地,求出所述单元数据集A的损失函数loss为:
Figure PCTCN2019102202-appb-000012
其中,b为所述单元数据集A的样本个数,y θ(x (i))为所述单元数据集A的预测值,y (i)为所述单元数据集A的真实值,x为所述单元数据集A的加权平均值,θ为所述单元数据集A所包含的预估参数值;
对所述损失函数loss求解θ的偏导数:
Figure PCTCN2019102202-appb-000013
基于上述求解偏导数的过程,不断更新小批量梯度数据集θ j+1
Figure PCTCN2019102202-appb-000014
其中,θ j为更新前的小批量梯度数据集,θ j+1为更新后的小批量梯度数据集当达到预设迭代次数时,退出迭代,输出所述小批量梯度数据集θ j+1
进一步地,本申请较佳实施例利用所述PyTorch框架创建一个循环神经网络,将所述小批量梯度集输入至所述循环神经网络模型,并与所述循环神经网络模型隐藏层的基本参数进行卷积运算得到卷积梯度值,若所述卷积梯度值大于预设阈值,则重新随机设定所述基本参数,当所述卷积梯度值小于所述预设阈值,则所述基本参数值不再变动,所述循环神经网络完成训练。
较佳地,所述卷积运算:
Figure PCTCN2019102202-appb-000015
其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
步骤三、根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存,将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时退出训练,并输出所述多种机器学习模型的训练值。
较佳地,如根据所述循环神经网络智能的计算出所述内存空间余量值的 值为80M,而所述单元数据集A与所述单元数据集B的数量比为1:9,因此在以所述循环神经网络为机器学习模型训练所述单元数据集B的话,则需要720M的内存空间余量值,而由于所述循环神经网络在训练过程中是当前机器学习模型中最占用内存空间的一种机器学习模型之一,因此,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练空间可根据梯度下降算法智能分配模型训练内存:
Figure PCTCN2019102202-appb-000016
其中,
Figure PCTCN2019102202-appb-000017
是所述梯度下降算法,
Figure PCTCN2019102202-appb-000018
为各机器学习模型集合,如所述朴素贝叶斯、支持向量机、卷积神经网络等,b为所述单元数据集B的样本个数,
Figure PCTCN2019102202-appb-000019
为所述各机器学习模型下训练所述单元数据集B所占用的内存数,可随机设置,但不大于所述内存空间余量值,如不大于上述720M,y (i)为所述所述单元数据集B的预估参数值,
对所述损失函数loss求解
Figure PCTCN2019102202-appb-000020
的偏导数:
Figure PCTCN2019102202-appb-000021
基于上述求解偏导数的过程,不断更新各机器学习模型的内存空间余量值:
Figure PCTCN2019102202-appb-000022
其中,θ j为更新前的所述各机器学习模型的内存空间余量值,可随机初始化得到,θ j+1为更新后的所述各机器学习模型的内存空间余量值。根据θ j+1的值可得到,如支持向量集训练所述单元数据集B的内存空间余量值为120M,朴素贝叶斯训练所述单元数据集B的内存空间余量值为72M等。
进一步地,根据所述θ j+1的值,给各个机器学习模型划分出对应的内存空间,由此达到智能分配模型训练内存的目的。
可选地,在其他实施例中,智能训练程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述智能训练程序在智能分配模型训练内存装置中的执行过程。
例如,参照图3所示,为本申请装置一实施例中的智能训练程序的程序模块示意图,该实施例中,所述智能训练程序可以被分割为数据预处理模块10、模型训练模块20及分配训练内存模块30,示例性地:
所述数据预处理模块10用于:在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B。
所述模型训练模块20用于:将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所 述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值。
所述分配训练内存模块30用于:根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
上述数据预处理模块10、模型训练模块20及分配训练内存模块30等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有智能训练程序,所述智能训练程序可被一个或多个处理器执行,以实现如下操作:
在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;
将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;
根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
本申请计算机可读存储介质具体实施方式与上述智能分配模型训练内存装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的 技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种智能分配模型训练内存的方法,其特征在于,所述方法包括:
    在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;
    将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;
    根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存,将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
  2. 如权利要求1所述的智能分配模型训练内存的方法,其特征在于,所述多种机器学习模型包括朴素贝叶斯、支持向量机、卷积神经网络;
    所述训练数据按照数据格式划分为文本数据、图片数据。
  3. 如权利要求1所述的智能分配模型训练内存的方法,其特征在于,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  4. 如权利要求2所述的智能分配模型训练内存的方法,其特征在于,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  5. 如权利要求3所述的智能分配模型训练内存的方法,其特征在于,所述卷积运算为:
    Figure PCTCN2019102202-appb-100001
    其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
  6. 如权利要求4所述的智能分配模型训练内存的方法,其特征在于,所述卷积运算为:
    Figure PCTCN2019102202-appb-100002
    其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
  7. 如权利要求1所述的智能分配模型训练内存的方法,其特征在于,将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,包括:
    求出所述单元数据集A的损失函数loss为:
    Figure PCTCN2019102202-appb-100003
    其中,b为所述单元数据集A的样本个数,y θ(x (i))为所述单元数据集A的预测值,y (i)为所述单元数据集A的真实值,x为所述单元数据集A的加权平均值,θ为所述单元数据集A所包含的预估参数值;
    对所述损失函数loss求解θ的偏导数:
    Figure PCTCN2019102202-appb-100004
    基于上述求解偏导数的过程,不断更新小批量梯度数据集θ j+1
    Figure PCTCN2019102202-appb-100005
    其中,θ j为更新前的小批量梯度数据集,θ j+1为更新后的小批量梯度数据集当达到预设迭代次数时,退出迭代,输出所述小批量梯度数据集θ j+1
  8. 一种智能分配模型训练内存的装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的智能训练程序,所述智能训练程序被所述处理器执行时实现如下步骤:
    在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;
    将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;
    根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
  9. 如权利要求8所述的智能分配模型训练内存的装置,其特征在于,所述多种机器学习模型包括朴素贝叶斯、支持向量机、卷积神经网络;
    所述训练数据按照数据格式划分为文本数据、图片数据。
  10. 如权利要求8所述的智能分配模型训练内存的装置,其特征在于, 将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  11. 如权利要求9所述的智能分配模型训练内存的装置,其特征在于,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  12. 如权利要求10所述的智能分配模型训练内存的装置,其特征在于,所述卷积运算为:
    Figure PCTCN2019102202-appb-100006
    其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
  13. 如权利要求11所述的智能分配模型训练内存的装置,其特征在于,所述卷积运算为:
    Figure PCTCN2019102202-appb-100007
    其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
  14. 如权利要求8所述的智能分配模型训练内存的装置,其特征在于,将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,包括:
    求出所述单元数据集A的损失函数loss为:
    Figure PCTCN2019102202-appb-100008
    其中,b为所述单元数据集A的样本个数,y θ(x (i))为所述单元数据集A的预测值,y (i)为所述单元数据集A的真实值,x为所述单元数据集A的加权平均值,θ为所述单元数据集A所包含的预估参数值;
    对所述损失函数loss求解θ的偏导数:
    Figure PCTCN2019102202-appb-100009
    基于上述求解偏导数的过程,不断更新小批量梯度数据集θ j+1
    Figure PCTCN2019102202-appb-100010
    其中,θ j为更新前的小批量梯度数据集,θ j+1为更新后的小批量梯度数据 集当达到预设迭代次数时,退出迭代,输出所述小批量梯度数据集θ j+1
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有智能训练程序,所述智能训练程序可被一个或者多个处理器执行,以实现如下步骤:
    在python环境构建PyTorch框架,所述PyTorch框架包括多种机器学习模型,利用所述PyTorch框架接收训练数据,并将所述训练数据随机分割为单元数据集A和单元数据集B;
    将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,利用所述PyTorch框架创建循环神经网络,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,直至所述循环神经网络的训练值小于预设阈值时,所述循环神经网络退出训练并输出所述反向传播训练的内存空间余量值;
    根据所述内存空间余量值,计算多种机器学习模型训练所述单元数据集B时所占用的模型训练内存,根据所述模型训练内存将所述单元数据集B分别导入所述多种机器学习模型进行训练,直至所述多种机器学习模型的训练值收敛于预设区间时完成训练。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述多种机器学习模型包括朴素贝叶斯、支持向量机、卷积神经网络;
    所述训练数据按照数据格式划分为文本数据、图片数据。
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,将所述小批量梯度数据集输入至所述循环神经网络中进行反向传播训练得到训练值,包括:
    将所述小批量梯度集输入至所述循环神经网络模型的隐藏层中;
    所述隐藏层将所述隐藏层的基本参数与所述小批量梯度集进行卷积运算得到卷积梯度值。
  19. 如权利要求17或18所述的计算机可读存储介质,其特征在于,所述卷积运算为:
    Figure PCTCN2019102202-appb-100011
    其中ω’为所述内存空间余量值,ω为所述小批量梯度数据集,k为卷积核的大小,s为卷积操作的步幅,p为数据补零矩阵。
  20. 如权利要求15所述的计算机可读存储介质,其特征在于,将所述单元数据集A采用批量梯度下降法运算后得到小批量梯度数据集,包括:
    求出所述单元数据集A的损失函数loss为:
    Figure PCTCN2019102202-appb-100012
    其中,b为所述单元数据集A的样本个数,y θ(x (i))为所述单元数据集A的预测值,y (i)为所述单元数据集A的真实值,x为所述单元数据集A的加权平均值,θ为所述单元数据集A所包含的预估参数值;
    对所述损失函数loss求解θ的偏导数:
    Figure PCTCN2019102202-appb-100013
    基于上述求解偏导数的过程,不断更新小批量梯度数据集θ j+1
    Figure PCTCN2019102202-appb-100014
    其中,θ j为更新前的小批量梯度数据集,θ j+1为更新后的小批量梯度数据集当达到预设迭代次数时,退出迭代,输出所述小批量梯度数据集θ j+1
PCT/CN2019/102202 2019-06-14 2019-08-23 智能分配模型训练内存方法、装置及计算机可读存储介质 WO2020248365A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910520760.8 2019-06-14
CN201910520760.8A CN110363303B (zh) 2019-06-14 2019-06-14 智能分配模型训练内存方法、装置及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020248365A1 true WO2020248365A1 (zh) 2020-12-17

Family

ID=68217386

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/102202 WO2020248365A1 (zh) 2019-06-14 2019-08-23 智能分配模型训练内存方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN110363303B (zh)
WO (1) WO2020248365A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988389A (zh) * 2021-10-15 2022-01-28 厦门大学 一种led结构性能的预测方法
CN114854978A (zh) * 2022-04-06 2022-08-05 武汉钢铁有限公司 一种预测带钢跑偏值的方法和装置
CN117093871A (zh) * 2023-10-16 2023-11-21 之江实验室 一种面向深度学习分布式训练测评方法和系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114816758B (zh) * 2022-05-10 2023-01-06 北京百度网讯科技有限公司 资源分配方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180121792A1 (en) * 2016-10-31 2018-05-03 Oracle International Corporation Differentiable set to increase the memory capacity of recurrent neural networks
CN108960330A (zh) * 2018-07-09 2018-12-07 西安电子科技大学 基于快速区域卷积神经网络的遥感图像语义生成方法
CN109086652A (zh) * 2018-06-04 2018-12-25 平安科技(深圳)有限公司 手写字模型训练方法、汉字识别方法、装置、设备及介质
CN109815779A (zh) * 2018-08-03 2019-05-28 中国农业大学 一种舞台特效触发方法及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2622544A4 (en) * 2010-09-29 2016-03-09 Ericsson Telefon Ab L M METHOD AND DEVICE FOR DATA PROCESSING
US9659248B1 (en) * 2016-01-19 2017-05-23 International Business Machines Corporation Machine learning and training a computer-implemented neural network to retrieve semantically equivalent questions using hybrid in-memory representations
CN108415776B (zh) * 2018-03-06 2020-10-09 华中科技大学 一种分布式数据处理系统中的内存预估与配置优化的方法
CN109445953A (zh) * 2018-08-30 2019-03-08 北京大学 一种面向大规模机器学习系统的机器学习模型训练方法
CN109829542B (zh) * 2019-01-29 2021-04-16 武汉星巡智能科技有限公司 基于多核处理器的多元深度网络模型重构方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180121792A1 (en) * 2016-10-31 2018-05-03 Oracle International Corporation Differentiable set to increase the memory capacity of recurrent neural networks
CN109086652A (zh) * 2018-06-04 2018-12-25 平安科技(深圳)有限公司 手写字模型训练方法、汉字识别方法、装置、设备及介质
CN108960330A (zh) * 2018-07-09 2018-12-07 西安电子科技大学 基于快速区域卷积神经网络的遥感图像语义生成方法
CN109815779A (zh) * 2018-08-03 2019-05-28 中国农业大学 一种舞台特效触发方法及系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113988389A (zh) * 2021-10-15 2022-01-28 厦门大学 一种led结构性能的预测方法
CN114854978A (zh) * 2022-04-06 2022-08-05 武汉钢铁有限公司 一种预测带钢跑偏值的方法和装置
CN117093871A (zh) * 2023-10-16 2023-11-21 之江实验室 一种面向深度学习分布式训练测评方法和系统
CN117093871B (zh) * 2023-10-16 2024-02-13 之江实验室 一种面向深度学习分布式训练测评方法和系统

Also Published As

Publication number Publication date
CN110363303A (zh) 2019-10-22
CN110363303B (zh) 2023-07-07

Similar Documents

Publication Publication Date Title
WO2020248365A1 (zh) 智能分配模型训练内存方法、装置及计算机可读存储介质
CN110390387B (zh) 对深度学习应用所用资源进行评估
CN111755078B (zh) 药物分子属性确定方法、装置及存储介质
WO2021169116A1 (zh) 智能化的缺失数据填充方法、装置、设备及存储介质
WO2019095570A1 (zh) 预测事件流行度方法、服务器及计算机可读存储介质
CN114048331A (zh) 一种基于改进型kgat模型的知识图谱推荐方法及系统
WO2021042844A1 (zh) 大规模数据聚类方法、装置、计算机设备及计算机可读存储介质
WO2023202511A1 (zh) 一种数据的处理方法、神经网络的训练方法以及相关设备
WO2020248495A1 (zh) 模型训练方法、装置及计算机可读存储介质
WO2020147409A1 (zh) 一种文本分类方法、装置、计算机设备及存储介质
WO2023231954A1 (zh) 一种数据的去噪方法以及相关设备
US11461694B2 (en) Machine learning implementation in processing systems
WO2022083093A1 (zh) 图谱中的概率计算方法、装置、计算机设备及存储介质
CN111566646A (zh) 用于对数据进行混淆和解码的电子装置以及用于控制该电子装置的方法
WO2023051369A1 (zh) 一种神经网络的获取方法、数据处理方法以及相关设备
CN111984400A (zh) 神经网络的内存分配方法及装置
WO2023231753A1 (zh) 一种神经网络的训练方法、数据的处理方法以及设备
WO2023185541A1 (zh) 一种模型训练方法及其相关设备
WO2023143080A1 (zh) 一种数据处理方法以及相关设备
CN109919324B (zh) 基于标签比例学习的迁移学习分类方法、系统及设备
CN111143568A (zh) 一种论文分类时的缓冲方法、装置、设备及存储介质
WO2022052647A1 (zh) 一种数据处理方法、神经网络的训练方法以及相关设备
CN115909009A (zh) 图像识别方法、装置、存储介质及电子设备
CN115273110A (zh) 基于TensorRT的文本识别模型部署方法、装置、设备及存储介质
CN115099875A (zh) 基于决策树模型的数据分类方法及相关设备

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: 19932550

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: 19932550

Country of ref document: EP

Kind code of ref document: A1