CN110109697B - SDK output method and device of neural network model, electronic equipment and storage medium - Google Patents

SDK output method and device of neural network model, electronic equipment and storage medium Download PDF

Info

Publication number
CN110109697B
CN110109697B CN201910266891.8A CN201910266891A CN110109697B CN 110109697 B CN110109697 B CN 110109697B CN 201910266891 A CN201910266891 A CN 201910266891A CN 110109697 B CN110109697 B CN 110109697B
Authority
CN
China
Prior art keywords
sdk
type
neural network
hardware platform
programming language
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.)
Active
Application number
CN201910266891.8A
Other languages
Chinese (zh)
Other versions
CN110109697A (en
Inventor
杨�一
宋扬
唐文斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuangshi Technology Co Ltd
Original Assignee
Beijing Kuangshi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kuangshi Technology Co Ltd filed Critical Beijing Kuangshi Technology Co Ltd
Priority to CN201910266891.8A priority Critical patent/CN110109697B/en
Publication of CN110109697A publication Critical patent/CN110109697A/en
Application granted granted Critical
Publication of CN110109697B publication Critical patent/CN110109697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a method, a device, electronic equipment and a storage medium for outputting an SDK of a neural network model, wherein the method comprises the following steps: obtaining model description information of a neural network model of the SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated; according to the hardware platform type and the programming language type, matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template; and inputting the model description information into the matched SDK output template to replace a related structural part of the neural network model in the SDK output template, so as to obtain the SDK of the neural network model under the hardware platform type and the programming language type. According to the application, the SDK under the corresponding hardware platform type and programming language type can be automatically generated according to the pre-generated SDK output template, so that the output efficiency of the SDK of the neural network model is improved.

Description

SDK output method and device of neural network model, electronic equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence, and in particular, to a method, an apparatus, an electronic device, and a storage medium for outputting an SDK of a neural network model.
Background
In AI (Artificial Intelligence ) applications typified by deep neural network algorithms, it is necessary to provide SDKs (Software Development Kit, software development kits) with good suitability for different hardware platforms, and optimize the instruction set characteristics of the hardware platforms, and correspondingly, the programming languages supported by the different hardware platforms are different.
In the prior art, when generating the SDK of the neural network model, all the algorithm encapsulation logic of the neural network model needs to be rewritten completely and independently aiming at different hardware platforms and different language environments, and the process is time-consuming and labor-consuming and has lower benefit.
Disclosure of Invention
In view of the foregoing, embodiments of the present application are directed to providing an SDK output method, apparatus, electronic device, and storage medium of a neural network model that overcomes or at least partially solves the foregoing problems.
According to a first aspect of an embodiment of the present application, there is provided an SDK output method of a neural network model, including:
obtaining model description information of a neural network model of a software open toolkit (SDK) to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated;
matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template according to the hardware platform type and the programming language type;
and inputting the model description information into a matched SDK output template to replace a related structural part of the neural network model in the SDK output template, so as to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, before the matching of the SDK output templates corresponding to the hardware platform type and the programming language type from the pre-generated SDK output templates according to the hardware platform type and the programming language type, the method further includes:
obtaining a model type of the neural network model;
the matching of the SDK output templates corresponding to the hardware platform type and the programming language type from the pre-generated SDK output templates according to the hardware platform type and the programming language type comprises the following steps:
and matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
Optionally, matching, according to the hardware platform type and the programming language type, an SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output templates, including:
matching with template meta-description information corresponding to a pre-generated SDK output template according to the hardware platform type and the programming language type;
and when the hardware platform type and the programming language type are matched with the template meta-description information, determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type.
Optionally, inputting the model description information into a matched SDK output template to replace a related structural part of a neural network model in the SDK output template, so as to obtain an SDK of the neural network model under the hardware platform type and the programming language type, including:
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template;
and calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, after obtaining the SDK of the neural network model under the hardware platform type and the programming language type, the method further includes:
and verifying the SDK to generate a verification result.
According to a second aspect of the embodiment of the present application, there is provided an SDK output device of a neural network model, including:
the information acquisition module is used for acquiring model description information of a neural network model of the SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated;
the template matching module is used for matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template according to the hardware platform type and the programming language type;
and the SDK generation module is used for inputting the model description information into the matched SDK output template to replace a related structural part of the neural network model in the SDK output template so as to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, the apparatus further includes:
the model type acquisition module is used for acquiring the model type of the neural network model before the SDK output templates corresponding to the hardware platform type and the programming language type are matched from the pre-generated SDK output templates according to the hardware platform type and the programming language type;
the template matching module is specifically used for:
and matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
Optionally, the template matching module includes:
the information matching unit is used for matching with template meta-description information corresponding to the pre-generated SDK output template according to the hardware platform type and the programming language type;
and the template determining unit is used for determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type when the hardware platform type and the programming language type are matched with the template meta-description information.
Optionally, the SDK generating module is specifically configured to:
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template;
and calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, the apparatus further includes:
and the verification module is used for verifying the SDK after the SDK of the neural network model under the hardware platform type and the programming language type is obtained, so as to generate a verification result.
According to a third aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor, a memory, and a computer program stored on the memory and executable on the processor, which when executed by the processor implements the SDK output method of the neural network model as described in the first aspect.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the SDK output method of the neural network model according to the first aspect.
According to the SDK output method, device, electronic equipment and storage medium of the neural network model, the model description information of the neural network model of the SDK to be generated, the hardware platform type and the programming language type corresponding to the SDK to be generated are obtained, the SDK output template corresponding to the hardware platform type and the programming language type is matched from the pre-generated SDK output template according to the hardware platform type and the programming language type, the model description information is input into the matched SDK output template to replace relevant structural parts of the neural network model in the SDK output template, and therefore the SDK of the neural network model under the hardware platform type and the programming language type is obtained, the SDK under the corresponding hardware platform type and the programming language type can be automatically generated according to the pre-generated SDK output template, and the encapsulation logic of the neural network model algorithm does not need to be rewritten independently aiming at different hardware platforms and language environments, so that the output efficiency of the SDK of the neural network model is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application.
Fig. 1 is a flowchart of steps of an SDK output method of a neural network model according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of an SDK output method of a neural network model according to an embodiment of the present application;
fig. 3 is a block diagram of an SDK output device of a neural network model according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
Fig. 1 is a flowchart of steps of an SDK output method of a neural network model according to an embodiment of the present application, where the method may be applied to an electronic device to generate an SDK of the neural network model, and as shown in fig. 1, the method may include:
and step 101, obtaining model description information of a neural network model of the SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated.
The model description information is an operator of the neural network model and comprises model parameters of the neural network model, wherein the model parameters comprise super parameters and training parameters, and the super parameters are structural parameters of the neural network model. For example, where the neural network model is a convolutional neural network-based model, the model description information may include pooling methods, activation functions, convolutional kernels, and convolutional layers, among others.
The hardware platform types may include System on a Chip (SoC), a handset Arm processor, a server, etc. Given the variability of different hardware platform types, different types of neural network models are typically employed, such as: dorefanet for end device SoC, sheffleNet for handset Arm processor, or ResNet for server, etc. The programming language types may include Verilog, C/c++, or Golang, among others.
The method comprises the steps that a model description file can be obtained according to a storage path of a model description file corresponding to a neural network model of an SDK to be generated, which is designated by a user, and model description information of the neural network model is obtained from the model description file; alternatively, model description information input by a user can be received according to the reserved interface. When a user needs to apply the SDK of the neural network model on a hardware platform, firstly, the SDK corresponding to the hardware platform needs to be generated, at this time, the hardware platform type and the programming language type can be specified, and the electronic equipment acquires the hardware platform type and the programming language type corresponding to the SDK to be generated through a reserved interface.
And step 102, matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output templates according to the hardware platform type and the programming language type.
The pre-generated SDK output templates are SDK output templates of the neural network model generated for the hardware platform type and the programming language type, that is, one type of hardware platform type and one type of programming language type correspond to one type of SDK output templates, where the pre-generated SDK output templates may include a plurality of templates, and the corresponding templates may be selected for use according to the needs. The pre-generated SDK output templates define the encapsulation logic of the neural network model under the corresponding hardware platform type and programming language type. The SDK output template is pre-defined with an acceleration driver corresponding to the hardware platform type and a programming language technical stack corresponding to the programming language type. The SDK output template is a YAML (Yet Another Markup Language, still a markup language) template, YAML is a template language, and is a markup language like XML and JSON. YAML emphasizes that data is centered, not on a markup language, is an intuitive data serialization format that can be recognized by a computer, is highly readable and easy to read by humans, and is easy to interact with scripting languages for expressing data sequences.
Because the neural network model often contains some functional abstract packages such as camera/video stream, photo set/base library and the like besides the hardware related differences of the SDKs of different hardware platforms, and great similarity exists between the SDKs of different hardware platforms for the implementation of functional classes, the SDK output templates related to the hardware platforms and the programming languages can be generated in advance through the hardware instruction sets and the programming language descriptions related to the hardware platforms so as to define the similar parts of the functional class implementation of the neural network model corresponding to the different hardware platforms and the programming languages. When a neural network model is required to be applied to various hardware platforms, corresponding SDK output templates can be generated for different hardware platforms and different programming languages, so that the SDK output templates can be directly applied to output the SDKs of the neural network model under different hardware platforms.
Matching the hardware platform type and the programming language type corresponding to the SDK to be generated with the hardware platform type and the programming language type corresponding to the pre-generated SDK output template, and determining that the pre-generated SDK output template is the matched SDK output template when the hardware platform type and the programming language type corresponding to one pre-generated SDK output template are the same as the hardware platform type and the programming language type corresponding to the SDK to be generated.
In some embodiments of the present application, matching, according to the hardware platform type and the programming language type, an SDK output template corresponding to the hardware platform type and the programming language type from among pre-generated SDK output templates, includes:
matching with template meta-description information corresponding to a pre-generated SDK output template according to the hardware platform type and the programming language type;
and when the hardware platform type and the programming language type are matched with the template meta-description information, determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type.
The template meta-description information comprises a hardware platform type and a programming language type corresponding to the SDK output template.
And matching the hardware platform type and the programming language type corresponding to the SDK to be generated with the template meta-description information corresponding to the pre-generated SDK output template, so that when the hardware platform type and the programming language type corresponding to the SDK to be generated are matched, the SDK output template corresponding to the matched template meta-description information is determined to be the SDK output template corresponding to the hardware platform type and the programming language type corresponding to the SDK to be generated. The required SDK output template can be conveniently and quickly matched through the template meta-description information.
And step 103, inputting the model description information into a matched SDK output template to replace a related structural part of the neural network model in the SDK output template, so as to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
And taking the model description information as input information of an SDK output template, inputting the input information into the matched SDK output template, and enabling the SDK output template to replace a structural realization part of a neural network model in the SDK output template according to the model description information so as to construct the SDK of the neural network model under the hardware platform type and the programming language type.
In some embodiments of the present application, inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template, to obtain an SDK of the neural network model under the hardware platform type and the programming language type, including:
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template;
and calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Inputting the model description information into a matched SDK output template, replacing a part of the SDK output template, which is related to the neural network model, according to the model description information to obtain a related structure of the required neural network model, in the process, calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration optimization to obtain the SDK of the neural network model under the hardware platform type and the programming language type. The acceleration of the instruction set of the hardware platform is embodied on an interface reserved by the common library and the model integration part, for example, the encapsulation of Cuda/TensorRT is performed in advance in an SDK output template aiming at the Nvida GPU.
According to the SDK output method of the neural network model, the model description information of the neural network model of the SDK to be generated and the hardware platform type and the programming language type corresponding to the SDK to be generated are obtained, the SDK output templates corresponding to the hardware platform type and the programming language type are matched from the pre-generated SDK output templates according to the hardware platform type and the programming language type, the model description information is input into the matched SDK output templates to replace the relevant structural parts of the neural network model in the SDK output templates, and the SDK of the neural network model under the hardware platform type and the programming language type is obtained, so that the SDK corresponding to the hardware platform type and the programming language type can be automatically generated according to the pre-generated SDK output templates, and the encapsulation logic of the neural network model algorithm does not need to be rewritten independently aiming at different hardware platforms and language environments, so that the output efficiency of the SDK of the neural network model is improved.
On the basis of the above technical solution, after obtaining the SDK of the neural network model under the hardware platform type and the programming language type, the method further optionally includes:
and verifying the SDK to generate a verification result.
The generated SDK can be verified through an automatic Benchmark test platform, the result of the generated SDK can be compared with the result of the neural network model of the previous version in the verification process, and a verification result is generated, so that the generated SDK can be verified in real time. The validation result may be in the form of a Benchmark list. For example, the verification result may be that the face recognition rate of the SDK corresponding to the present neural network model is 90%, the face recognition rate of the SDK of the neural network model of the previous version is 80%, and so on.
Fig. 2 is a flowchart of steps of an SDK output method of a neural network model according to an embodiment of the present application, where, on the basis of the foregoing embodiment, an SDK output template is further related to a model type of the neural network model, as shown in fig. 2, the method may include:
step 201, obtaining model description information of a neural network model of an SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated.
The specific content of this step is the same as that of step 101 in the above embodiment, and will not be repeated here.
Step 202, obtaining a model type of the neural network model.
The model types may include face recognition type, vehicle recognition type, voice recognition type, or the like, among others.
In the definition process of the SDK of the neural network model, the method comprises two parts of model combination and hardware platform optimization besides the definition of the neural network model. A typical model combination in the face recognition SDK comprises snapshot, comparison, alarm and the like, and further comprises face detection, face tracking, face key point extraction, face attribute recognition, face feature value extraction, feature comparison, feature retrieval and the like according to the subdivision of the business scene. The definition process of the SDK comprises a hardware platform optimization part mainly because hardware acceleration optimization is related to the realization of a neural network algorithm model, and the hardware acceleration optimization is closely related to different hardware platforms.
Since all applications of one model type are defined in the SDK output templates, the corresponding SDK output templates can be matched after the model type is known, and the corresponding SDKs can be directly obtained.
And step 203, matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
The SDK output template is also related to the model type, and only one SDK output template is needed to be generated aiming at the same model type, hardware platform type and programming language type. The SDK output templates of a model type are generated in advance, the hardware platform is defined in a targeted mode according to programming languages, each SDK generates different templates for different hardware platforms according to different requirements, the same detection and identification business processes are applied under the model type, and therefore when a new neural network model is generated, the model definition can be quickly used for generating the SDKs of various hardware platforms according to the different business processes.
And 204, inputting the model description information into a matched SDK output template to replace a related structural part of the neural network model in the SDK output template, so as to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
The specific content of this step is the same as that of step 103 in the above embodiment, and will not be repeated here.
According to the SDK output method of the neural network model, on the basis of the embodiment, the model type of the neural network model is obtained, and the corresponding SDK output template is matched from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type, so that the SDK of the neural network model under the hardware platform type and the programming language type can be generated according to the model description information, the SDK output templates are correspondingly defined according to the model types, and the SDK of the neural network model can be generated more accurately.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred embodiments, and that the acts are not necessarily required by the embodiments of the application.
Fig. 3 is a block diagram of a SDK output device of a neural network model according to an embodiment of the present application, and as shown in fig. 3, the SDK output device of the neural network model may include:
the information acquisition module 301 is configured to acquire model description information of a neural network model of an SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated;
the template matching module 302 is configured to match, according to the hardware platform type and the programming language type, an SDK output template corresponding to the hardware platform type and the programming language type from among the pre-generated SDK output templates;
and the SDK generating module 303 is configured to input the model description information into a matched SDK output template to replace a related structural part of a neural network model in the SDK output template, so as to obtain an SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, the apparatus further includes:
the model type acquisition module is used for acquiring the model type of the neural network model before the SDK output templates corresponding to the hardware platform type and the programming language type are matched from the pre-generated SDK output templates according to the hardware platform type and the programming language type;
the template matching module is specifically used for:
and matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
Optionally, the template matching module includes:
the information matching unit is used for matching with template meta-description information corresponding to the pre-generated SDK output template according to the hardware platform type and the programming language type;
and the template determining unit is used for determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type when the hardware platform type and the programming language type are matched with the template meta-description information.
Optionally, the SDK generating module is specifically configured to:
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template;
and calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
Optionally, the apparatus further includes:
and the verification module is used for verifying the SDK after the SDK of the neural network model under the hardware platform type and the programming language type is obtained, so as to generate a verification result.
According to the SDK output device of the neural network model, the information acquisition module is used for acquiring the model description information of the neural network model of the SDK to be generated, the hardware platform type and the programming language type corresponding to the SDK to be generated, the template matching module is used for matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template according to the hardware platform type and the programming language type, the SDK generation module is used for inputting the model description information into the matched SDK output template so as to replace a relevant structural part of the neural network model in the SDK output template, and therefore the SDK of the neural network model under the hardware platform type and the programming language type is obtained, the SDK under the corresponding hardware platform type and the programming language type can be automatically generated according to the pre-generated SDK output template, and the algorithm encapsulation logic of the neural network model is not required to be rewritten independently aiming at different hardware platforms and language environments, and the output efficiency of the SDK of the neural network model is improved.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
Further, according to an embodiment of the present application, there is provided an electronic device, which may be a computer or a server, including: a processor, a memory, and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the SDK output method of the neural network model of the foregoing embodiment.
According to an embodiment of the present application, there is also provided a computer-readable storage medium including, but not limited to, a disk memory, a CD-ROM, an optical memory, etc., having stored thereon a computer program which, when executed by a processor, implements the SDK output method of the neural network model of the foregoing embodiment.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the scope of the embodiments of the application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The method, the device, the electronic equipment and the storage medium for outputting the SDK of the neural network model provided by the application are described in detail, and specific examples are applied to the principle and the implementation mode of the application, and the description of the above examples is only used for helping to understand the method and the core idea of the application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. An SDK output method of a neural network model, comprising:
obtaining model description information of a neural network model of a Software Development Kit (SDK) to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated, wherein the model description information of the neural network model comprises model parameters of the neural network model, and the model parameters of the neural network model comprise super parameters and training parameters;
matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template according to the hardware platform type and the programming language type;
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template to obtain the SDK of the neural network model under the hardware platform type and the programming language type, wherein the neural network model related structure part comprises a structure realization part of the neural network model.
2. The method of claim 1, further comprising, prior to said matching SDK output templates corresponding to said hardware platform type and programming language type from among pre-generated SDK output templates according to said hardware platform type and programming language type:
obtaining a model type of the neural network model;
the matching of the SDK output templates corresponding to the hardware platform type and the programming language type from the pre-generated SDK output templates according to the hardware platform type and the programming language type comprises the following steps:
and matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
3. The method of claim 1, wherein matching the SDK output templates corresponding to the hardware platform type and the programming language type from among the pre-generated SDK output templates according to the hardware platform type and the programming language type, comprises:
matching with template meta-description information corresponding to a pre-generated SDK output template according to the hardware platform type and the programming language type;
and when the hardware platform type and the programming language type are matched with the template meta-description information, determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type.
4. The method of claim 1, wherein inputting the model description information into the matched SDK output template to replace a neural network model related structure part in the SDK output template to obtain the SDK of the neural network model under the hardware platform type and the programming language type, comprises:
inputting the model description information into a matched SDK output template to replace a neural network model related structure part in the SDK output template;
and calling a public library corresponding to the hardware platform type to perform optimization on the neural network model, and calling acceleration corresponding to the hardware platform type and aiming at a hardware instruction set to perform hardware acceleration to obtain the SDK of the neural network model under the hardware platform type and the programming language type.
5. The method of claim 1, further comprising, after deriving the SDK of the neural network model under the hardware platform type and programming language type:
and verifying the SDK to generate a verification result.
6. An SDK output device of a neural network model, comprising:
the information acquisition module is used for acquiring model description information of a neural network model of the SDK to be generated, and a hardware platform type and a programming language type corresponding to the SDK to be generated, wherein the model description information of the neural network model comprises model parameters of the neural network model, and the model parameters of the neural network model comprise super parameters and training parameters;
the template matching module is used for matching the SDK output template corresponding to the hardware platform type and the programming language type from the pre-generated SDK output template according to the hardware platform type and the programming language type;
the SDK generation module is used for inputting the model description information into the matched SDK output template to replace a neural network model related structure part in the SDK output template to obtain the SDK of the neural network model under the hardware platform type and the programming language type, and the neural network model related structure part comprises a structure realization part of the neural network model.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the model type acquisition module is used for acquiring the model type of the neural network model before the SDK output templates corresponding to the hardware platform type and the programming language type are matched from the pre-generated SDK output templates according to the hardware platform type and the programming language type;
the template matching module is specifically used for:
and matching the SDK output templates corresponding to the model type, the hardware platform type and the programming language type from the pre-generated SDK output templates according to the model type, the hardware platform type and the programming language type.
8. The apparatus of claim 6, wherein the template matching module comprises:
the information matching unit is used for matching with template meta-description information corresponding to the pre-generated SDK output template according to the hardware platform type and the programming language type;
and the template determining unit is used for determining the SDK output template corresponding to the template meta-description information as the SDK output template corresponding to the hardware platform type and the programming language type when the hardware platform type and the programming language type are matched with the template meta-description information.
9. An electronic device, comprising: a processor, a memory, and a computer program stored on the memory and executable on the processor, which when executed by the processor, implements the SDK output method of the neural network model of any one of claims 1-5.
10. A computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the SDK output method of the neural network model according to any one of claims 1 to 5 is implemented.
CN201910266891.8A 2019-04-03 2019-04-03 SDK output method and device of neural network model, electronic equipment and storage medium Active CN110109697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910266891.8A CN110109697B (en) 2019-04-03 2019-04-03 SDK output method and device of neural network model, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910266891.8A CN110109697B (en) 2019-04-03 2019-04-03 SDK output method and device of neural network model, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110109697A CN110109697A (en) 2019-08-09
CN110109697B true CN110109697B (en) 2023-08-18

Family

ID=67485138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910266891.8A Active CN110109697B (en) 2019-04-03 2019-04-03 SDK output method and device of neural network model, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110109697B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115357252B (en) * 2022-10-08 2022-12-27 成都数联云算科技有限公司 Source code file generation method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机系统有限公司 Automatic program code generating method
CN102750152A (en) * 2012-06-21 2012-10-24 新浪网技术(中国)有限公司 Method and device of application for generating a plurality of programming languages based on descriptive language
CN103092599A (en) * 2011-11-05 2013-05-08 京瓷办公信息系统株式会社 Software develop kit
CN103713896A (en) * 2013-12-17 2014-04-09 北京京东尚科信息技术有限公司 Software development kit generation method and device used for accessing server
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9003361B2 (en) * 2012-11-30 2015-04-07 Red Hat Israel, Ltd. Generating a restful web service software development kit client

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092599A (en) * 2011-11-05 2013-05-08 京瓷办公信息系统株式会社 Software develop kit
CN102508669A (en) * 2011-11-14 2012-06-20 浙江鸿程计算机系统有限公司 Automatic program code generating method
CN102750152A (en) * 2012-06-21 2012-10-24 新浪网技术(中国)有限公司 Method and device of application for generating a plurality of programming languages based on descriptive language
CN103713896A (en) * 2013-12-17 2014-04-09 北京京东尚科信息技术有限公司 Software development kit generation method and device used for accessing server
CN108563435A (en) * 2018-04-19 2018-09-21 北京百度网讯科技有限公司 The method and device of code building

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"黑科技"在设备维保系统中的应用;李科;《电气自动化》;20180130(第01期);全文 *

Also Published As

Publication number Publication date
CN110109697A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
KR102494139B1 (en) Apparatus and method for training neural network, apparatus and method for speech recognition
US11068382B2 (en) Software testing and verification
US9818409B2 (en) Context-dependent modeling of phonemes
US9189471B2 (en) Apparatus and method for recognizing emotion based on emotional segments
CN109145766B (en) Model training method and device, recognition method, electronic device and storage medium
KR101719278B1 (en) Deep learnig framework and image recognition method for content-based visual image recognition
CN107909998B (en) Voice instruction processing method and device, computer equipment and storage medium
US10210003B2 (en) Methods and apparatus for module arbitration
US10997965B2 (en) Automated voice processing testing system and method
KR20170030923A (en) Apparatus and method for generating an acoustic model, Apparatus and method for speech recognition
CN113052328B (en) Deep learning model production system, electronic device, and storage medium
CN108737324B (en) Method and device for generating artificial intelligence service assembly and related equipment and system
CN113177538B (en) Video cycle identification method and device, computer equipment and storage medium
US11494614B2 (en) Subsampling training data during artificial neural network training
CN109637525B (en) Method and apparatus for generating an on-board acoustic model
WO2019048063A1 (en) Voice-controlled management of user profiles
CN111027643B (en) Training method of deep neural network model, man-machine interaction recognition method, device, electronic equipment and storage medium
CN110109697B (en) SDK output method and device of neural network model, electronic equipment and storage medium
US10755171B1 (en) Hiding and detecting information using neural networks
CN111126358A (en) Face detection method, face detection device, storage medium and equipment
KR102132383B1 (en) Ui testing automation method using deep learning algorithem and tree and appratus for the same
WO2017201907A1 (en) Search term classification method and device
CN111510566B (en) Method and device for determining call label, computer equipment and storage medium
CN110532755B (en) Computer-implemented risk identification method and device
CN115909170A (en) Depth video understanding method, device and equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant