CN110738318B - Network structure operation time evaluation and evaluation model generation method, system and device - Google Patents

Network structure operation time evaluation and evaluation model generation method, system and device Download PDF

Info

Publication number
CN110738318B
CN110738318B CN201910859244.8A CN201910859244A CN110738318B CN 110738318 B CN110738318 B CN 110738318B CN 201910859244 A CN201910859244 A CN 201910859244A CN 110738318 B CN110738318 B CN 110738318B
Authority
CN
China
Prior art keywords
neuron
neurons
running time
evaluation
network structure
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
CN201910859244.8A
Other languages
Chinese (zh)
Other versions
CN110738318A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910859244.8A priority Critical patent/CN110738318B/en
Publication of CN110738318A publication Critical patent/CN110738318A/en
Application granted granted Critical
Publication of CN110738318B publication Critical patent/CN110738318B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a network structure runtime evaluation and evaluation model generation method, a system and a device, wherein the network structure runtime evaluation method can comprise the following steps: disassembling the network structure to be processed to obtain each neuron forming the network structure; determining the running time of each neuron based on the parameters of the neuron and an evaluation model obtained by pre-training; and determining the running time of the network structure according to the running time of each neuron. By applying the scheme, the accuracy of the evaluation result can be improved.

Description

Network structure operation time evaluation and evaluation model generation method, system and device
[ field of technology ]
The present disclosure relates to the field of deep learning, and in particular, to a method, system, and apparatus for evaluating network structure runtime and generating an evaluation model.
[ background Art ]
Currently, deep learning techniques have achieved tremendous success in many directions. In the deep learning technology, the quality of the network structure (i.e., the neural network structure) has a very important influence on the effect of the model, and the manual design of the network structure requires very abundant experience and numerous attempts, and numerous parameters can generate explosive combinations and are difficult to realize, so that the neural network architecture search technology (NAS, neural Architecture Search) has become a research hotspot in recent years.
The NAS is realized by using an algorithm to replace complicated manual operation and automatically searching out an optimal network structure, and mainly comprises key elements such as search space definition, search strategy, search target evaluation and the like.
Search objective evaluation refers to how to evaluate the quality of a searched network structure, such as the runtime of the network structure, during the search process. Currently, the runtime of a network architecture is typically evaluated in the following manner: and determining the computational complexity of the searched network structure, and evaluating the running time of the network structure according to the computational complexity. However, there is often a large deviation between the computational complexity of the network structure and the actual running time of the network structure, and thus the evaluation result obtained in this way may be very inaccurate.
[ invention ]
In view of this, the present application provides a network architecture runtime evaluation and evaluation model generation method, system and apparatus.
The specific technical scheme is as follows:
a network fabric runtime evaluation method, comprising:
disassembling a network structure to be processed to obtain each neuron forming the network structure;
determining the running time of each neuron based on the parameters of the neuron and an evaluation model obtained by pre-training;
and determining the running time of the network structure according to the running time of each neuron.
According to a preferred embodiment of the present application, the number of the evaluation models is one or more than one;
when the number of the evaluation models is greater than one, the determining the running time of the neuron based on the parameters of the neuron and the evaluation models obtained by pre-training comprises:
and respectively inputting the parameters of the neurons into each evaluation model to obtain the running time of the neurons evaluated by each evaluation model, and determining the running time of the neurons by fusing the obtained running times.
According to a preferred embodiment of the present application, determining the operation time of the neuron according to each operation time obtained by the fusion includes: and calculating the average value of each operation time, and taking the average value as the operation time of the neuron.
According to a preferred embodiment of the present application, the determining the operation time of the network structure according to the operation time of each neuron includes: the running time of each neuron is added, and the added sum is used as the running time of the network structure.
An evaluation model generation method, comprising:
selecting a part of neurons from neurons within a predetermined range;
respectively constructing training data corresponding to each neuron according to the selected neurons, wherein the training data comprises parameters of the neurons and the running time of the neurons;
and training according to the training data to obtain an evaluation model so as to respectively determine the running time of each neuron forming the network structure by using the evaluation model and the parameters of the neurons when the running time of the network structure to be processed is required to be evaluated, and determining the running time of the network structure according to the running time of each neuron.
According to a preferred embodiment of the present application, the selecting a part of neurons from neurons within a predetermined range includes: a portion of the neurons are randomly selected from all possible neurons in the search space.
According to a preferred embodiment of the present application, the method further comprises: and for each selected neuron, respectively sending the neuron to a designated device for operation, and obtaining the operation time of the neuron.
According to a preferred embodiment of the present application, the number of the evaluation models is one;
or the number of the evaluation models is larger than one, so that when the running time of the network structure to be processed is required to be evaluated, the parameters of the neurons are respectively input into each evaluation model for any neuron, the running time of the neurons evaluated by each evaluation model is obtained, and the running time of the neurons is determined by fusing the obtained running times.
A network fabric runtime evaluation device, comprising: a disassembly unit and an evaluation unit;
the disassembly unit is used for disassembling the network structure to be processed to obtain each neuron forming the network structure;
the evaluation unit is used for determining the running time of each neuron according to the parameters of the neuron and an evaluation model obtained by training in advance, and determining the running time of the network structure according to the running time of each neuron.
According to a preferred embodiment of the present application, the number of the evaluation models is one or more than one;
when the number of the evaluation models is larger than one, the evaluation unit inputs the parameters of the neurons into each evaluation model for each neuron, obtains the running time of the neurons evaluated by each evaluation model, and determines the running time of the neurons by fusing the obtained running times.
According to a preferred embodiment of the present application, the evaluation unit calculates, for each neuron, a mean value of the running times of the neurons evaluated by the respective evaluation models, and uses the mean value as the running time of the neurons.
According to a preferred embodiment of the present application, the evaluation unit sums the running times of the neurons, the sum being added as the running time of the network structure.
An evaluation model generation apparatus comprising: the device comprises an acquisition unit, a construction unit and a training unit;
the acquisition unit is used for selecting partial neurons from neurons in a preset range;
the construction unit is used for respectively constructing training data corresponding to each neuron according to each selected neuron, wherein the training data comprises parameters of the neuron and the running time of the neuron;
the training unit is used for training to obtain an evaluation model according to the training data, so that when the running time of the network structure to be processed is required to be evaluated, the running time of each neuron forming the network structure is respectively determined by utilizing the evaluation model and the parameters of the neurons, and the running time of the network structure is determined according to the running time of each neuron.
According to a preferred embodiment of the present application, the acquisition unit randomly selects a part of neurons from all possible neurons in the search space.
According to a preferred embodiment of the present application, the construction unit is further configured to send, for each selected neuron, the neuron to a designated device for operation, and obtain an operation time of the neuron.
According to a preferred embodiment of the present application, the number of the evaluation models is one;
or the number of the evaluation models is larger than one, so that when the running time of the network structure to be processed is required to be evaluated, the parameters of the neurons are respectively input into each evaluation model for any neuron, the running time of the neurons evaluated by each evaluation model is obtained, and the running time of the neurons is determined by fusing the obtained running times.
A network fabric runtime evaluation system, comprising:
the network structure runtime evaluation means as described above, and the evaluation model generation means as described above.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method as described above when executing the program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as described above.
Based on the above description, it can be seen that, by adopting the scheme of the application, the operation time of each neuron forming the network structure can be determined by using the evaluation model, and then the operation time of the network structure can be determined according to the operation time of each neuron, so that the more accurate evaluation of the operation time of the network structure is realized, and the accuracy of the evaluation result is improved.
[ description of the drawings ]
Fig. 1 is a flowchart of an embodiment of a network architecture runtime evaluation method described in the present application.
Fig. 2 is a flowchart of an embodiment of an evaluation model generation method described in the present application.
FIG. 3 is a flowchart of an embodiment of a method for generating an evaluation model and evaluating the runtime of a network structure.
Fig. 4 is a schematic structural diagram of an embodiment of a network structure runtime evaluation device described in the present application.
Fig. 5 is a schematic diagram of the composition structure of an embodiment of the evaluation model generation apparatus described in the present application.
Fig. 6 illustrates a block diagram of an exemplary computer system/server 12 suitable for use in implementing embodiments of the present application.
[ detailed description ] of the invention
In order to make the technical solution of the present application clearer and more obvious, the solution of the present application will be further described below by referring to the accompanying drawings and examples.
It will be apparent that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, based on the embodiments herein, which are within the scope of the protection of the present application, will be within the skill of the art without inventive effort.
In addition, it should be understood that the term "and/or" herein is merely one association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Fig. 1 is a flowchart of an embodiment of a network architecture runtime evaluation method described in the present application. As shown in fig. 1, the following detailed implementation is included.
At 101, a network structure to be processed is disassembled to obtain neurons constituting the network structure.
At 102, for each neuron, a runtime of the neuron is determined based on the parameters of the neuron and a pre-trained evaluation model.
At 103, the runtime of the network structure is determined from the runtime of each neuron.
Each network structure is formed by a plurality of neurons (OPs), so that if the operation time of each neuron can be acquired respectively, the operation time of the whole network structure can be determined according to the operation time of each neuron.
For this reason, the network structure to be processed may be disassembled first, so as to obtain each neuron constituting the network structure, and how to disassemble the neurons is the prior art.
For each neuron obtained by disassembly, the running time of the neuron can be obtained respectively. In this embodiment, for each neuron obtained by disassembly, the running time of the neuron may be determined based on the parameters of the neuron and an evaluation model obtained by training in advance.
The parameters of each neuron are known and the evaluation model can be obtained by pre-training. The input of the evaluation model may be a parameter of the neuron and the output may be a runtime of the evaluated neuron.
The number of the evaluation models may be one or more than one, that is, a plurality. To improve accuracy of the evaluation result, the number of the evaluation models may be plural. Thus, for each neuron, the parameters of the neuron can be respectively input into each evaluation model, so that the running time of the neuron evaluated by each evaluation model is obtained, and the obtained running times can be fused to finally determine the running time of the neuron. Preferably, the mean value of each of the obtained running times is calculated as the running time of the neuron.
The assessment model is not limited in particular, and may include, for example, random forest models, decision tree models, extreme gradient lifting (XGBoost, eXtreme Gradient Boosting) models, and the like.
After the operation time of each neuron is obtained, the operation time of the network structure can be determined according to the operation time of each neuron. Preferably, the running times of the neurons may be added, with the added sum being the running time of the network structure.
For example, assuming that the network structure contains 20 neurons in total, for convenience of description, the two are referred to as neurons 1 to 20, the running times of the neurons 1 to 20 can be obtained, and then the running times of the neurons 1 to 20 can be added, and the sum is taken as the running time of the network structure.
Based on the above description, in the solution described in the present application, when the running time of each neuron is obtained, an evaluation model obtained by training in advance is needed, and a generation manner of the evaluation model is described below.
Fig. 2 is a flowchart of an embodiment of an evaluation model generation method described in the present application. As shown in fig. 2, the following detailed implementation is included.
In 201, a portion of neurons are selected from neurons within a predetermined range.
In 202, training data corresponding to each neuron is constructed for each selected neuron, wherein the training data includes parameters of the neuron and the running time of the neuron.
In 203, an evaluation model is obtained according to training data, so that when the running time of the network structure to be processed needs to be evaluated, the running time of each neuron forming the network structure is determined by using the evaluation model and parameters of the neurons, and the running time of the network structure is determined according to the running time of each neuron.
In this embodiment, neurons within the predetermined range may refer to all possible neurons in the search space. All possible neurons, i.e. which neurons, parameters of different neurons, etc. may be enumerated first according to the search space. For all possible neurons in the search space, some of them may be randomly selected, e.g., about 20% of them are selected for use in constructing training data.
That is, for each selected neuron, training data corresponding to the neuron may be respectively constructed, and the training data may include parameters of the neuron and a running time of the neuron. Wherein, for each neuron selected, the neuron can be sent to a designated device to run, thereby obtaining the running time of the neuron. For example, the neuron may be sent to run on a cell phone or other embedded device to obtain the actual run time of the neuron, as embodied in the prior art.
According to the constructed training data, an evaluation model can be obtained through training. The model of the assessment model is not limited, and may include, for example, a random forest model, a decision tree model, an XGBoost model, and the like.
Therefore, when the operation time of the network structure to be processed is required to be evaluated, the operation time of each neuron forming the network structure can be respectively determined by utilizing the evaluation model and the parameters of the neurons, and the operation time of the network structure can be further determined according to the operation time of each neuron.
The number of the evaluation models can be one or more than one, namely a plurality of evaluation models. To improve accuracy of the evaluation result, the number of the evaluation models may be plural. Therefore, when the operation time of the network structure to be processed is required to be evaluated, the parameters of the neuron can be respectively input into each evaluation model aiming at any neuron, so that the operation time of the neuron evaluated by each evaluation model is obtained, and the obtained operation times can be fused to finally determine the operation time of the neuron.
In view of the foregoing, FIG. 3 is a flowchart of an embodiment of a method for generating an evaluation model and evaluating the runtime of a network structure. As shown in fig. 3, the following detailed implementation is included.
At 301, a portion of neurons are randomly selected from all possible neurons in a search space.
About 20% of the neurons are randomly selected.
In 302, training data corresponding to each neuron is constructed for each selected neuron, where the training data includes parameters of the neuron and a runtime of the neuron.
For each neuron selected, the neuron may be sent to a designated device for operation, respectively, resulting in the runtime of the neuron.
In 303, three assessment models are trained from the constructed training data.
If 1000 pieces of training data are constructed, the 1000 pieces of training data can be utilized to respectively train to obtain a random forest model, a decision tree model and an XGBoost model.
In 304, the network structure to be processed is disassembled, and each neuron constituting the network structure is obtained.
In 305, for each neuron obtained by disassembly, the parameters of the neuron are input into three evaluation models respectively, the operation time of the neuron estimated by the three evaluation models is obtained, and the operation time of the neuron is determined by the three operation times obtained by fusion.
Preferably, the mean value of the running time of the neuron estimated by the random forest model, the decision tree model and the XGBoost model can be calculated, and the mean value is taken as the running time for determining the neuron.
In 306, the running times of the neurons are summed, with the sum being the running time of the network structure.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may take other order or occur simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
In a word, by adopting the scheme of the embodiment of the method, the operation time of each neuron forming the network structure can be determined by using the evaluation model, and then the operation time of the network structure can be determined by adding the operation time of each neuron, so that the more accurate evaluation of the operation time of the network structure is realized, and the accuracy of an evaluation result is improved.
The foregoing is a description of embodiments of the method, and the following further describes embodiments of the device.
Fig. 4 is a schematic structural diagram of an embodiment of a network structure runtime evaluation device described in the present application. As shown in fig. 4, includes: comprising the following steps: a disassembly unit 401 and an evaluation unit 402.
And the disassembly unit 401 is configured to disassemble the network structure to be processed, so as to obtain each neuron forming the network structure.
And the evaluation unit 402 is configured to determine, for each neuron, an operation time of the neuron based on the parameter of the neuron and an evaluation model obtained by training in advance, and determine an operation time of the network structure according to the operation time of each neuron.
Each network structure is composed of a plurality of neurons, so that if the running time of each neuron can be obtained respectively, the running time of the whole network structure can be determined according to the running time of each neuron.
For this purpose, the disassembly unit 401 may first disassemble the network structure to be processed, thereby obtaining each neuron constituting the network structure, and how to disassemble the network structure is known in the art.
For each neuron obtained by disassembly, the running time of the neuron can be obtained respectively. In this embodiment, for each neuron obtained by disassembly, the evaluation unit 402 may determine the running time of the neuron based on the parameters of the neuron and the pre-trained evaluation model.
The parameters of each neuron are known and the evaluation model can be obtained by pre-training. The input of the evaluation model may be a parameter of the neuron and the output may be a runtime of the evaluated neuron.
In addition, the number of the evaluation models can be one or more than one, i.e. a plurality. To improve accuracy of the evaluation result, the number of the evaluation models may be plural. Thus, for each neuron, the evaluation unit 402 may input the parameters of the neuron into each evaluation model, so as to obtain the running time of the neuron estimated by each evaluation model, and then may fuse the obtained running times to determine the running time of the neuron. Preferably, the evaluation unit 402 may calculate the mean value of the respective running times, and take the mean value as the running time of the neuron.
After the operation time of each neuron is obtained, the operation time of the network structure can be determined according to the operation time of each neuron. Preferably, the evaluation unit 402 may add the running times of the neurons together, the sum being the running time of the network structure.
Fig. 5 is a schematic diagram of the composition structure of an embodiment of the evaluation model generation apparatus described in the present application. As shown in fig. 5, includes: an acquisition unit 501, a construction unit 502 and a training unit 503.
An acquisition unit 501 for selecting a part of neurons from neurons within a predetermined range.
A construction unit 502, configured to construct, for each selected neuron, training data corresponding to the neuron, where the training data includes parameters of the neuron and a running time of the neuron;
the training unit 503 is configured to train to obtain an evaluation model according to the training data, so that when the running time of the network structure to be processed needs to be evaluated, the running time of each neuron forming the network structure is determined by using the evaluation model and parameters of the neurons, and the running time of the network structure is determined according to the running time of each neuron.
In this embodiment, neurons within the predetermined range may refer to all possible neurons in the search space. All possible neurons, i.e. which neurons, parameters of different neurons, etc. may be enumerated first according to the search space. For all possible neurons in the search space, the acquisition unit 501 may randomly select some neurons, such as about 20% of the neurons, for constructing training data.
The construction unit 502 may separately construct, for each selected neuron, training data corresponding to the neuron, where the training data may include parameters of the neuron and a running time of the neuron. Wherein, for each neuron selected, the neuron can be sent to a designated device to run, thereby obtaining the running time of the neuron. For example, the neuron may be sent to run on a cell phone or other embedded device to obtain the actual run time of the neuron.
The training unit 503 may train to obtain an evaluation model according to the constructed training data. The model of the assessment model is not limited, and may include, for example, a random forest model, a decision tree model, an XGBoost model, and the like.
Therefore, when the operation time of the network structure to be processed is required to be evaluated, the operation time of each neuron forming the network structure can be respectively determined by utilizing the evaluation model and the parameters of the neurons, and the operation time of the network structure can be further determined according to the operation time of each neuron.
The number of the evaluation models can be one or more than one, namely a plurality of evaluation models. To improve accuracy of the evaluation result, the number of the evaluation models may be plural. Thus, when the operation time of the network structure to be processed is required to be evaluated, the parameters of the neuron can be respectively input into each evaluation model aiming at any neuron, so that the operation time of the neuron evaluated by each evaluation model is obtained, and the operation time of the neuron can be determined by fusing the obtained operation time.
The application also discloses a network structure runtime evaluation system, which comprises a network structure runtime evaluation device shown in fig. 4 and an evaluation model generation device shown in fig. 5.
The specific workflow of the above apparatus and system embodiments refers to the related description in the foregoing method embodiments, and will not be repeated.
Fig. 6 illustrates a block diagram of an exemplary computer system/server 12 suitable for use in implementing embodiments of the present application. The computer system/server 12 shown in fig. 6 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 6, the computer system/server 12 is in the form of a general purpose computing device. Components of computer system/server 12 may include, but are not limited to: one or more processors (processing units) 16, a memory 28, a bus 18 that connects the various system components, including the memory 28 and the processor 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer system/server 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer system/server 12 and includes both volatile and non-volatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The computer system/server 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard disk drive"). Although not shown in fig. 6, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described herein.
The computer system/server 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer system/server 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer system/server 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the computer system/server 12 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 20. As shown in fig. 6, the network adapter 20 communicates with other modules of the computer system/server 12 via the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer system/server 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 16 executes various functional applications and data processing, such as the methods of the embodiments shown in fig. 1, 2 or 3, by running programs stored in the memory 28.
The present application also discloses a computer readable storage medium having stored thereon a computer program which when executed by a processor will implement the method of the embodiments shown in fig. 1, 2 or 3.
Any combination of one or more computer readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code 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. In the case of a remote computer, the remote computer may 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 may be connected to an external computer (for example, through the Internet using an Internet service provider).
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method, etc. may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be other manners of division when actually implemented.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description of the preferred embodiments of the present invention is not intended to limit the invention to the precise form disclosed, and any modifications, equivalents, improvements and alternatives falling within the spirit and principles of the present invention are intended to be included within the scope of the present invention.

Claims (13)

1. A method for evaluating the runtime of a network structure, comprising:
disassembling a network structure to be processed to obtain each neuron forming the network structure;
determining the running time of each neuron based on the parameters of the neuron and an evaluation model obtained by pre-training; wherein the evaluation model is an XGBoost model; the evaluation model is obtained by training in advance based on training data including a selection of a part of neurons from neurons within a predetermined range, and a run time of the neurons obtained by respectively transmitting the neurons to a specified device with respect to each of the selected neurons; the appointed equipment comprises a mobile phone;
determining the operation time of the network structure according to the operation time of each neuron; wherein,,
the determining the running time of the network structure according to the running time of each neuron comprises the following steps: adding the running time of each neuron, and taking the added sum as the running time of the network structure; wherein,,
the number of the evaluation models is more than one;
when the number of the evaluation models is greater than one, the determining the running time of the neuron based on the parameters of the neuron and the evaluation models obtained by pre-training comprises:
inputting parameters of the neurons into each evaluation model respectively to obtain the running time of the neurons evaluated by each evaluation model, and determining the running time of the neurons by fusing the obtained running time;
determining the running time of the neuron according to each running time obtained by fusion comprises the following steps: and calculating the average value of each operation time, and taking the average value as the operation time of the neuron.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the number of the evaluation models is one.
3. An evaluation model generation method, characterized by comprising:
selecting a part of neurons from neurons within a predetermined range;
respectively constructing training data corresponding to each neuron according to the selected neurons, wherein the training data comprises parameters of the neurons and the running time of the neurons;
training according to the training data to obtain an evaluation model so as to respectively determine the running time of each neuron forming the network structure by using the evaluation model and the parameters of the neurons when the running time of the network structure to be processed is required to be evaluated, and determining the running time of the network structure according to the running time of each neuron; wherein,,
the evaluation model is an XGBoost model; the determining the running time of the network structure according to the running time of each neuron comprises the following steps: adding the running time of each neuron, and taking the added sum as the running time of the network structure;
the method further comprises the steps of: for each selected neuron, the neuron is sent to a designated device to operate, and the operation time of the neuron is obtained; the appointed equipment comprises a mobile phone;
the number of the evaluation models is larger than one, so that when the operation time evaluation is required to be carried out on the network structure to be processed, the parameters of the neurons are respectively input into each evaluation model for any neuron to obtain the operation time of the neurons evaluated by each evaluation model, and the operation time of the neurons is determined by fusing the obtained operation times;
determining the running time of the neuron according to each running time obtained by fusion comprises the following steps: and calculating the average value of each operation time, and taking the average value as the operation time of the neuron.
4. The method of claim 3, wherein the step of,
the selecting a portion of neurons from neurons within a predetermined range includes: a portion of the neurons are randomly selected from all possible neurons in the search space.
5. The method of claim 3, wherein the step of,
the number of the evaluation models is one.
6. A network fabric runtime evaluation device, comprising: a disassembly unit and an evaluation unit;
the disassembly unit is used for disassembling the network structure to be processed to obtain each neuron forming the network structure;
the evaluation unit is used for determining the running time of each neuron according to the parameters of the neuron and an evaluation model obtained by training in advance, and determining the running time of the network structure according to the running time of each neuron; wherein,,
the evaluation model is an XGBoost model; the evaluation model is obtained by training in advance based on training data including a selection of a part of neurons from neurons within a predetermined range, and a run time of the neurons obtained by respectively transmitting the neurons to a specified device with respect to each of the selected neurons; the appointed equipment comprises a mobile phone;
the evaluation unit adds the running time of each neuron and takes the added sum as the running time of the network structure;
the number of the evaluation models is greater than one;
when the number of the evaluation models is larger than one, the evaluation unit inputs the parameters of the neurons into each evaluation model for each neuron to obtain the running time of the neurons evaluated by each evaluation model, and the running time of the neurons is determined by fusing the obtained running times;
the evaluation unit calculates, for each neuron, a mean value of the running times of the neurons evaluated by the respective evaluation models, and uses the mean value as the running time of the neurons.
7. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
the number of the evaluation models is one.
8. An evaluation model generation apparatus, comprising: the device comprises an acquisition unit, a construction unit and a training unit;
the acquisition unit is used for selecting partial neurons from neurons in a preset range;
the construction unit is used for respectively constructing training data corresponding to each neuron according to each selected neuron, wherein the training data comprises parameters of the neuron and the running time of the neuron;
the training unit is used for training to obtain an evaluation model according to the training data, so that when the running time of the network structure to be processed is required to be evaluated, the running time of each neuron forming the network structure is respectively determined by utilizing the evaluation model and the parameters of the neurons, and the running time of the network structure is determined according to the running time of each neuron; wherein,,
the evaluation model is an XGBoost model; the determining the running time of the network structure according to the running time of each neuron comprises the following steps: adding the running time of each neuron, and taking the added sum as the running time of the network structure; the construction unit is further used for respectively sending the neurons to a designated device for running aiming at each selected neuron to obtain the running time of the neurons; the appointed equipment comprises a mobile phone;
the number of the evaluation models is larger than one, so that when the operation time evaluation is required to be carried out on the network structure to be processed, the parameters of the neurons are respectively input into each evaluation model for any neuron to obtain the operation time of the neurons evaluated by each evaluation model, and the operation time of the neurons is determined by fusing the obtained operation times; determining the running time of the neuron according to each running time obtained by fusion comprises the following steps: and calculating the average value of each operation time, and taking the average value as the operation time of the neuron.
9. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
the acquisition unit randomly selects a portion of neurons from all possible neurons in the search space.
10. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
the number of the evaluation models is one.
11. A network fabric runtime evaluation system, comprising:
the network structure runtime evaluation device according to any one of claims 6 to 7, and the evaluation model generation device according to any one of claims 8 to 10.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when the program is executed.
13. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-5.
CN201910859244.8A 2019-09-11 2019-09-11 Network structure operation time evaluation and evaluation model generation method, system and device Active CN110738318B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910859244.8A CN110738318B (en) 2019-09-11 2019-09-11 Network structure operation time evaluation and evaluation model generation method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910859244.8A CN110738318B (en) 2019-09-11 2019-09-11 Network structure operation time evaluation and evaluation model generation method, system and device

Publications (2)

Publication Number Publication Date
CN110738318A CN110738318A (en) 2020-01-31
CN110738318B true CN110738318B (en) 2023-05-26

Family

ID=69267586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910859244.8A Active CN110738318B (en) 2019-09-11 2019-09-11 Network structure operation time evaluation and evaluation model generation method, system and device

Country Status (1)

Country Link
CN (1) CN110738318B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111353601B (en) * 2020-02-25 2024-08-06 广东七号智算技术有限公司 Method and apparatus for predicting latency of model structure

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9886670B2 (en) * 2014-06-30 2018-02-06 Amazon Technologies, Inc. Feature processing recipes for machine learning
US10896370B2 (en) * 2017-03-03 2021-01-19 International Business Machines Corporation Triage of training data for acceleration of large-scale machine learning
CN109472361B (en) * 2018-11-13 2020-08-28 钟祥博谦信息科技有限公司 Neural network optimization method
CN110070117B (en) * 2019-04-08 2023-04-07 腾讯科技(深圳)有限公司 Data processing method and device
CN110210558B (en) * 2019-05-31 2021-10-26 北京市商汤科技开发有限公司 Method and device for evaluating performance of neural network

Also Published As

Publication number Publication date
CN110738318A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
US10958748B2 (en) Resource push method and apparatus
CN111414987B (en) Training method and training device of neural network and electronic equipment
KR102424540B1 (en) Updating method of sentence generation model and sentence generation apparatus
CN110825884B (en) Embedded representation processing method and device based on artificial intelligence and electronic equipment
JP7316453B2 (en) Object recommendation method and device, computer equipment and medium
EP3992975A1 (en) Compound property analysis method and apparatus, compound property analysis model training method, and storage medium
CN111523640B (en) Training method and device for neural network model
CN110795569B (en) Method, device and equipment for generating vector representation of knowledge graph
CN108090218B (en) Dialog system generation method and device based on deep reinforcement learning
US20200101383A1 (en) Method and apparatus for recognizing game command
CN111582479B (en) Distillation method and device for neural network model
CN111667056A (en) Method and apparatus for searching model structure
CN111046176A (en) Countermeasure sample generation method and device, electronic equipment and storage medium
CN113409898B (en) Molecular structure acquisition method and device, electronic equipment and storage medium
CN114139637A (en) Multi-agent information fusion method and device, electronic equipment and readable storage medium
CN113965313A (en) Model training method, device, equipment and storage medium based on homomorphic encryption
CN110674397B (en) Method, device, equipment and readable medium for training age point prediction model
CN110738318B (en) Network structure operation time evaluation and evaluation model generation method, system and device
CN114792097B (en) Method and device for determining prompt vector of pre-training model and electronic equipment
CN115905518A (en) Emotion classification method, device and equipment based on knowledge graph and storage medium
US20220058519A1 (en) Open feature library management
CN112989219B (en) Point-of-interest recommendation method and device, electronic equipment and storage medium
CN110728355A (en) Neural network architecture searching method, device, computer equipment and storage medium
CN114065640B (en) Data processing method, device, equipment and storage medium of federal tree model
CN117151247B (en) Method, apparatus, computer device and storage medium for modeling machine learning task

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