CN117312173A - Deep learning framework testing method and device, electronic equipment and storage medium - Google Patents
Deep learning framework testing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117312173A CN117312173A CN202311459183.9A CN202311459183A CN117312173A CN 117312173 A CN117312173 A CN 117312173A CN 202311459183 A CN202311459183 A CN 202311459183A CN 117312173 A CN117312173 A CN 117312173A
- Authority
- CN
- China
- Prior art keywords
- deep learning
- intermediate variable
- learning framework
- information
- learning model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013135 deep learning Methods 0.000 title claims abstract description 497
- 238000012360 testing method Methods 0.000 title claims abstract description 137
- 238000003860 storage Methods 0.000 title claims abstract description 30
- 238000013136 deep learning model Methods 0.000 claims abstract description 240
- 238000000034 method Methods 0.000 claims abstract description 62
- 238000012549 training Methods 0.000 claims abstract description 29
- 238000013481 data capture Methods 0.000 claims description 79
- 238000004590 computer program Methods 0.000 claims description 18
- 238000002347 injection Methods 0.000 claims description 3
- 239000007924 injection Substances 0.000 claims description 3
- 239000000758 substrate Substances 0.000 claims 1
- 238000010998 test method Methods 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 26
- 238000012545 processing Methods 0.000 description 18
- 230000006870 function Effects 0.000 description 16
- 238000005457 optimization Methods 0.000 description 11
- 238000011161 development Methods 0.000 description 10
- 239000000243 solution Substances 0.000 description 7
- 230000010365 information processing Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000007790 scraping Methods 0.000 description 5
- HPTJABJPZMULFH-UHFFFAOYSA-N 12-[(Cyclohexylcarbamoyl)amino]dodecanoic acid Chemical compound OC(=O)CCCCCCCCCCCNC(=O)NC1CCCCC1 HPTJABJPZMULFH-UHFFFAOYSA-N 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 4
- 230000009193 crawling Effects 0.000 description 4
- 238000011156 evaluation Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3698—Environments for analysis, debugging or testing of software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域Technical field
本公开涉及计算机技术领域,尤其涉及一种深度学习框架的测试方法、深度学习框架的测试装置、电子设备和存储介质。The present disclosure relates to the field of computer technology, and in particular, to a deep learning framework testing method, a deep learning framework testing device, electronic equipment, and a storage medium.
背景技术Background technique
深度学习的迅速发展,不仅促进了众多开源深度学习框架的诞生,如TensorFlow、PyTorch、Caffe等,也激发了许多机构研发专属的深度学习框架以满足特定需求。然而,由于不同深度学习框架的设计原理和优化方法有所差异,相同的深度学习模型在不同的深度学习框架下的训练结果可能存在差别。评估和验证这些深度学习框架的精度和功能通常是一项复杂且耗时的任务。The rapid development of deep learning has not only promoted the birth of many open source deep learning frameworks, such as TensorFlow, PyTorch, Caffe, etc., but also inspired many institutions to develop proprietary deep learning frameworks to meet specific needs. However, due to differences in the design principles and optimization methods of different deep learning frameworks, the training results of the same deep learning model under different deep learning frameworks may be different. Evaluating and validating the accuracy and capabilities of these deep learning frameworks is often a complex and time-consuming task.
发明内容Contents of the invention
本公开提供了一种深度学习框架的测试技术方案。The present disclosure provides a technical solution for testing a deep learning framework.
根据本公开的一方面,提供了一种深度学习框架的测试方法,包括:According to one aspect of the present disclosure, a method for testing a deep learning framework is provided, including:
在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码;Inject data scraping code into the deep learning model deployed in the first deep learning framework;
在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息;Train the deep learning model in the first deep learning framework, and capture the information of the first intermediate variable set of the deep learning model through the data capture code;
根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。Determine the test result of the first deep learning framework according to the information of the first intermediate variable set.
在一种可能的实现方式中,所述根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果,包括:In a possible implementation, determining the test result of the first deep learning framework based on the information of the first intermediate variable set includes:
获得基准值;Get the base value;
将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。Compare the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述获得基准值,包括:在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;Obtaining the benchmark value includes: injecting the data capture code into the deep learning model deployed in the second deep learning framework; training the deep learning model in the second deep learning framework, and passing The data capture code captures the information of the second intermediate variable set of the deep learning model;
所述将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果,包括:将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。Comparing the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework includes: comparing the information of the first intermediate variable set with the second intermediate variable Compare the set of information to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;The first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework;
所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。The second intermediate variable set includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;The information of the first parameter set includes: values and/or gradients of parameters in the first parameter set;
所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。The information of the second parameter set includes: values and/or gradients of parameters in the second parameter set.
在一种可能的实现方式中,In one possible implementation,
所述通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,包括:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;The method of using the data grabbing code to capture the information of the first intermediate variable set of the deep learning model includes: using the data grabbing code to capture the depth information trained in the first deep learning framework. The output value of the non-last network layer of the learning model;
所述通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息,包括:通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。The method of using the data grabbing code to capture the information of the second intermediate variable set of the deep learning model includes: using the data grabbing code to capture the depth information trained in the second deep learning framework. The output value of the non-last network layer of the learning model.
在一种可能的实现方式中,In one possible implementation,
所述方法还包括:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;The method further includes: using the data grabbing code to capture the first output value of the last network layer of the deep learning model trained in the first deep learning framework; using the data grabbing code to capture Taking the second output value of the last network layer of the deep learning model trained in the second deep learning framework;
所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。Comparing the information of the first intermediate variable set with the information of the second intermediate variable set and determining the test result of the first deep learning framework includes: based on the information of the first intermediate variable set, The information of the second intermediate variable set, the first output value and the second output value determine the test result of the first deep learning framework.
在一种可能的实现方式中,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:In a possible implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes:
对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;For a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, determine a difference value between the first intermediate variable and the second intermediate variable;
其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。Wherein, the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在一种可能的实现方式中,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:In a possible implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes:
对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;Taking the absolute values of the elements in the first intermediate variable and summing them up, the sum of the elements of the first intermediate variable is obtained;
对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。The absolute values of the elements in the second intermediate variable are taken and then summed to obtain the sum of the elements of the second intermediate variable.
在一种可能的实现方式中,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:In a possible implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes:
根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。The total number of elements in the first intermediate variable or the second intermediate variable is determined according to the first intermediate variable or the second intermediate variable.
在一种可能的实现方式中,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:In a possible implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes:
确定所述第一中间变量与所述第二中间变量之间的标准差异值;determining a standard difference value between the first intermediate variable and the second intermediate variable;
确定所述标准差异值中,值大于预设阈值的元素的第一数量。A first number of elements whose values are greater than a preset threshold among the standard difference values is determined.
在一种可能的实现方式中,所述确定所述第一中间变量与所述第二中间变量之间的标准差异值,包括:In a possible implementation, determining the standard difference value between the first intermediate variable and the second intermediate variable includes:
确定所述第一中间变量与所述第二中间变量的差值的绝对值;Determine the absolute value of the difference between the first intermediate variable and the second intermediate variable;
确定预设的公差比率与所述第一中间变量的绝对值的乘积;determining a product of a preset tolerance ratio and the absolute value of the first intermediate variable;
将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。The product is subtracted from the absolute value of the difference to obtain a standard difference value between the first intermediate variable and the second intermediate variable.
在一种可能的实现方式中,在所述确定所述标准差异值中,值大于预设阈值的元素的第一数量之后,所述方法还包括:In a possible implementation, after determining the first number of elements whose values are greater than a preset threshold in the standard difference values, the method further includes:
确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。A ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable is determined.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a baseline deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。In a possible implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
根据本公开的一方面,提供了一种深度学习框架的测试装置,包括:According to one aspect of the present disclosure, a testing device for a deep learning framework is provided, including:
数据抓取模块,用于在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息;A data capture module, configured to inject data capture code into the deep learning model deployed in the first deep learning framework, train the deep learning model in the first deep learning framework, and capture the data through the The code captures the information of the first intermediate variable set of the deep learning model;
精度对比模块,用于根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。An accuracy comparison module, configured to determine the test result of the first deep learning framework based on the information of the first intermediate variable set.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块还用于:获得基准值;The data capture module is also used to: obtain the benchmark value;
所述精度对比模块具体用于:将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。The accuracy comparison module is specifically configured to compare the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块具体用于:在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;The data capture module is specifically configured to: inject the data capture code into the deep learning model deployed in the second deep learning framework; train the deep learning model in the second deep learning framework, And capture the information of the second intermediate variable set of the deep learning model through the data capture code;
所述精度对比模块具体用于:将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。The accuracy comparison module is specifically configured to compare the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;The first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework;
所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。The second intermediate variable set includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;The information of the first parameter set includes: values and/or gradients of parameters in the first parameter set;
所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。The information of the second parameter set includes: values and/or gradients of parameters in the second parameter set.
在一种可能的实现方式中,所述数据抓取模块具体用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;In a possible implementation, the data capture module is specifically configured to: capture the non-last network layer of the deep learning model trained in the first deep learning framework through the data capture code. the output value;
通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。The output value of the non-last network layer of the deep learning model trained in the second deep learning framework is captured through the data grabbing code.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块还用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;The data capture module is also configured to: capture the first output value of the last network layer of the deep learning model trained in the first deep learning framework through the data capture code; The grabbing code grabs the second output value of the last network layer of the deep learning model trained in the second deep learning framework;
所述精度对比模块具体用于:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。The accuracy comparison module is specifically configured to: determine the first depth based on the information of the first intermediate variable set, the information of the second intermediate variable set, the first output value and the second output value. Test results of the learning framework.
在一种可能的实现方式中,所述精度对比模块具体用于:In a possible implementation, the accuracy comparison module is specifically used to:
对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;For a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, determine a difference value between the first intermediate variable and the second intermediate variable;
其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。Wherein, the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在一种可能的实现方式中,所述精度对比模块具体用于:In a possible implementation, the accuracy comparison module is specifically used to:
对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;Taking the absolute values of the elements in the first intermediate variable and summing them up, the sum of the elements of the first intermediate variable is obtained;
对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。The absolute values of the elements in the second intermediate variable are taken and then summed to obtain the sum of the elements of the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块具体用于:In a possible implementation, the accuracy comparison module is specifically used to:
根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。The total number of elements in the first intermediate variable or the second intermediate variable is determined according to the first intermediate variable or the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块具体用于:In a possible implementation, the accuracy comparison module is specifically used to:
确定所述第一中间变量与所述第二中间变量之间的标准差异值;determining a standard difference value between the first intermediate variable and the second intermediate variable;
确定所述标准差异值中,值大于预设阈值的元素的第一数量。A first number of elements whose values are greater than a preset threshold among the standard difference values is determined.
在一种可能的实现方式中,所述精度对比模块具体用于:In a possible implementation, the accuracy comparison module is specifically used to:
确定所述第一中间变量与所述第二中间变量的差值的绝对值;Determine the absolute value of the difference between the first intermediate variable and the second intermediate variable;
确定预设的公差比率与所述第一中间变量的绝对值的乘积;determining a product of a preset tolerance ratio and the absolute value of the first intermediate variable;
将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。The product is subtracted from the absolute value of the difference to obtain a standard difference value between the first intermediate variable and the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块还用于:In a possible implementation, the accuracy comparison module is also used to:
确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。A ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable is determined.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a baseline deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。In a possible implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
根据本公开的一方面,提供了一种深度学习框架的测试装置,包括:According to one aspect of the present disclosure, a testing device for a deep learning framework is provided, including:
注入模块,用于在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码;The injection module is used to inject data capture code into the deep learning model deployed in the first deep learning framework;
抓取模块,用于在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息;A capture module, configured to train the deep learning model in the first deep learning framework, and capture the information of the first intermediate variable set of the deep learning model through the data capture code;
确定模块,用于根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。A determination module, configured to determine the test result of the first deep learning framework according to the information of the first intermediate variable set.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
获得基准值;Get the base value;
将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。Compare the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;Inject the data capture code into the deep learning model deployed in the second deep learning framework;
在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;Train the deep learning model in the second deep learning framework, and capture the information of the second intermediate variable set of the deep learning model through the data capture code;
将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。Compare the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;The first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework;
所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。The second intermediate variable set includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;The information of the first parameter set includes: values and/or gradients of parameters in the first parameter set;
所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。The information of the second parameter set includes: values and/or gradients of parameters in the second parameter set.
在一种可能的实现方式中,In one possible implementation,
所述抓取模块具体用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;The capture module is specifically configured to: capture the output value of the non-last network layer of the deep learning model trained in the first deep learning framework through the data capture code;
所述确定模块具体用于:通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。The determination module is specifically configured to: use the data capture code to capture the output value of the non-last network layer of the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述抓取模块还用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;The crawling module is also configured to: crawl through the data crawling code the first output value of the last network layer of the deep learning model trained in the first deep learning framework; crawl through the data Get the code to capture the second output value of the last network layer of the deep learning model trained in the second deep learning framework;
所述确定模块具体用于:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。The determination module is specifically configured to: determine the first deep learning based on the information of the first intermediate variable set, the information of the second intermediate variable set, the first output value and the second output value. Framework test results.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;For a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, determine a difference value between the first intermediate variable and the second intermediate variable;
其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。Wherein, the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;Taking the absolute values of the elements in the first intermediate variable and summing them up, the sum of the elements of the first intermediate variable is obtained;
对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。The absolute values of the elements in the second intermediate variable are taken and then summed to obtain the sum of the elements of the second intermediate variable.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。The total number of elements in the first intermediate variable or the second intermediate variable is determined according to the first intermediate variable or the second intermediate variable.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
确定所述第一中间变量与所述第二中间变量之间的标准差异值;determining a standard difference value between the first intermediate variable and the second intermediate variable;
确定所述标准差异值中,值大于预设阈值的元素的第一数量。A first number of elements whose values are greater than a preset threshold among the standard difference values is determined.
在一种可能的实现方式中,所述确定模块具体用于:In a possible implementation, the determining module is specifically used to:
确定所述第一中间变量与所述第二中间变量的差值的绝对值;Determine the absolute value of the difference between the first intermediate variable and the second intermediate variable;
确定预设的公差比率与所述第一中间变量的绝对值的乘积;determining a product of a preset tolerance ratio and the absolute value of the first intermediate variable;
将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。The product is subtracted from the absolute value of the difference to obtain a standard difference value between the first intermediate variable and the second intermediate variable.
在一种可能的实现方式中,所述确定模块还用于:In a possible implementation, the determining module is also used to:
确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。A ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable is determined.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a benchmark deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。In a possible implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
根据本公开的一方面,提供了一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。According to an aspect of the present disclosure, an electronic device is provided, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the memory to store executable instructions to perform the above method.
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to an aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above method is implemented.
根据本公开的一方面,提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。According to an aspect of the present disclosure, a computer program product is provided, including computer readable code, or a non-volatile computer readable storage medium carrying the computer readable code, when the computer readable code is in an electronic device When running, the processor in the electronic device executes the above method.
在本公开实施例中,通过在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,并根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果,由此通过数据抓取代码抓取在深度学习框架中训练的深度学习模型的中间变量集的信息,能够提供在深度学习框架训练的深度学习模型的详细信息,有助于用户判断深度学习模型的精度的高低是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估不同深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。另外,本公开实施例无需在深度学习框架上对深度学习模型进行完整的训练,例如,可以只训练一次迭代(iteration),由此能够节省对深度学习框架进行评估的时间,实现迅速的深度学习框架评估,从而能够进一步提高深度学习框架开发和优化的效率。其中,一次迭代可以表示深度学习模型在一批数据上进行一次前向传播和反向传播。通过采用本公开实施例提供的深度学习框架的测试方法,用户能够快速、准确地验证自研的深度学习框架的功能和可靠性,大大提高了开发和优化深度学习框架的效率。此外,本发明提供的深度学习框架的测试方法易于使用,只需要注入数据抓取代码,无需进行复杂的设置和操作。In an embodiment of the present disclosure, by injecting data capture code into the deep learning model deployed in the first deep learning framework, the deep learning model is trained in the first deep learning framework, and through the data capture The code captures the information of the first intermediate variable set of the deep learning model, and determines the test result of the first deep learning framework based on the information of the first intermediate variable set, thereby capturing through the data capture code The information on the intermediate variable set of the deep learning model trained in the deep learning framework can provide detailed information of the deep learning model trained in the deep learning framework, and help users determine which layer or layer determines the accuracy of the deep learning model. Which step of operation is triggered, so that the source of the accuracy difference can be traced, and the accuracy and functions of different deep learning frameworks can be accurately evaluated, and the efficiency of deep learning framework development and optimization can be improved. In addition, embodiments of the present disclosure do not require complete training of the deep learning model on the deep learning framework. For example, only one iteration can be trained, thereby saving time for evaluating the deep learning framework and achieving rapid deep learning. Framework evaluation, thereby further improving the efficiency of deep learning framework development and optimization. Among them, one iteration can mean that the deep learning model performs forward propagation and back propagation on a batch of data. By using the deep learning framework testing method provided by the embodiments of the present disclosure, users can quickly and accurately verify the function and reliability of the self-developed deep learning framework, which greatly improves the efficiency of developing and optimizing the deep learning framework. In addition, the testing method of the deep learning framework provided by the present invention is easy to use and only needs to inject data capture code without complicated settings and operations.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, and are not restrictive of the disclosure.
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings herein are incorporated into and constitute a part of this specification. They illustrate embodiments consistent with the disclosure and, together with the description, serve to explain the technical solutions of the disclosure.
图1示出本公开实施例提供的深度学习框架的测试方法的流程图。Figure 1 shows a flow chart of a testing method of a deep learning framework provided by an embodiment of the present disclosure.
图2示出本公开实施例提供的深度学习框架的测试方法中,第一深度学习框架为自研的深度学习框架,第二深度学习框架为基准深度学习框架的示意图。Figure 2 shows a schematic diagram of the testing method of the deep learning framework provided by the embodiment of the present disclosure. The first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a benchmark deep learning framework.
图3示出本公开实施例提供的深度学习框架的测试方法中,第一深度学习框架和第二深度学习框架为基于不同计算平台的同一类型的深度学习框架的示意图。Figure 3 shows a schematic diagram of the first deep learning framework and the second deep learning framework being the same type of deep learning framework based on different computing platforms in the testing method of the deep learning framework provided by the embodiment of the present disclosure.
图4示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的一示意图。FIG. 4 shows a schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure.
图5示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的另一示意图。FIG. 5 shows another schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure.
图6示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的另一示意图。Figure 6 shows another schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure.
图7示出本公开实施例提供的深度学习框架的测试装置的一框图。FIG. 7 shows a block diagram of a testing device of the deep learning framework provided by an embodiment of the present disclosure.
图8示出本公开实施例提供的深度学习框架的测试装置的另一框图。FIG. 8 shows another block diagram of a testing device of the deep learning framework provided by an embodiment of the present disclosure.
图9示出本公开实施例提供的电子设备1900的框图。FIG. 9 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the drawings identify functionally identical or similar elements. Although various aspects of the embodiments are illustrated in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" as used herein means "serving as an example, example, or illustrative." Any embodiment described herein as "exemplary" is not necessarily to be construed as superior or superior to other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship that describes related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and they exist alone. B these three situations. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, and C, which can mean including from A, Any one or more elements selected from the set composed of B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better explain the present disclosure, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits that are well known to those skilled in the art are not described in detail in order to emphasize the subject matter of the disclosure.
相关技术中,评估深度学习框架精度的方式包括在各个深度学习框架下训练同一深度学习模型,并在相同的数据集上进行评估。这种方法虽然直观,但无法提供精度差异的具体信息,例如,无法判断差异是由哪一层或哪一步操作引发的,也无法衡量差异的具体程度。此外,此方法的时间成本高,需要在每个深度学习框架上都进行完整的模型训练和评估。In related technologies, the method of evaluating the accuracy of a deep learning framework includes training the same deep learning model under each deep learning framework and evaluating it on the same data set. Although this method is intuitive, it cannot provide specific information about the accuracy difference. For example, it cannot determine which layer or step operation the difference is caused by, nor can it measure the specific degree of the difference. Furthermore, this approach is time-costly and requires complete model training and evaluation on each deep learning framework.
为了解决类似上文所述的技术问题,本公开实施例提供了一种深度学习框架的测试方法,通过在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,并根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果,由此通过数据抓取代码抓取在深度学习框架中训练的深度学习模型的中间变量集的信息,能够提供在深度学习框架训练的深度学习模型的详细信息,有助于用户判断深度学习模型的精度的高低是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估不同深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。另外,本公开实施例无需在深度学习框架上对深度学习模型进行完整的训练,例如,可以只训练一次迭代(iteration),由此能够节省对深度学习框架进行评估的时间,实现迅速的深度学习框架评估,从而能够进一步提高深度学习框架开发和优化的效率。其中,一次迭代可以表示深度学习模型在一批数据上进行一次前向传播和反向传播。In order to solve technical problems similar to those described above, embodiments of the present disclosure provide a method for testing a deep learning framework by injecting data capture code into the deep learning model deployed in the first deep learning framework. The deep learning model is trained in the first deep learning framework, the information of the first intermediate variable set of the deep learning model is captured through the data capture code, and the information of the first intermediate variable set is determined based on the information of the first intermediate variable set. The test results of the first deep learning framework are described, whereby the information of the intermediate variable set of the deep learning model trained in the deep learning framework is captured through the data grabbing code, and detailed information of the deep learning model trained in the deep learning framework can be provided. , helps users determine which layer or step operation causes the accuracy of the deep learning model, so that the source of the accuracy difference can be traced, and the accuracy and functions of different deep learning frameworks can be accurately evaluated, and the deep learning framework can be improved. Development and optimization efficiency. In addition, embodiments of the present disclosure do not require complete training of the deep learning model on the deep learning framework. For example, only one iteration can be trained, thereby saving time for evaluating the deep learning framework and achieving rapid deep learning. Framework evaluation, thereby further improving the efficiency of deep learning framework development and optimization. Among them, one iteration can mean that the deep learning model performs forward propagation and back propagation on a batch of data.
通过采用本公开实施例提供的深度学习框架的测试方法,用户能够快速、准确地验证自研的深度学习框架的功能和可靠性,大大提高了开发和优化深度学习框架的效率。此外,本发明提供的深度学习框架的测试方法易于使用,只需要注入数据抓取代码,无需进行复杂的设置和操作。By using the deep learning framework testing method provided by the embodiments of the present disclosure, users can quickly and accurately verify the function and reliability of the self-developed deep learning framework, which greatly improves the efficiency of developing and optimizing the deep learning framework. In addition, the testing method of the deep learning framework provided by the present invention is easy to use and only needs to inject data capture code without complicated settings and operations.
下面结合附图对本公开实施例提供的深度学习框架的测试方法进行详细的说明。The testing method of the deep learning framework provided by the embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.
图1示出本公开实施例提供的深度学习框架的测试方法的流程图。在一种可能的实现方式中,所述深度学习框架的测试方法的执行主体可以是深度学习框架的测试装置,例如,所述深度学习框架的测试方法可以由终端设备或服务器或其它电子设备执行。其中,终端设备可以是用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备或者可穿戴设备等。在一种可能的实现方式中,所述深度学习框架的测试方法的执行主体可以是深度学习框架的测试工具。在一些可能的实现方式中,所述深度学习框架的测试方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。如图1所示,所述深度学习框架的测试方法包括步骤S11至步骤S13。Figure 1 shows a flow chart of a testing method of a deep learning framework provided by an embodiment of the present disclosure. In a possible implementation, the execution subject of the testing method of the deep learning framework may be a testing device of the deep learning framework. For example, the testing method of the deep learning framework may be executed by a terminal device or a server or other electronic equipment. . The terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device or a portable device. Wearable devices, etc. In a possible implementation, the execution subject of the testing method of the deep learning framework may be a testing tool of the deep learning framework. In some possible implementations, the testing method of the deep learning framework can be implemented by the processor calling computer-readable instructions stored in the memory. As shown in Figure 1, the testing method of the deep learning framework includes steps S11 to S13.
在步骤S11中,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码。In step S11, data grabbing code is injected into the deep learning model deployed in the first deep learning framework.
在步骤S12中,在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息。In step S12, the deep learning model is trained in the first deep learning framework, and the information of the first intermediate variable set of the deep learning model is captured through the data capture code.
在步骤S13中,根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。In step S13, the test result of the first deep learning framework is determined based on the information of the first intermediate variable set.
在本公开实施例中,深度学习框架可以表示用于设计、训练、验证深度学习模型的软件库。在一些应用场景中,深度学习框架也可以称为深度学习训练框架等,在此不做限定。In embodiments of the present disclosure, a deep learning framework may represent a software library for designing, training, and validating deep learning models. In some application scenarios, the deep learning framework may also be called a deep learning training framework, etc., which is not limited here.
本公开实施例中的第一深度学习框架可以为开源的深度学习框架,如TensorFlow、PyTorch、Caffe、Keras、Theano、CNTK、MXNet等,也可以为自研的深度学习框架。The first deep learning framework in the embodiment of the present disclosure may be an open source deep learning framework, such as TensorFlow, PyTorch, Caffe, Keras, Theano, CNTK, MXNet, etc., or it may be a self-developed deep learning framework.
在本公开实施例中,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码。In embodiments of the present disclosure, data grabbing code is injected into the deep learning model deployed in the first deep learning framework.
在一种可能的实现方式中,可以在部署在第一深度学习框架的深度学习模型中的多个网络层注入数据抓取代码,以抓取所述多个网络层对应的中间变量的信息,得到第一中间变量集的信息。例如,可以在部署在第一深度学习框架的深度学习模型中的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第一中间变量集的信息。又如,可以在部署在第一深度学习框架的深度学习模型中包含中间变量的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第一中间变量集的信息。In a possible implementation, data capture code can be injected into multiple network layers deployed in the deep learning model of the first deep learning framework to capture information on intermediate variables corresponding to the multiple network layers, Get the information of the first intermediate variable set. For example, data capture code can be injected into each network layer deployed in the deep learning model of the first deep learning framework to capture information on intermediate variables corresponding to each network layer and obtain information on the first intermediate variable set. For another example, data capture code can be injected into each network layer containing intermediate variables in the deep learning model deployed in the first deep learning framework to capture the information of the intermediate variables corresponding to each network layer to obtain the first intermediate variable. collection of information.
在一种可能的实现方式中,数据抓取代码可以称为hook(钩子)。其中,hook是一种处理机制,通常是一个函数,它可以在一个特定事件或条件发生时被调用,或者在特定点插入到正常程序流程中。在深度学习框架中,hook可以被用来在模型的特定层或阶段捕获中间变量。In one possible implementation, the data fetching code can be called a hook. Among them, a hook is a processing mechanism, usually a function, that can be called when a specific event or condition occurs, or inserted into the normal program flow at a specific point. In deep learning frameworks, hooks can be used to capture intermediate variables at specific layers or stages of the model.
在一个例子中,在使用MMCV训练的情况下,数据抓取代码可以为:In an example, in the case of training using MMCV, the data scraping code can be:
在一种可能的实现方式中,可以通过深度学习框架的测试工具中的数据抓取模块,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码。In one possible implementation, the data grabbing code can be injected into the deep learning model deployed in the first deep learning framework through the data grabbing module in the testing tool of the deep learning framework.
在一种可能的实现方式中,可以通过深度学习框架的测试工具中的数据抓取模块,抓取在所述第一深度学习框架中训练的所述深度学习模型的第一中间变量集的信息。In a possible implementation, the information of the first intermediate variable set of the deep learning model trained in the first deep learning framework can be captured through the data capture module in the testing tool of the deep learning framework. .
在一种可能的实现方式中,在部署在第一深度学习框架的深度学习模型的每一层进行前向传播和反向传播时,可以通过数据抓取代码抓取该层的中间变量。In a possible implementation, when each layer of the deep learning model deployed in the first deep learning framework performs forward propagation and back propagation, the intermediate variables of this layer can be captured through the data grabbing code.
在一种可能的实现方式中,在通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息之后,可以存储第一中间变量集的信息。In a possible implementation, after the information of the first intermediate variable set of the deep learning model is captured through the data capture code, the information of the first intermediate variable set may be stored.
在一种可能的实现方式中,所述根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果,包括:获得基准值;将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。In a possible implementation, determining the test result of the first deep learning framework based on the information of the first intermediate variable set includes: obtaining a benchmark value; Compare with the benchmark value to determine the test result of the first deep learning framework.
在该实现方式中,基准值可以表示用于确定第一深度学习框架的测试结果的基准的值。作为该实现方式的一个示例,可以在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码,在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息,并将第二中间变量集的信息作为基准值。作为该实现方式的另一个示例,基准值可以为预设值。In this implementation, the baseline value may represent a value of a baseline used to determine the test results of the first deep learning framework. As an example of this implementation, the data grabbing code can be injected into the deep learning model deployed in the second deep learning framework, the deep learning model can be trained in the second deep learning framework, and The information of the second intermediate variable set of the deep learning model is captured through the data capture code, and the information of the second intermediate variable set is used as a reference value. As another example of this implementation, the reference value may be a preset value.
在该实现方式中,通过在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,获得基准值,并将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果,由此能够基准值判断精度差异是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。In this implementation, by injecting data capture code into the deep learning model deployed in the first deep learning framework, the deep learning model is trained in the first deep learning framework, and the data capture code is The code captures the information of the first intermediate variable set of the deep learning model, obtains a benchmark value, and compares the information of the first intermediate variable set with the benchmark value to determine the test result of the first deep learning framework , from which the benchmark value can be used to determine which layer or step of operation the accuracy difference is caused by, so that the source of the accuracy difference can be traced, and then the accuracy and function of the deep learning framework can be accurately evaluated, and the efficiency of the development and optimization of the deep learning framework can be improved. .
在一种可能的实现方式中,所述获得基准值,包括:在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;所述将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果,包括:将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。In a possible implementation, obtaining the benchmark value includes: injecting the data capture code into the deep learning model deployed in the second deep learning framework; in the second deep learning framework Train the deep learning model, and capture the information of the second intermediate variable set of the deep learning model through the data capture code; compare the information of the first intermediate variable set with the reference value, Determining the test result of the first deep learning framework includes: comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework.
在该实现方式中,第二深度学习框架可以为开源的深度学习框架,如TensorFlow、PyTorch、Caffe、Keras、Theano、CNTK、MXNet等,也可以为自研的深度学习框架。In this implementation, the second deep learning framework can be an open source deep learning framework, such as TensorFlow, PyTorch, Caffe, Keras, Theano, CNTK, MXNet, etc., or it can be a self-developed deep learning framework.
在该实现方式中,基准值包括第二中间变量集的信息。In this implementation, the reference value includes information for the second set of intermediate variables.
在该实现方式中,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码。In this implementation, the data crawling code is injected into the deep learning model deployed in the first deep learning framework, and the data crawling code is injected into the deep learning model deployed in the second deep learning framework. .
作为该实现方式的一个示例,可以在部署在第一深度学习框架的深度学习模型中的多个网络层注入数据抓取代码,以抓取所述多个网络层对应的中间变量的信息,得到第一中间变量集的信息;可以在部署在第二深度学习框架的深度学习模型中的多个网络层注入数据抓取代码,以抓取所述多个网络层对应的中间变量的信息,得到第二中间变量集的信息。例如,可以在部署在第一深度学习框架的深度学习模型中的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第一中间变量集的信息;可以在部署在第二深度学习框架的深度学习模型中的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第二中间变量集的信息。又如,可以在部署在第一深度学习框架的深度学习模型中包含中间变量的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第一中间变量集的信息;可以在部署在第二深度学习框架的深度学习模型中包含中间变量的各个网络层注入数据抓取代码,以抓取所述各个网络层对应的中间变量的信息,得到第二中间变量集的信息。As an example of this implementation, data capture code can be injected into multiple network layers deployed in the deep learning model of the first deep learning framework to capture information about intermediate variables corresponding to the multiple network layers, and we obtain The information of the first intermediate variable set; data capture code can be injected into multiple network layers deployed in the deep learning model of the second deep learning framework to capture the information of the intermediate variables corresponding to the multiple network layers, and we obtain Information about the second intermediate variable set. For example, data capture code can be injected into each network layer in the deep learning model deployed in the first deep learning framework to capture the information of the intermediate variables corresponding to each network layer to obtain the information of the first intermediate variable set; Data capture code can be injected into each network layer in the deep learning model deployed in the second deep learning framework to capture information on intermediate variables corresponding to each network layer and obtain information on the second intermediate variable set. For another example, data capture code can be injected into each network layer containing intermediate variables in the deep learning model deployed in the first deep learning framework to capture the information of the intermediate variables corresponding to each network layer to obtain the first intermediate variable. set of information; the data capture code can be injected into each network layer containing intermediate variables in the deep learning model deployed in the second deep learning framework to capture the information of the intermediate variables corresponding to each network layer to obtain the second intermediate Variable set information.
在该实现方式中,通过在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息,将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,由此通过数据抓取代码抓取在两个深度学习框架中训练的同一深度学习模型的中间变量集的信息,能够提供深度学习框架的精度差异的具体信息,有助于用户判断差异是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估不同深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。另外,本公开实施例无需在深度学习框架上对深度学习模型进行完整的训练,例如,可以只训练一次迭代(iteration),由此能够节省对深度学习框架进行评估的时间,实现迅速的深度学习框架评估,从而能够进一步提高深度学习框架开发和优化的效率。其中,一次迭代可以表示深度学习模型在一批数据上进行一次前向传播和反向传播。In this implementation, the data grabbing code is injected into the deep learning model deployed in the first deep learning framework, and the data grabbing code is injected into the deep learning model deployed in the second deep learning framework. Code to train the deep learning model in the first deep learning framework, and capture the information of the first intermediate variable set of the deep learning model through the data capture code, and in the second deep learning framework Train the deep learning model, capture the information of the second intermediate variable set of the deep learning model through the data capture code, and combine the information of the first intermediate variable set with the second intermediate variable set. Compare the information to determine the test results of the first deep learning framework, thereby using the data capture code to capture the information of the intermediate variable set of the same deep learning model trained in the two deep learning frameworks, which can provide deep learning The specific information about the accuracy difference of the framework can help users determine which layer or step operation the difference is caused by, so that the source of the accuracy difference can be traced, and the accuracy and functions of different deep learning frameworks can be accurately evaluated to improve deep learning. Efficiency in framework development and optimization. In addition, embodiments of the present disclosure do not require complete training of the deep learning model on the deep learning framework. For example, only one iteration can be trained, thereby saving time for evaluating the deep learning framework and achieving rapid deep learning. Framework evaluation, thereby further improving the efficiency of deep learning framework development and optimization. Among them, one iteration can mean that the deep learning model performs forward propagation and back propagation on a batch of data.
该实现方式提供的深度学习框架的测试方法既可以提供深度学习模型训练过程中的详细信息,也能够快速、高效地进行多个深度学习框架之间的精度对比。通过采用该实现方式提供的深度学习框架的测试方法,用户能够快速、准确地验证自研的深度学习框架的功能和可靠性,大大提高了开发和优化深度学习框架的效率。此外,该实现方式提供的深度学习框架的测试方法易于使用,只需要注入数据抓取代码,无需进行复杂的设置和操作。The testing method of the deep learning framework provided by this implementation can not only provide detailed information during the training process of the deep learning model, but also quickly and efficiently compare the accuracy between multiple deep learning frameworks. By using the testing method of the deep learning framework provided by this implementation, users can quickly and accurately verify the functionality and reliability of the self-developed deep learning framework, greatly improving the efficiency of developing and optimizing the deep learning framework. In addition, the testing method of the deep learning framework provided by this implementation is easy to use, and only needs to inject data grabbing code, without the need for complex settings and operations.
作为该实现方式的一个示例,可以通过深度学习框架的测试工具中的数据抓取模块,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码。As an example of this implementation, the data grabbing module in the test tool of the deep learning framework can be used to inject the data grabbing code into the deep learning model deployed in the first deep learning framework, and then inject the data grabbing code into the deep learning model deployed in the second deep learning framework. Inject the data capture code into the deep learning model of the learning framework.
作为该实现方式的一个示例,可以通过深度学习框架的测试工具中的数据抓取模块,抓取在所述第一深度学习框架中训练的所述深度学习模型的第一中间变量集的信息,以及在所述第二深度学习框架中训练的所述深度学习模型的第二中间变量集的信息。As an example of this implementation, the information of the first intermediate variable set of the deep learning model trained in the first deep learning framework can be captured through the data capture module in the testing tool of the deep learning framework, and information about a second set of intermediate variables of the deep learning model trained in the second deep learning framework.
作为该实现方式的一个示例,在部署在第一深度学习框架的深度学习模型的每一层进行前向传播和反向传播时,可以通过数据抓取代码抓取该层的中间变量;在部署在第二深度学习框架的深度学习模型的每一层进行前向传播和反向传播时,可以通过数据抓取代码抓取该层的中间变量。As an example of this implementation, when each layer of the deep learning model deployed in the first deep learning framework performs forward propagation and back propagation, the intermediate variables of this layer can be captured through the data grabbing code; when deploying When each layer of the deep learning model of the second deep learning framework performs forward propagation and back propagation, the intermediate variables of this layer can be captured through the data grabbing code.
作为该实现方式的一个示例,在通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息之后,可以存储第一中间变量集的信息;在通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息之后,可以存储第二中间变量集的信息。As an example of this implementation, after the information of the first intermediate variable set of the deep learning model is captured through the data capture code, the information of the first intermediate variable set can be stored; After the code captures the information of the second intermediate variable set of the deep learning model, the information of the second intermediate variable set can be stored.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a baseline deep learning framework.
在该实现方式中,第一深度学习框架可以为自研的、待测试的深度学习框架,第二深度学习框架可以为基准深度学习框架。例如,第二深度学习框架可以为TensorFlow、PyTorch、Caffe等等。In this implementation, the first deep learning framework may be a self-developed deep learning framework to be tested, and the second deep learning framework may be a benchmark deep learning framework. For example, the second deep learning framework can be TensorFlow, PyTorch, Caffe, etc.
例如,某公司开发了一款深度学习框架,希望其性能超越开源的深度学习框架。那么,可以将该公司开发的深度学习框架作为第一深度学习框架,将某一开源的深度学习框架(例如PyTorch)作为第二深度学习框架。For example, a company has developed a deep learning framework and hopes that its performance will exceed that of open source deep learning frameworks. Then, the deep learning framework developed by the company can be used as the first deep learning framework, and a certain open source deep learning framework (such as PyTorch) can be used as the second deep learning framework.
图2示出本公开实施例提供的深度学习框架的测试方法中,第一深度学习框架为自研的深度学习框架,第二深度学习框架为基准深度学习框架的示意图。在图2所示的示例中,可以将自研的深度学习框架作为第一深度学习框架,将Pytorch作为第二深度学习框架。可以在部署在自研的深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在Pytorch的所述深度学习模型中,注入所述数据抓取代码。可以通过所述数据抓取代码抓取在自研的深度学习框架中训练的所述深度学习模型在一个训练迭代中的中间变量的信息,得到第一中间变量集的信息;可以通过所述数据抓取代码抓取在Pytorch中训练的所述深度学习模型在一个训练迭代中的中间变量的信息,得到第二中间变量集的信息。可以对第一中间变量集的信息和第二中间变量集的信息进行比较,得到自研的深度学习框架的测试结果。Figure 2 shows a schematic diagram of the testing method of the deep learning framework provided by the embodiment of the present disclosure. The first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a benchmark deep learning framework. In the example shown in Figure 2, you can use the self-developed deep learning framework as the first deep learning framework and Pytorch as the second deep learning framework. The data capture code can be injected into the deep learning model deployed in the self-developed deep learning framework, and the data capture code can be injected into the deep learning model deployed in Pytorch. The information of the intermediate variables in a training iteration of the deep learning model trained in the self-developed deep learning framework can be captured through the data capture code to obtain the information of the first intermediate variable set; the information of the first intermediate variable set can be obtained through the data The capture code captures the information of the intermediate variables in one training iteration of the deep learning model trained in Pytorch, and obtains the information of the second intermediate variable set. The information of the first intermediate variable set can be compared with the information of the second intermediate variable set to obtain the test results of the self-developed deep learning framework.
通过采用该实现方式,能够提供自研的深度学习框架与基准深度学习框架之间的精度差异的具体信息,从而用户可以针对性地对自研的深度学习框架进行调优和改进。By adopting this implementation method, specific information about the accuracy difference between the self-developed deep learning framework and the benchmark deep learning framework can be provided, so that users can tune and improve the self-developed deep learning framework in a targeted manner.
作为该实现方式的一个示例,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。As an example of this implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
其中,计算平台的类型可以为CPU、CUDA等等,在此不做限定。不同类型的计算平台对应于不同类型的计算设备。Among them, the type of computing platform can be CPU, CUDA, etc., which is not limited here. Different types of computing platforms correspond to different types of computing devices.
在该示例中,第一深度学习框架和第二深度学习框架基于同一类型的计算平台/运算架构进行训练或运算(计算)。例如,第一深度学习框架和第二深度学习框架均基于CPU进行训练或运算;又如,第一深度学习框架和第二深度学习框架均基于CUDA;等等。In this example, the first deep learning framework and the second deep learning framework perform training or calculation (computing) based on the same type of computing platform/computing architecture. For example, the first deep learning framework and the second deep learning framework are both based on CPU for training or operation; for example, the first deep learning framework and the second deep learning framework are both based on CUDA; and so on.
在该示例中,通过在所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架的情况下,使自研的深度学习框架和基准深度学习框架基于同一类型的计算平台进行训练或运算,由此有助于更准确地确定出自研的深度学习框架与基准深度学习框架之间的精度差异。In this example, when the first deep learning framework is a self-developed deep learning framework and the second deep learning framework is a benchmark deep learning framework, the self-developed deep learning framework and the benchmark deep learning framework are Training or computing based on the same type of computing platform helps to more accurately determine the accuracy difference between the self-developed deep learning framework and the benchmark deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
例如,第一深度学习框架和第二深度学习框架均为Pytorch,第一深度学习框架基于CPU,第二深度学习框架基于CUDA;又如,第一深度学习框架和第二深度学习框架均为TensorFlow,第一深度学习框架基于CUDA10.2,第二深度学习框架基于CUDA11.1;等等。For example, the first deep learning framework and the second deep learning framework are both Pytorch, the first deep learning framework is based on CPU, and the second deep learning framework is based on CUDA; for another example, the first deep learning framework and the second deep learning framework are both TensorFlow , the first deep learning framework is based on CUDA10.2, the second deep learning framework is based on CUDA11.1; and so on.
图3示出本公开实施例提供的深度学习框架的测试方法中,第一深度学习框架和第二深度学习框架为基于不同计算平台的同一类型的深度学习框架的示意图。在图3所示的示例中,第一深度学习框架和第二深度学习框架均为Pytorch,第一深度学习框架基于CPU,第二深度学习框架基于CUDA。可以在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码。可以通过所述数据抓取代码抓取在第一深度学习框架中训练的所述深度学习模型在一个训练迭代中的中间变量的信息,得到第一中间变量集的信息;可以通过所述数据抓取代码抓取在第二深度学习框架中训练的所述深度学习模型在一个训练迭代中的中间变量的信息,得到第二中间变量集的信息。可以对第一中间变量集的信息和第二中间变量集的信息进行比较,得到自研的深度学习框架的测试结果。Figure 3 shows a schematic diagram of the first deep learning framework and the second deep learning framework being the same type of deep learning framework based on different computing platforms in the testing method of the deep learning framework provided by the embodiment of the present disclosure. In the example shown in Figure 3, the first deep learning framework and the second deep learning framework are both Pytorch, the first deep learning framework is based on CPU, and the second deep learning framework is based on CUDA. The data scraping code may be injected into the deep learning model deployed in the first deep learning framework, and the data scraping code may be injected into the deep learning model deployed in the second deep learning framework. The information of the intermediate variables in a training iteration of the deep learning model trained in the first deep learning framework can be captured through the data capture code to obtain the information of the first intermediate variable set; the information of the first intermediate variable set can be obtained through the data capture The code is retrieved to capture the information of the intermediate variables in one training iteration of the deep learning model trained in the second deep learning framework, and obtain the information of the second intermediate variable set. The information of the first intermediate variable set can be compared with the information of the second intermediate variable set to obtain the test results of the self-developed deep learning framework.
通过采用该实现方式,能够提供基于不同计算平台的同一类型的深度学习框架之间的精度差异的具体信息。By adopting this implementation, it is possible to provide specific information on the accuracy differences between deep learning frameworks of the same type based on different computing platforms.
在一种可能的实现方式中,所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。In a possible implementation, the first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework; the second intermediate variable set It includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
其中,第一参数集可以包括所述深度学习模型的各网络层的可学习的参数(即待训练的参数),第二参数集可以包括所述深度学习模型的各网络层的可学习的参数(即待训练的参数)。由于在第一深度学习框架和第二深度学习框架上训练同一个深度学习模型,因此,第一参数集中的参数与第二参数集中的参数一一对应。The first parameter set may include learnable parameters of each network layer of the deep learning model (i.e., parameters to be trained), and the second parameter set may include learnable parameters of each network layer of the deep learning model. (i.e. the parameters to be trained). Since the same deep learning model is trained on the first deep learning framework and the second deep learning framework, the parameters in the first parameter set correspond to the parameters in the second parameter set one-to-one.
在该实现方式中,通过根据在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集的信息,以及在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集的信息,确定所述第一深度学习框架的测试结果,由此有助于用户判断精度差异是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估不同深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。In this implementation, by based on the information of the first parameter set to be trained in the deep learning model trained in the first deep learning framework, and the depth training in the second deep learning framework The information of the second parameter set to be trained in the learning model is determined to determine the test results of the first deep learning framework, thereby helping the user to determine which layer or step operation caused the accuracy difference, so that the accuracy difference can be traced It can accurately evaluate the accuracy and functions of different deep learning frameworks and improve the efficiency of deep learning framework development and optimization.
在一种可能的实现方式中,所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。In a possible implementation, the information of the first parameter set includes: the values and/or gradients of parameters in the first parameter set; the information of the second parameter set includes: the second parameter set The values and/or gradients of the parameters.
作为该实现方式的一个示例,所述第一参数集的信息包括:所述第一参数集中的参数的值;所述第二参数集的信息包括:所述第二参数集中的参数的值。As an example of this implementation, the information of the first parameter set includes: the values of the parameters in the first parameter set; the information of the second parameter set includes: the values of the parameters in the second parameter set.
在该示例中,通过根据在所述第一深度学习框架中训练的所述深度学习模型的第一参数集中的参数的值,以及在所述第二深度学习框架中训练的所述深度学习模型的第二参数集中的参数的值,确定所述第一深度学习框架的测试结果,由此有助于追踪和理解深度学习模型的训练过程和结果。In this example, by according to the values of parameters in the first parameter set of the deep learning model trained in the first deep learning framework, and the deep learning model trained in the second deep learning framework The values of the parameters in the second parameter set determine the test results of the first deep learning framework, thereby helping to track and understand the training process and results of the deep learning model.
作为该实现方式的另一个示例,所述第一参数集的信息包括:所述第一参数集中的参数的梯度;所述第二参数集的信息包括:所述第二参数集中的参数的梯度。As another example of this implementation, the information of the first parameter set includes: the gradient of the parameters in the first parameter set; the information of the second parameter set includes: the gradient of the parameters in the second parameter set. .
在该示例中,通过根据在所述第一深度学习框架中训练的所述深度学习模型的第一参数集中的参数的梯度,以及在所述第二深度学习框架中训练的所述深度学习模型的第二参数集中的参数的梯度,确定所述第一深度学习框架的测试结果,由此有助于追踪和理解深度学习模型的训练过程和结果。In this example, by according to the gradient of the parameters in the first parameter set of the deep learning model trained in the first deep learning framework, and the deep learning model trained in the second deep learning framework The gradient of the parameters in the second parameter set determines the test result of the first deep learning framework, thereby helping to track and understand the training process and results of the deep learning model.
作为该实现方式的另一个示例,所述第一参数集的信息包括:所述第一参数集中的参数的值和梯度;所述第二参数集的信息包括:所述第二参数集中的参数的值和梯度。As another example of this implementation, the information of the first parameter set includes: the values and gradients of the parameters in the first parameter set; the information of the second parameter set includes: the parameters of the second parameter set values and gradients.
在该示例中,通过根据在所述第一深度学习框架中训练的所述深度学习模型的第一参数集中的参数的值和梯度,以及在所述第二深度学习框架中训练的所述深度学习模型的第二参数集中的参数的值和梯度,确定所述第一深度学习框架的测试结果,由此有助于追踪和理解深度学习模型的训练过程和结果。In this example, by based on the values and gradients of parameters in the first parameter set of the deep learning model trained in the first deep learning framework, and the deep learning model trained in the second deep learning framework The values and gradients of parameters in the second parameter set of the learning model determine the test results of the first deep learning framework, thereby helping to track and understand the training process and results of the deep learning model.
在一种可能的实现方式中,所述通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息,包括:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;所述通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息,包括:通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。In a possible implementation, using the data grabbing code to capture the information of the first intermediate variable set of the deep learning model includes: using the data grabbing code to capture the first set of intermediate variables in the deep learning model. The output value of the non-last network layer of the deep learning model trained in the deep learning framework; the information of the second intermediate variable set of the deep learning model captured through the data capture code includes: The data capture code captures the output value of the non-last network layer of the deep learning model trained in the second deep learning framework.
在该实现方式中,所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出;所述第一中间变量集的信息包括:在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出;所述第二中间变量集的信息包括:在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。In this implementation, the first intermediate variable set includes: the output of the non-last network layer of the deep learning model trained in the first deep learning framework; the information of the first intermediate variable set includes : the output value of the non-last network layer of the deep learning model trained in the first deep learning framework; the second intermediate variable set includes: the depth of the deep learning model trained in the second deep learning framework The output of the non-last network layer of the learning model; the information of the second intermediate variable set includes: the output value of the non-last network layer of the deep learning model trained in the second deep learning framework.
即,在该实现方式中,第一中间变量集可以包括:在所述第一深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出;第二中间变量集可以包括:在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出。That is, in this implementation, the first intermediate variable set may include: the output of the first network layer to the penultimate network layer of the deep learning model trained in the first deep learning framework; the second The intermediate variable set may include: outputs from the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
第一中间变量集的信息可以包括:在所述第一深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出值;第二中间变量集的信息可以包括:在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出值。The information of the first intermediate variable set may include: the output values from the first network layer to the penultimate network layer of the deep learning model trained in the first deep learning framework; the information of the second intermediate variable set It may include: output values from the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
在该实现方式中,通过根据在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值,以及在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值,确定所述第一深度学习框架的测试结果,由此有助于用户判断精度差异是由哪一层或哪一步操作引发,从而能够追溯精度差异的源头,进而能够精确地评估不同深度学习框架的精度和功能,提高深度学习框架开发和优化的效率。In this implementation, by based on the output value of the non-last network layer of the deep learning model trained in the first deep learning framework, and the deep learning trained in the second deep learning framework The output value of the non-last network layer of the model determines the test result of the first deep learning framework, thereby helping the user to determine which layer or step operation caused the accuracy difference, so that the source of the accuracy difference can be traced , which can accurately evaluate the accuracy and functionality of different deep learning frameworks and improve the efficiency of deep learning framework development and optimization.
在另一种可能的实现方式中,所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型的非第一个网络层的输入;所述第一中间变量集的信息包括:在所述第一深度学习框架中训练的所述深度学习模型的非第一个网络层的输入值;所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型的非第一个网络层的输入;所述第二中间变量集的信息包括:在所述第二深度学习框架中训练的所述深度学习模型的非第一个网络层的输入值。In another possible implementation, the first intermediate variable set includes: inputs from non-first network layers of the deep learning model trained in the first deep learning framework; the first intermediate variable set The information of the variable set includes: the input values of non-first network layers of the deep learning model trained in the first deep learning framework; the second intermediate variable set includes: the input values of the non-first network layer of the deep learning model trained in the first deep learning framework; The input of the non-first network layer of the deep learning model trained in the second deep learning framework; the information of the second intermediate variable set includes: the non-first network layer of the deep learning model trained in the second deep learning framework. The input value of the network layer.
在该实现方式中,第一中间变量集可以包括:在所述第一深度学习框架中训练的所述深度学习模型的第二个网络层至最后一个网络层的输入;第二中间变量集可以包括:在所述第二深度学习框架中训练的所述深度学习模型的第二个网络层至最后一个网络层的输入。In this implementation, the first intermediate variable set may include: inputs from the second network layer to the last network layer of the deep learning model trained in the first deep learning framework; the second intermediate variable set may Including: inputs from the second network layer to the last network layer of the deep learning model trained in the second deep learning framework.
第一中间变量集的信息可以包括:在所述第一深度学习框架中训练的所述深度学习模型的第二个网络层至最后一个网络层的输入值;第二中间变量集的信息可以包括:在所述第二深度学习框架中训练的所述深度学习模型的第二个网络层至最后一个网络层的输入值。The information of the first intermediate variable set may include: input values from the second network layer to the last network layer of the deep learning model trained in the first deep learning framework; the information of the second intermediate variable set may include : the input values from the second network layer to the last network layer of the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,第一中间变量集可以包括:在第一深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数,以及在第一深度学习框架中训练的所述深度学习模型第一个网络层至倒数第二个网络层的输出;第二中间变量集可以包括:在第二深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数,以及在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出。In a possible implementation, the first intermediate variable set may include: learnable parameters of each network layer of the deep learning model trained in the first deep learning framework, and The output of the first network layer to the penultimate network layer of the deep learning model; the second intermediate variable set may include: the learnable values of each network layer of the deep learning model trained in the second deep learning framework parameters, and the outputs of the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
第一中间变量集的信息可以包括:在第一深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数的值和所述参数的梯度,以及在第一深度学习框架中训练的所述深度学习模型第一个网络层至倒数第二个网络层的输出值;第二中间变量集的信息可以包括:在第二深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数的值和所述参数的梯度,以及在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出值。The information of the first intermediate variable set may include: values of learnable parameters of each network layer of the deep learning model trained in the first deep learning framework and gradients of the parameters, and in the first deep learning framework The output values of the first network layer to the penultimate network layer of the trained deep learning model; the information of the second intermediate variable set may include: each network of the deep learning model trained in the second deep learning framework The values of the learnable parameters of the layer and the gradient of the parameters, as well as the output values of the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,所述方法还包括:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。In a possible implementation, the method further includes: using the data capture code to capture the first output value of the last network layer of the deep learning model trained in the first deep learning framework. ; Capture the second output value of the last network layer of the deep learning model trained in the second deep learning framework through the data grabbing code; said combining the information of the first intermediate variable set with Comparing the information of the second intermediate variable set to determine the test result of the first deep learning framework includes: based on the information of the first intermediate variable set, the information of the second intermediate variable set, the third An output value and the second output value determine the test result of the first deep learning framework.
在该实现方式中,第一输出值可以表示在所述第一深度学习框架中训练的所述深度学习模型的最终的输出结果,第二输出值可以表示在所述第二深度学习框架中训练的所述深度学习模型的最终的输出结果。In this implementation, the first output value may represent the final output result of the deep learning model trained in the first deep learning framework, and the second output value may represent the final output result of the deep learning model trained in the second deep learning framework. The final output result of the deep learning model.
在该实现方式中,通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值,通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值,根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果,由此结合在所述第一深度学习框架中训练的所述深度学习模型的最终输出结果和在所述第二深度学习框架中训练的所述深度学习模型的最终输出结果,获得所述第一深度学习框架的测试结果,从而有助于更准确地评估待测试的深度学习框架的精度。In this implementation, the first output value of the last network layer of the deep learning model trained in the first deep learning framework is captured through the data grabbing code. Get the second output value of the last network layer of the deep learning model trained in the second deep learning framework, based on the information of the first intermediate variable set, the information of the second intermediate variable set, the The first output value and the second output value are used to determine the test result of the first deep learning framework, thereby combining the final output result of the deep learning model trained in the first deep learning framework and the The final output result of the deep learning model trained in the second deep learning framework is used to obtain the test results of the first deep learning framework, thereby helping to more accurately evaluate the accuracy of the deep learning framework to be tested.
在本公开实施例中,可以将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。通过向用户提供所述第一深度学习框架的测试结果,用户可以快速地发现第一深度学习框架与第二深度学习框架之间具体的精度差异,并可以针对性地进行调优和改进。In this embodiment of the present disclosure, the information of the first intermediate variable set can be compared with the information of the second intermediate variable set to determine the test result of the first deep learning framework. By providing the user with the test results of the first deep learning framework, the user can quickly discover the specific accuracy difference between the first deep learning framework and the second deep learning framework, and can perform targeted tuning and improvement.
在一种可能的实现方式中,可以通过深度学习框架的测试工具中的精度对比模块,将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。In a possible implementation, the information of the first intermediate variable set can be compared with the information of the second intermediate variable set through the accuracy comparison module in the testing tool of the deep learning framework to determine the third intermediate variable set. Test results of a deep learning framework.
在一种可能的实现方式中,可以从存储系统中读取所述第一中间变量集的信息和所述第二中间变量集的信息,以将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。In a possible implementation, the information of the first intermediate variable set and the information of the second intermediate variable set can be read from a storage system to compare the information of the first intermediate variable set with the information of the second intermediate variable set. The information of the second intermediate variable set is compared to determine the test result of the first deep learning framework.
在本公开实施例中,在获得所述第一中间变量集的信息和所述第二中间变量集的信息之后,可以对所述第一中间变量集的信息和所述第二中间变量集的信息中相应的中间变量的信息分别进行对比。In an embodiment of the present disclosure, after obtaining the information of the first intermediate variable set and the information of the second intermediate variable set, the information of the first intermediate variable set and the second intermediate variable set may be The information on the corresponding intermediate variables in the information is compared separately.
在一种可能的实现方式中,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。In a possible implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes: for the The first intermediate variable in the first intermediate variable set and the second intermediate variable in the second intermediate variable set are used to determine the difference value between the first intermediate variable and the second intermediate variable; wherein, the first intermediate variable An intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在该实现方式中,可以将第一中间变量和第二中间变量中相应的元素相减后取绝对值,得到该元素对应的差异值;可以对第一中间变量和第二中间变量中各元素对应的差异值进行求和,得到第一中间变量与第二中间变量之间的差异值。In this implementation, the corresponding elements in the first intermediate variable and the second intermediate variable can be subtracted and then the absolute value is obtained to obtain the difference value corresponding to the element; each element in the first intermediate variable and the second intermediate variable can be The corresponding difference values are summed to obtain the difference value between the first intermediate variable and the second intermediate variable.
在一个例子中,第一中间变量与第二中间变量之间的差异值可以采用L1_diff表示。In one example, the difference value between the first intermediate variable and the second intermediate variable may be represented by L1_diff.
在该实现方式中,所述第一深度学习框架的测试结果可以包括所述第一中间变量与所述第二中间变量之间的差异值。In this implementation, the test result of the first deep learning framework may include a difference value between the first intermediate variable and the second intermediate variable.
在该实现方式中,通过对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值,其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量,由此通过向用户提供在第一深度学习框架中训练的深度学习模型与在第二深度学习框架中训练的深度学习模型中相应的中间变量之间的差异值,有助于用户快速发现深度学习框架的瓶颈所在。In this implementation, for a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, a relationship between the first intermediate variable and the second intermediate variable is determined. The difference value of , wherein the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model, thereby providing the user with the deep learning model trained in the first deep learning framework and The difference values between corresponding intermediate variables in the deep learning model trained in the second deep learning framework help users quickly discover the bottleneck of the deep learning framework.
作为该实现方式的一个示例,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。As an example of this implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes: The elements in the first intermediate variable are taken as absolute values and then summed to obtain the sum of the elements of the first intermediate variable; the elements in the second intermediate variable are taken as absolute values and then summed to obtain the second intermediate variable The sum of the elements.
在一个例子中,第一中间变量的元素之和可以采用L1_data1表示,第二中间变量的元素之和可以采用L1_data2表示。In one example, the sum of the elements of the first intermediate variable can be represented by L1_data1, and the sum of the elements of the second intermediate variable can be represented by L1_data2.
在该示例中,所述第一深度学习框架的测试结果可以包括第一中间变量的元素之和和第二中间变量的元素之和。In this example, the test result of the first deep learning framework may include the sum of elements of the first intermediate variable and the sum of elements of the second intermediate variable.
在该示例中,通过对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和,对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和,由此通过向用户提供在第一深度学习框架中训练的深度学习模型与在第二深度学习框架中训练的深度学习模型中相应的中间变量的元素之和,有助于用户快速发现深度学习框架的瓶颈所在。In this example, by taking the absolute values of the elements in the first intermediate variable and summing them, for the first intermediate variable in the first intermediate variable set and the second intermediate variable in the second intermediate variable set, Obtain the sum of the elements of the first intermediate variable, take the absolute value of the elements in the second intermediate variable and sum them up to obtain the sum of the elements of the second intermediate variable, thereby providing the user with the first The sum of the elements of the deep learning model trained in the deep learning framework and the corresponding intermediate variables in the deep learning model trained in the second deep learning framework helps users quickly discover the bottlenecks of the deep learning framework.
作为该实现方式的一个示例,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。As an example of this implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes: according to the The first intermediate variable or the second intermediate variable determines the total number of elements in the first intermediate variable or the second intermediate variable.
由于第一中间变量和第二中间变量为深度学习模型中的同一中间变量,因此,第一中间变量中的元素总数等于第二中间变量中的元素总数。因此,在该示例中,可以根据第一中间变量,确定第一中间变量中的元素总数,或者可以根据第二中间变量,确定第二中间变量中的元素总数。Since the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model, the total number of elements in the first intermediate variable is equal to the total number of elements in the second intermediate variable. Thus, in this example, the total number of elements in the first intermediate variable may be determined based on the first intermediate variable, or the total number of elements in the second intermediate variable may be determined based on the second intermediate variable.
在一个例子中,所述第一中间变量或者所述第二中间变量中的元素总数可以采用total表示。In one example, the total number of elements in the first intermediate variable or the second intermediate variable may be represented by total.
在该示例中,所述第一深度学习框架的测试结果可以包括所述第一中间变量或者所述第二中间变量中的元素总数。In this example, the test result of the first deep learning framework may include the total number of elements in the first intermediate variable or the second intermediate variable.
在该示例中,通过对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数,由此用户可以直观地获知第一中间变量和第二中间变量中的元素数。In this example, by determining, for a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, the first intermediate variable or the second intermediate variable, The total number of elements in the first intermediate variable or the second intermediate variable, so that the user can intuitively know the number of elements in the first intermediate variable and the second intermediate variable.
作为该实现方式的一个示例,所述将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果,包括:确定所述第一中间变量与所述第二中间变量之间的标准差异值;确定所述标准差异值中,值大于预设阈值的元素的第一数量。As an example of this implementation, comparing the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework includes: determining the A standard difference value between the first intermediate variable and the second intermediate variable; determining a first number of elements in the standard difference value whose value is greater than a preset threshold.
在该示例中,标准差异值可以用于衡量相应的中间变量中的相应元素是否接近,即,可以用于衡量相应的中间变量中的相应元素之间的精度差异是否较大。In this example, the standard difference value can be used to measure whether the corresponding elements in the corresponding intermediate variables are close, that is, it can be used to measure whether the precision difference between the corresponding elements in the corresponding intermediate variables is large.
在一个例子中,标准差异值可以采用diff_v表示。In one example, the standard difference value can be expressed as diff_v.
在一个例子中,预设阈值包括0.01,所述标准差异值中值大于0.01的元素的第一数量可以采用0.01_n表示。In one example, the preset threshold includes 0.01, and the first number of elements with a value greater than 0.01 in the standard difference value can be represented by 0.01_n.
在另一个例子中,预设阈值包括0.001,所述标准差异值中值大于0.001的元素的第一数量可以采用0.001_n表示。In another example, the preset threshold includes 0.001, and the first number of elements with a value greater than 0.001 in the standard difference value can be represented by 0.001_n.
在另一个例子中,预设阈值包括0.0001,所述标准差异值中值大于0.0001的元素的第一数量可以采用0.0001_n表示。In another example, the preset threshold includes 0.0001, and the first number of elements with a value greater than 0.0001 in the standard difference value can be represented by 0.0001_n.
在另一个例子中,预设阈值包括0.00001,所述标准差异值中值大于0.00001的元素的第一数量可以采用0.00001_n表示。In another example, the preset threshold includes 0.00001, and the first number of elements with a value greater than 0.00001 in the standard difference value can be represented by 0.00001_n.
在该示例中,所述第一深度学习框架的测试结果可以包括所述第一中间变量与所述第二中间变量之间的标准差异值中,值大于预设阈值的元素的第一数量。In this example, the test results of the first deep learning framework may include a first number of elements whose values are greater than a preset threshold among the standard difference values between the first intermediate variable and the second intermediate variable.
在该示例中,通过对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的标准差异值,确定所述标准差异值中,值大于预设阈值的元素的第一数量,由此可以便于用户判断相应的中间变量中的相应元素是否接近。In this example, for a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, the distance between the first intermediate variable and the second intermediate variable is determined. The standard difference value determines the first number of elements whose value is greater than the preset threshold among the standard difference values, thereby facilitating the user to determine whether the corresponding elements in the corresponding intermediate variables are close.
在一个示例中,所述确定所述第一中间变量与所述第二中间变量之间的标准差异值,包括:确定所述第一中间变量与所述第二中间变量的差值的绝对值;确定预设的公差比率与所述第一中间变量的绝对值的乘积;将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。In one example, determining the standard difference value between the first intermediate variable and the second intermediate variable includes: determining the absolute value of the difference between the first intermediate variable and the second intermediate variable. ; Determine the product of the preset tolerance ratio and the absolute value of the first intermediate variable; subtract the product from the absolute value of the difference to obtain the relationship between the first intermediate variable and the second intermediate variable standard difference value.
例如,diff_v=|data1-data2|-rtol×|data1|,For example, diff_v=|data1-data2|-rtol×|data1|,
其中,diff_v表示标准差异值,data1表示第一中间变量,data2表示第二中间变量,rtol表示预设的公差比率。rtol×|data1|可以称为相对公差。Among them, diff_v represents the standard difference value, data1 represents the first intermediate variable, data2 represents the second intermediate variable, and rtol represents the preset tolerance ratio. rtol×|data1| can be called relative tolerance.
其中,预设的公差比率可以大于0且小于0.01。例如,预设的公差比率可以为0.00001等,在此不做限定。Among them, the preset tolerance ratio can be greater than 0 and less than 0.01. For example, the preset tolerance ratio can be 0.00001, etc., which is not limited here.
在一些应用场景中,预设的公差比率还可以称为相对容差等等,在此不做限定。In some application scenarios, the preset tolerance ratio may also be called relative tolerance, etc., which is not limited here.
在该示例中,通过确定所述第一中间变量与所述第二中间变量的差值的绝对值,确定预设的公差比率与所述第一中间变量的绝对值的乘积,并将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值,由此确定出的标准差异值有助于判断相应的中间变量中的相应元素是否接近。In this example, by determining the absolute value of the difference between the first intermediate variable and the second intermediate variable, the product of the preset tolerance ratio and the absolute value of the first intermediate variable is determined, and the The absolute value of the difference is subtracted from the product to obtain the standard difference value between the first intermediate variable and the second intermediate variable. The standard difference value determined thereby helps to determine the corresponding intermediate variable. Whether the corresponding elements are close.
在一个示例中,在所述确定所述标准差异值中,值大于预设阈值的元素的第一数量之后,所述方法还包括:确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。In one example, after determining a first number of elements whose values are greater than a preset threshold in the standard difference values, the method further includes: determining a relationship between the first number and the first intermediate variable or the first intermediate variable. The ratio of the total number of elements in the second intermediate variable.
在一个例子中,预设阈值包括0.01,所述标准差异值中值大于0.01的元素的第一数量可以采用0.01_n表示,所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值可以采用0.01_r表示。例如,所述标准差异值中值大于0.01的元素的第一数量为1000,第一中间变量中的元素为10000,则0.01_r=0.1。即,在第一中间变量和第二中间变量中,有10%的元素之间的精度差异较大。In one example, the preset threshold includes 0.01. The first number of elements with a value greater than 0.01 in the standard difference value can be expressed as 0.01_n. The first number is related to the first intermediate variable or the second intermediate variable. The ratio of the total number of elements in the variable can be expressed as 0.01_r. For example, if the first number of elements with a value greater than 0.01 in the standard difference value is 1000, and the elements in the first intermediate variable are 10000, then 0.01_r=0.1. That is, among the first intermediate variable and the second intermediate variable, 10% of the elements have a large accuracy difference.
在另一个例子中,预设阈值包括0.001,所述标准差异值中值大于0.001的元素的第一数量可以采用0.001_n表示,所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值可以采用0.001_r表示。In another example, the preset threshold includes 0.001, the first number of elements with a value greater than 0.001 in the standard difference value can be expressed as 0.001_n, and the first number is related to the first intermediate variable or the second The ratio of the total number of elements in the intermediate variable can be expressed as 0.001_r.
在另一个例子中,预设阈值包括0.0001,所述标准差异值中值大于0.0001的元素的第一数量可以采用0.0001_n表示,所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值可以采用0.0001_r表示。In another example, the preset threshold includes 0.0001, the first number of elements with a value greater than 0.0001 in the standard difference value can be represented by 0.0001_n, and the first number is related to the first intermediate variable or the second The ratio of the total number of elements in the intermediate variable can be expressed as 0.0001_r.
在另一个例子中,预设阈值包括0.00001,所述标准差异值中值大于0.00001的元素的第一数量可以采用0.00001_n表示,所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值可以采用0.00001_r表示。In another example, the preset threshold includes 0.00001, and the first number of elements with a value greater than 0.00001 in the standard difference value can be represented by 0.00001_n. The first number is related to the first intermediate variable or the second The ratio of the total number of elements in the intermediate variable can be expressed as 0.00001_r.
在该示例中,所述第一深度学习框架的测试结果可以包括所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。In this example, the test result of the first deep learning framework may include a ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable.
在该示例中,通过确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值,由此能够向用户提供第一中间变量和第二中间变量中精度差异较大的元素的比例。In this example, by determining the ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable, the accuracy in the first intermediate variable and the second intermediate variable can be provided to the user. The proportion of elements that differ greatly.
在一个示例中,所述方法还包括:响应于所述标准差异值中的任一元素的值大于预设阈值,发出提示信息。In one example, the method further includes: in response to the value of any element in the standard difference value being greater than a preset threshold, issuing prompt information.
在一种可能的实现方式中,在确定所述第一深度学习框架的测试结果之后,所述方法还可以包括:根据所述第一深度学习框架的测试结果,生成精度差值报表。In a possible implementation, after determining the test result of the first deep learning framework, the method may further include: generating an accuracy difference report based on the test result of the first deep learning framework.
图4示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的一示意图。图4为输出值和输入值对应的精度差值报表。在图4中,Item_Name可以表示中间变量的名称,feature后的编号可以表示网络层在深度学习模型中的位置,bottom可以表示输出值,top可以表示输入值,L1_data1可以表示第一中间变量的元素之和,L1_data2可以表示第二中间变量的元素之和,L1_diff可以表示第一中间变量与第二中间变量之间的差异值,total可以表示第一中间变量中的元素总数(即第二中间变量中的元素总数),0.01_n可以表示标准差异值中值大于0.01的元素的数量,0.001_n可以表示标准差异值中值大于0.001的元素的数量,0.0001_n可以表示标准差异值中值大于0.0001的元素的数量,0.00001_n可以表示标准差异值中值大于0.00001的元素的数量,0.01_r可以表示标准差异值中值大于0.01的元素的数量与第一中间变量中的元素总数的比值,0.001_r可以表示标准差异值中值大于0.001的元素的数量与第一中间变量中的元素总数的比值,0.0001_r可以表示标准差异值中值大于0.0001的元素的数量与第一中间变量中的元素总数的比值,0.00001_r可以表示标准差异值中值大于0.00001的元素的数量与第一中间变量中的元素总数的比值。FIG. 4 shows a schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure. Figure 4 shows the accuracy difference report corresponding to the output value and the input value. In Figure 4, Item_Name can represent the name of the intermediate variable, the number after feature can represent the position of the network layer in the deep learning model, bottom can represent the output value, top can represent the input value, and L1_data1 can represent the element of the first intermediate variable. L1_data2 can represent the sum of elements of the second intermediate variable, L1_diff can represent the difference value between the first intermediate variable and the second intermediate variable, and total can represent the total number of elements in the first intermediate variable (i.e., the second intermediate variable (the total number of elements in ), 0.01_n can represent the number of elements with a standard difference value greater than 0.01, 0.001_n can represent the number of elements with a standard difference value greater than 0.001, 0.0001_n can represent the standard difference value with a median value greater than 0.0001 The number of elements, 0.00001_n can represent the number of elements with a standard difference value greater than 0.00001, 0.01_r can represent the ratio of the number of elements with a standard difference value greater than 0.01 to the total number of elements in the first intermediate variable, 0.001_r can Represents the ratio of the number of elements with a median standard difference value greater than 0.001 to the total number of elements in the first intermediate variable. 0.0001_r can represent the ratio of the number of elements with a median standard difference value greater than 0.0001 to the total number of elements in the first intermediate variable. , 0.00001_r can represent the ratio of the number of elements with a standard difference value greater than 0.00001 to the total number of elements in the first intermediate variable.
图5示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的另一示意图。图5为参数的值对应的精度差值报表。在图5中,Item_Name可以表示中间变量的名称,feature后的编号可以表示网络层在深度学习模型中的位置,weight可以表示权重,bias可以表示偏置,L1_data1可以表示第一中间变量的元素之和,L1_data2可以表示第二中间变量的元素之和,L1_diff可以表示第一中间变量与第二中间变量之间的差异值,total可以表示第一中间变量中的元素总数(即第二中间变量中的元素总数),0.01_n可以表示标准差异值中值大于0.01的元素的数量,0.001_n可以表示标准差异值中值大于0.001的元素的数量,0.0001_n可以表示标准差异值中值大于0.0001的元素的数量,0.00001_n可以表示标准差异值中值大于0.00001的元素的数量,0.01_r可以表示标准差异值中值大于0.01的元素的数量与第一中间变量中的元素总数的比值,0.001_r可以表示标准差异值中值大于0.001的元素的数量与第一中间变量中的元素总数的比值,0.0001_r可以表示标准差异值中值大于0.0001的元素的数量与第一中间变量中的元素总数的比值,0.00001_r可以表示标准差异值中值大于0.00001的元素的数量与第一中间变量中的元素总数的比值。FIG. 5 shows another schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure. Figure 5 shows the accuracy difference report corresponding to the parameter value. In Figure 5, Item_Name can represent the name of the intermediate variable, the number after feature can represent the position of the network layer in the deep learning model, weight can represent the weight, bias can represent the bias, and L1_data1 can represent one of the elements of the first intermediate variable. and, L1_data2 can represent the sum of elements of the second intermediate variable, L1_diff can represent the difference value between the first intermediate variable and the second intermediate variable, and total can represent the total number of elements in the first intermediate variable (that is, in the second intermediate variable The total number of elements), 0.01_n can represent the number of elements with a standard difference value greater than 0.01, 0.001_n can represent the number of elements with a standard difference value greater than 0.001, 0.0001_n can represent the elements with a standard difference value greater than 0.0001 The number of elements, 0.00001_n can represent the number of elements with a standard difference value greater than 0.00001, 0.01_r can represent the ratio of the number of elements with a standard difference value greater than 0.01 to the total number of elements in the first intermediate variable, 0.001_r can represent The ratio of the number of elements with the median standard difference value greater than 0.001 to the total number of elements in the first intermediate variable. 0.0001_r can represent the ratio of the number of elements with the median standard difference value greater than 0.0001 to the total number of elements in the first intermediate variable. 0.00001_r can represent the ratio of the number of elements with a standard difference value greater than 0.00001 to the total number of elements in the first intermediate variable.
图6示出本公开实施例提供的深度学习框架的测试方法中,精度差值报表的另一示意图。图6为梯度对应的精度差值报表。在图6中,Item_Name可以表示中间变量的名称,weight可以表示权重,bias可以表示偏置,L1_data1可以表示第一中间变量的元素之和,L1_data2可以表示第二中间变量的元素之和,L1_diff可以表示第一中间变量与第二中间变量之间的差异值,total可以表示第一中间变量中的元素总数(即第二中间变量中的元素总数),0.01_n可以表示标准差异值中值大于0.01的元素的数量,0.001_n可以表示标准差异值中值大于0.001的元素的数量,0.0001_n可以表示标准差异值中值大于0.0001的元素的数量,0.00001_n可以表示标准差异值中值大于0.00001的元素的数量,0.01_r可以表示标准差异值中值大于0.01的元素的数量与第一中间变量中的元素总数的比值,0.001_r可以表示标准差异值中值大于0.001的元素的数量与第一中间变量中的元素总数的比值,0.0001_r可以表示标准差异值中值大于0.0001的元素的数量与第一中间变量中的元素总数的比值,0.00001_r可以表示标准差异值中值大于0.00001的元素的数量与第一中间变量中的元素总数的比值。Figure 6 shows another schematic diagram of an accuracy difference report in the testing method of the deep learning framework provided by the embodiment of the present disclosure. Figure 6 shows the accuracy difference report corresponding to the gradient. In Figure 6, Item_Name can represent the name of the intermediate variable, weight can represent the weight, bias can represent the bias, L1_data1 can represent the sum of the elements of the first intermediate variable, L1_data2 can represent the sum of the elements of the second intermediate variable, and L1_diff can Represents the difference value between the first intermediate variable and the second intermediate variable, total can represent the total number of elements in the first intermediate variable (that is, the total number of elements in the second intermediate variable), and 0.01_n can represent that the median standard difference value is greater than 0.01 The number of elements, 0.001_n can represent the number of elements with the standard difference value greater than 0.001, 0.0001_n can represent the number of elements with the standard difference value greater than 0.0001, 0.00001_n can represent the elements with the standard difference value greater than 0.00001 The number of The ratio of the total number of elements in , 0.0001_r can represent the ratio of the number of elements with the standard difference value greater than 0.0001 to the total number of elements in the first intermediate variable, 0.00001_r can represent the number of elements with the standard difference value greater than 0.00001 and The ratio of the total number of elements in the first intermediate variable.
本公开实施例提供的深度学习框架的测试方法可以应用于软件测试等技术领域,在此不做限定。本公开实施例提供的深度学习框架的测试方法可以应用于深度学习软件库、自动驾驶系统、图像识别或语音识别产品等,以优化其深度学习框架。The deep learning framework testing method provided by the embodiments of the present disclosure can be applied to technical fields such as software testing, and is not limited here. The deep learning framework testing method provided by the embodiments of the present disclosure can be applied to deep learning software libraries, autonomous driving systems, image recognition or speech recognition products, etc., to optimize their deep learning frameworks.
下面通过一个具体的应用场景说明本公开实施例提供的深度学习框架的测试方法。The following describes the testing method of the deep learning framework provided by the embodiment of the present disclosure through a specific application scenario.
在该应用场景中,某公司开发了一款深度学习框架,希望其性能超越开源的深度学习框架。在该应用场景中,可以将该公司开发的深度学习框架作为第一深度学习框架,将某一开源的深度学习框架(例如PyTorch)作为第二深度学习框架。In this application scenario, a company developed a deep learning framework and hoped that its performance would surpass the open source deep learning framework. In this application scenario, the deep learning framework developed by the company can be used as the first deep learning framework, and an open source deep learning framework (such as PyTorch) can be used as the second deep learning framework.
可以通过深度学习框架的测试工具的数据抓取模块,在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,并在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码。可以通过所述数据抓取模块,抓取在第一深度学习框架中训练的所述深度学习模型在一个训练迭代中的第一中间变量集的信息,以及在第二深度学习框架中训练的所述深度学习模型在一个训练迭代中的第二中间变量集的信息,并存储第一中间变量集的信息和第二中间变量集的信息。Through the data capture module of the test tool of the deep learning framework, the data capture code can be injected into the deep learning model deployed in the first deep learning framework, and in the deep learning model deployed in the second deep learning framework , inject the data scraping code. The data capture module can be used to capture the information of the first intermediate variable set of the deep learning model trained in the first deep learning framework in one training iteration, and all the information of the deep learning model trained in the second deep learning framework. Describe the information of the second intermediate variable set of the deep learning model in a training iteration, and store the information of the first intermediate variable set and the information of the second intermediate variable set.
其中,第一中间变量集可以包括:在第一深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数,以及在第一深度学习框架中训练的所述深度学习模型第一个网络层至倒数第二个网络层的输出;第二中间变量集可以包括:在第二深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数,以及在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出。Wherein, the first intermediate variable set may include: learnable parameters of each network layer of the deep learning model trained in the first deep learning framework, and the first deep learning model trained in the first deep learning framework. The output of one network layer to the penultimate network layer; the second intermediate variable set may include: the learnable parameters of each network layer of the deep learning model trained in the second deep learning framework, and the The output of the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
第一中间变量集的信息可以包括:在第一深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数的值和所述参数的梯度,以及在第一深度学习框架中训练的所述深度学习模型第一个网络层至倒数第二个网络层的输出值;第二中间变量集的信息可以包括:在第二深度学习框架中训练的所述深度学习模型的各网络层的可学习的参数的值和所述参数的梯度,以及在所述第二深度学习框架中训练的所述深度学习模型的第一个网络层至倒数第二个网络层的输出值。The information of the first intermediate variable set may include: values of learnable parameters of each network layer of the deep learning model trained in the first deep learning framework and gradients of the parameters, and in the first deep learning framework The output values of the first network layer to the penultimate network layer of the trained deep learning model; the information of the second intermediate variable set may include: each network of the deep learning model trained in the second deep learning framework The values of the learnable parameters of the layer and the gradient of the parameters, as well as the output values of the first network layer to the penultimate network layer of the deep learning model trained in the second deep learning framework.
在该应用场景中,可以根据所述第一中间变量集的信息和所述第二中间变量集的信息,确定第一深度学习框架的测试结果,并可以根据第一深度学习框架的测试结果快速定位精度差异,并指导优化。In this application scenario, the test results of the first deep learning framework can be determined based on the information of the first intermediate variable set and the information of the second intermediate variable set, and the test results of the first deep learning framework can be quickly Locate accuracy differences and guide optimization.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in this disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the details will not be described in this disclosure. Those skilled in the art can understand that in the above-mentioned methods of specific embodiments, the specific execution order of each step should be determined by its function and possible internal logic.
此外,本公开还提供了深度学习框架的测试装置、电子设备、计算机可读存储介质、计算机程序产品,上述均可用来实现本公开提供的任一种深度学习框架的测试方法,相应技术方案和技术效果可参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides a deep learning framework testing device, electronic equipment, computer-readable storage media, and computer program products. The above can be used to implement any deep learning framework testing method provided by the present disclosure. The corresponding technical solutions and For technical effects, please refer to the corresponding records in the methods section and will not be described again.
图7示出本公开实施例提供的深度学习框架的测试装置的一框图。如图7所示,所述深度学习框架的测试装置包括:FIG. 7 shows a block diagram of a testing device of the deep learning framework provided by an embodiment of the present disclosure. As shown in Figure 7, the testing device of the deep learning framework includes:
数据抓取模块71,用于在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码,在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息;The data capture module 71 is configured to inject data capture code into the deep learning model deployed in the first deep learning framework, train the deep learning model in the first deep learning framework, and capture the data through the data capture module. Get the code to capture the information of the first intermediate variable set of the deep learning model;
精度对比模块72,用于根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。The accuracy comparison module 72 is configured to determine the test result of the first deep learning framework based on the information of the first intermediate variable set.
在本公开实施例中,所述深度学习框架的测试装置也可以称为深度学习框架的测试工具。In the embodiment of the present disclosure, the testing device of the deep learning framework may also be called a testing tool of the deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块71还用于:获得基准值;The data capture module 71 is also used to: obtain the reference value;
所述精度对比模块72具体用于:将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。The accuracy comparison module 72 is specifically configured to compare the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块71具体用于:在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;The data capture module 71 is specifically configured to: inject the data capture code into the deep learning model deployed in the second deep learning framework; train the deep learning model in the second deep learning framework , and capture the information of the second intermediate variable set of the deep learning model through the data capture code;
所述精度对比模块72具体用于:将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。The accuracy comparison module 72 is specifically configured to compare the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;The first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework;
所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。The second intermediate variable set includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;The information of the first parameter set includes: values and/or gradients of parameters in the first parameter set;
所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。The information of the second parameter set includes: values and/or gradients of parameters in the second parameter set.
在一种可能的实现方式中,所述数据抓取模块71具体用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;In a possible implementation, the data capture module 71 is specifically configured to: capture the non-last network of the deep learning model trained in the first deep learning framework through the data capture code. The output value of the layer;
通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。The output value of the non-last network layer of the deep learning model trained in the second deep learning framework is captured through the data grabbing code.
在一种可能的实现方式中,In one possible implementation,
所述数据抓取模块71还用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;The data capture module 71 is also configured to: capture the first output value of the last network layer of the deep learning model trained in the first deep learning framework through the data capture code; The data capture code captures the second output value of the last network layer of the deep learning model trained in the second deep learning framework;
所述精度对比模块72具体用于:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。The accuracy comparison module 72 is specifically configured to: determine the first output value according to the information of the first intermediate variable set, the information of the second intermediate variable set, the first output value and the second output value. Test results of deep learning frameworks.
在一种可能的实现方式中,所述精度对比模块72具体用于:In a possible implementation, the accuracy comparison module 72 is specifically used to:
对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;For a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, determine a difference value between the first intermediate variable and the second intermediate variable;
其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。Wherein, the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在一种可能的实现方式中,所述精度对比模块72具体用于:In a possible implementation, the accuracy comparison module 72 is specifically used to:
对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;Taking the absolute values of the elements in the first intermediate variable and summing them up, the sum of the elements of the first intermediate variable is obtained;
对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。The absolute values of the elements in the second intermediate variable are taken and then summed to obtain the sum of the elements of the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块72具体用于:In a possible implementation, the accuracy comparison module 72 is specifically used to:
根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。The total number of elements in the first intermediate variable or the second intermediate variable is determined according to the first intermediate variable or the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块72具体用于:In a possible implementation, the accuracy comparison module 72 is specifically used to:
确定所述第一中间变量与所述第二中间变量之间的标准差异值;determining a standard difference value between the first intermediate variable and the second intermediate variable;
确定所述标准差异值中,值大于预设阈值的元素的第一数量。A first number of elements whose values are greater than a preset threshold among the standard difference values is determined.
在一种可能的实现方式中,所述精度对比模块72具体用于:In a possible implementation, the accuracy comparison module 72 is specifically used to:
确定所述第一中间变量与所述第二中间变量的差值的绝对值;Determine the absolute value of the difference between the first intermediate variable and the second intermediate variable;
确定预设的公差比率与所述第一中间变量的绝对值的乘积;determining a product of a preset tolerance ratio and the absolute value of the first intermediate variable;
将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。The product is subtracted from the absolute value of the difference to obtain a standard difference value between the first intermediate variable and the second intermediate variable.
在一种可能的实现方式中,所述精度对比模块72还用于:In a possible implementation, the accuracy comparison module 72 is also used to:
确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。A ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable is determined.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a benchmark deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。In a possible implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
图8示出本公开实施例提供的深度学习框架的测试装置的另一框图。如图8所示,所述深度学习框架的测试装置包括:FIG. 8 shows another block diagram of a testing device of the deep learning framework provided by an embodiment of the present disclosure. As shown in Figure 8, the testing device of the deep learning framework includes:
注入模块81,用于在部署在第一深度学习框架的深度学习模型中,注入数据抓取代码;Injection module 81 is used to inject data capture code into the deep learning model deployed in the first deep learning framework;
抓取模块82,用于在所述第一深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第一中间变量集的信息;The capture module 82 is used to train the deep learning model in the first deep learning framework, and capture the information of the first intermediate variable set of the deep learning model through the data capture code;
确定模块83,用于根据所述第一中间变量集的信息,确定所述第一深度学习框架的测试结果。The determination module 83 is configured to determine the test result of the first deep learning framework according to the information of the first intermediate variable set.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determining module 83 is specifically used to:
获得基准值;Get the base value;
将所述第一中间变量集的信息与所述基准值对比,确定所述第一深度学习框架的测试结果。Compare the information of the first intermediate variable set with the reference value to determine the test result of the first deep learning framework.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determination module 83 is specifically used to:
在部署在第二深度学习框架的所述深度学习模型中,注入所述数据抓取代码;Inject the data grabbing code into the deep learning model deployed in the second deep learning framework;
在所述第二深度学习框架中训练所述深度学习模型,并通过所述数据抓取代码抓取所述深度学习模型的第二中间变量集的信息;Train the deep learning model in the second deep learning framework, and capture the information of the second intermediate variable set of the deep learning model through the data capture code;
将所述第一中间变量集的信息与所述第二中间变量集的信息进行对比,确定所述第一深度学习框架的测试结果。Compare the information of the first intermediate variable set with the information of the second intermediate variable set to determine the test result of the first deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一中间变量集包括:在所述第一深度学习框架中训练的所述深度学习模型中待训练的第一参数集;The first intermediate variable set includes: a first parameter set to be trained in the deep learning model trained in the first deep learning framework;
所述第二中间变量集包括:在所述第二深度学习框架中训练的所述深度学习模型中待训练的第二参数集。The second intermediate variable set includes: a second parameter set to be trained in the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述第一参数集的信息包括:所述第一参数集中的参数的值和/或梯度;The information of the first parameter set includes: values and/or gradients of parameters in the first parameter set;
所述第二参数集的信息包括:所述第二参数集中的参数的值和/或梯度。The information of the second parameter set includes: values and/or gradients of parameters in the second parameter set.
在一种可能的实现方式中,In one possible implementation,
所述抓取模块82具体用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值;The capture module 82 is specifically configured to: capture the output value of the non-last network layer of the deep learning model trained in the first deep learning framework through the data capture code;
所述确定模块83具体用于:通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的非最后一个网络层的输出值。The determination module 83 is specifically configured to: use the data capture code to capture the output value of the non-last network layer of the deep learning model trained in the second deep learning framework.
在一种可能的实现方式中,In one possible implementation,
所述抓取模块82还用于:通过所述数据抓取代码抓取在所述第一深度学习框架中训练的所述深度学习模型的最后一个网络层的第一输出值;通过所述数据抓取代码抓取在所述第二深度学习框架中训练的所述深度学习模型的最后一个网络层的第二输出值;The capture module 82 is also configured to: capture the first output value of the last network layer of the deep learning model trained in the first deep learning framework through the data capture code; The grabbing code grabs the second output value of the last network layer of the deep learning model trained in the second deep learning framework;
所述确定模块83具体用于:根据所述第一中间变量集的信息、所述第二中间变量集的信息、所述第一输出值和所述第二输出值,确定所述第一深度学习框架的测试结果。The determination module 83 is specifically configured to: determine the first depth according to the information of the first intermediate variable set, the information of the second intermediate variable set, the first output value and the second output value. Test results of the learning framework.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determining module 83 is specifically used to:
对于所述第一中间变量集中的第一中间变量和所述第二中间变量集中的第二中间变量,确定所述第一中间变量与所述第二中间变量之间的差异值;For a first intermediate variable in the first intermediate variable set and a second intermediate variable in the second intermediate variable set, determine a difference value between the first intermediate variable and the second intermediate variable;
其中,所述第一中间变量和所述第二中间变量为所述深度学习模型中的同一中间变量。Wherein, the first intermediate variable and the second intermediate variable are the same intermediate variable in the deep learning model.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determining module 83 is specifically used to:
对所述第一中间变量中的元素取绝对值后求和,得到所述第一中间变量的元素之和;Taking the absolute values of the elements in the first intermediate variable and summing them up, the sum of the elements of the first intermediate variable is obtained;
对所述第二中间变量中的元素取绝对值后求和,得到所述第二中间变量的元素之和。The absolute values of the elements in the second intermediate variable are taken and then summed to obtain the sum of the elements of the second intermediate variable.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determining module 83 is specifically used to:
根据所述第一中间变量或者所述第二中间变量,确定所述第一中间变量或者所述第二中间变量中的元素总数。The total number of elements in the first intermediate variable or the second intermediate variable is determined according to the first intermediate variable or the second intermediate variable.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determination module 83 is specifically used to:
确定所述第一中间变量与所述第二中间变量之间的标准差异值;determining a standard difference value between the first intermediate variable and the second intermediate variable;
确定所述标准差异值中,值大于预设阈值的元素的第一数量。A first number of elements whose values are greater than a preset threshold among the standard difference values is determined.
在一种可能的实现方式中,所述确定模块83具体用于:In a possible implementation, the determining module 83 is specifically used to:
确定所述第一中间变量与所述第二中间变量的差值的绝对值;Determine the absolute value of the difference between the first intermediate variable and the second intermediate variable;
确定预设的公差比率与所述第一中间变量的绝对值的乘积;determining a product of a preset tolerance ratio and the absolute value of the first intermediate variable;
将所述差值的绝对值减去所述乘积,得到所述第一中间变量与所述第二中间变量之间的标准差异值。The product is subtracted from the absolute value of the difference to obtain a standard difference value between the first intermediate variable and the second intermediate variable.
在一种可能的实现方式中,所述确定模块83还用于:In a possible implementation, the determining module 83 is also used to:
确定所述第一数量与所述第一中间变量或者所述第二中间变量中的元素总数的比值。A ratio of the first quantity to the total number of elements in the first intermediate variable or the second intermediate variable is determined.
在一种可能的实现方式中,所述第一深度学习框架为自研的深度学习框架,所述第二深度学习框架为基准深度学习框架。In a possible implementation, the first deep learning framework is a self-developed deep learning framework, and the second deep learning framework is a baseline deep learning framework.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架基于同一类型的计算平台进行训练或运算。In a possible implementation, the first deep learning framework and the second deep learning framework are trained or operated based on the same type of computing platform.
在一种可能的实现方式中,所述第一深度学习框架和所述第二深度学习框架为基于不同计算平台的同一类型的深度学习框架。In a possible implementation, the first deep learning framework and the second deep learning framework are the same type of deep learning framework based on different computing platforms.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现和技术效果可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiment. For its specific implementation and technical effects, refer to the description of the above method embodiment. It’s concise and I won’t go into details here.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。其中,所述计算机可读存储介质可以是非易失性计算机可读存储介质,或者可以是易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above method is implemented. Wherein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
本公开实施例还提出一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。An embodiment of the present disclosure also provides a computer program, which includes a computer readable code. When the computer readable code is run in an electronic device, a processor in the electronic device executes the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。Embodiments of the present disclosure also provide a computer program product, including computer readable code, or a non-volatile computer readable storage medium carrying the computer readable code, when the computer readable code is run in an electronic device , the processor in the electronic device executes the above method.
本公开实施例还提供一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。An embodiment of the present disclosure also provides an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the executable instructions stored in the memory. instructions to execute the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, a server, or other forms of equipment.
图9示出本公开实施例提供的电子设备1900的框图。例如,电子设备1900可以被提供为一服务器或一终端。参照图9,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 9 shows a block diagram of an electronic device 1900 provided by an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal. Referring to FIG. 9 , electronic device 1900 includes a processing component 1922 , which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, executable by processing component 1922 . The application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the above-described methods.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入/输出接口1958(I/O接口)。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows ServerTM),苹果公司推出的基于图形用户界面操作系统(MacOS XTM),多用户多进程的计算机操作系统(UnixTM),自由和开放原代码的类Unix操作系统(LinuxTM),开放原代码的类Unix操作系统(FreeBSDTM)或类似。Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input/output interface 1958 (I/O interface). The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft server operating system (Windows Server TM ), a graphical user interface-based operating system (MacOS X TM ) introduced by Apple, a multi-user multi-process computer operating system ( Unix TM ), a free and open source Unix-like operating system (Linux TM ), an open source Unix-like operating system (FreeBSD TM ) or similar.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the above method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure may be a system, method, and/or computer program product. A computer program product may include a computer-readable storage medium having thereon computer-readable program instructions for causing a processor to implement aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。Computer-readable storage media may be tangible devices that can retain and store instructions for use by an instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or Flash memory), Static Random Access Memory (SRAM), Compact Disk Read Only Memory (CD-ROM), Digital Versatile Disk (DVD), Memory Stick, Floppy Disk, Mechanical Coding Device, such as a printer with instructions stored on it. Protruding structures in hole cards or grooves, and any suitable combination of the above. As used herein, computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to various computing/processing devices, or to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage on a computer-readable storage medium in the respective computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for performing operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source code or object code written in any combination of object-oriented programming languages - such as Smalltalk, C++, etc., and conventional procedural programming languages - such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server implement. In situations involving remote computers, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as an Internet service provider through the Internet). connect). In some embodiments, by utilizing state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can Computer readable program instructions are executed to implement various aspects of the disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, thereby producing a machine that, when executed by the processor of the computer or other programmable data processing apparatus, , resulting in an apparatus that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium. These instructions cause the computer, programmable data processing device and/or other equipment to work in a specific manner. Therefore, the computer-readable medium storing the instructions includes An article of manufacture that includes instructions that implement aspects of the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other equipment, causing a series of operating steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executed on a computer, other programmable data processing apparatus, or other equipment to implement the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions that contains one or more components for implementing the specified logical function(s). Executable instructions. In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two consecutive blocks may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts. , or can be implemented using a combination of specialized hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be implemented specifically through hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a Software Development Kit (SDK), etc. wait.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。The above description of various embodiments tends to emphasize the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described again here.
若本公开实施例的技术方案涉及个人信息,应用本公开实施例的技术方案的产品在处理个人信息前,已明确告知个人信息处理规则,并取得个人自主同意。若本公开实施例的技术方案涉及敏感个人信息,应用本公开实施例的技术方案的产品在处理敏感个人信息前,已取得个人单独同意,并且同时满足“明示同意”的要求。例如,在摄像头等个人信息采集装置处,设置明确显著的标识告知已进入个人信息采集范围,将会对个人信息进行采集,若个人自愿进入采集范围即视为同意对其个人信息进行采集;或者在个人信息处理的装置上,利用明显的标识/信息告知个人信息处理规则的情况下,通过弹窗信息或请个人自行上传其个人信息等方式获得个人授权;其中,个人信息处理规则可包括个人信息处理者、个人信息处理目的、处理方式以及处理的个人信息种类等信息。If the technical solutions of the disclosed embodiments involve personal information, the products applying the technical solutions of the disclosed embodiments must clearly inform the personal information processing rules and obtain the individual's independent consent before processing the personal information. If the technical solutions of the embodiments of the present disclosure involve sensitive personal information, the products applying the technical solutions of the embodiments of the present disclosure must obtain the individual's separate consent before processing the sensitive personal information, and at the same time meet the requirement of "express consent". For example, setting up clear and conspicuous signs on personal information collection devices such as cameras to inform them that they have entered the scope of personal information collection, and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed to have agreed to the collection of his or her personal information; or On personal information processing devices, when using obvious logos/information to inform personal information processing rules, obtain personal authorization through pop-up messages or asking individuals to upload their personal information; among them, personal information processing rules may include personal information processing rules. Information such as information processors, purposes of processing personal information, methods of processing, and types of personal information processed.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。The embodiments of the present disclosure have been described above. The above description is illustrative, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311459183.9A CN117312173A (en) | 2023-11-03 | 2023-11-03 | Deep learning framework testing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311459183.9A CN117312173A (en) | 2023-11-03 | 2023-11-03 | Deep learning framework testing method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117312173A true CN117312173A (en) | 2023-12-29 |
Family
ID=89242801
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311459183.9A Pending CN117312173A (en) | 2023-11-03 | 2023-11-03 | Deep learning framework testing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117312173A (en) |
-
2023
- 2023-11-03 CN CN202311459183.9A patent/CN117312173A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12001823B2 (en) | Systems and methods for building and deploying machine learning applications | |
US9760469B2 (en) | Analysis of program code | |
CN103984626A (en) | Method and device for generating test-case script | |
US9582270B2 (en) | Effective feature location in large legacy systems | |
CN108415826A (en) | Test method, terminal device and the computer readable storage medium of application | |
CN114491536B (en) | Code analysis method and device based on knowledge graph | |
US9703683B2 (en) | Software testing coverage | |
CN111459504A (en) | Intelligent contract processing method, device, equipment and storage medium | |
US20210209015A1 (en) | System, method and recording medium for optimizing software testing via group testing | |
US11526345B2 (en) | Production compute deployment and governance | |
US9591014B2 (en) | Capturing correlations between activity and non-activity attributes using N-grams | |
CN113110947B (en) | Program call chain generation method, system, electronic device and medium | |
CN117785686B (en) | GPU compiler testing method, device and storage medium | |
CN117312173A (en) | Deep learning framework testing method and device, electronic equipment and storage medium | |
CN114238119B (en) | Automated testing method and system for Android applications and storage medium | |
Zhang et al. | R & D and design of industrial CFD software for aeronautics and astronautics | |
US11061662B1 (en) | Maintenance of fast-changing software applications | |
CN117271313A (en) | Compliance detection method and device for application program, electronic equipment and storage medium | |
CN116069650A (en) | Method and device for generating test cases | |
CN114942887A (en) | Program safety testing method, device, equipment and medium | |
CN114879954A (en) | Application definition method and device, electronic equipment and storage medium | |
US11372704B2 (en) | Advanced java dump analysis | |
CN116974922B (en) | Performance analysis method, device, equipment and storage medium of deep learning model | |
CN111626401A (en) | Operation method and device | |
US11645269B2 (en) | Automatic events detection from enterprise applications |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |