CN112906860A - Network structure searching method and device - Google Patents

Network structure searching method and device Download PDF

Info

Publication number
CN112906860A
CN112906860A CN202110157050.0A CN202110157050A CN112906860A CN 112906860 A CN112906860 A CN 112906860A CN 202110157050 A CN202110157050 A CN 202110157050A CN 112906860 A CN112906860 A CN 112906860A
Authority
CN
China
Prior art keywords
predicted
individual
gene fusion
existing
gene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110157050.0A
Other languages
Chinese (zh)
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.)
Shenzhen University
Original Assignee
Shenzhen University
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 Shenzhen University filed Critical Shenzhen University
Priority to CN202110157050.0A priority Critical patent/CN112906860A/en
Publication of CN112906860A publication Critical patent/CN112906860A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The embodiment of the application discloses a network structure searching method and device. The method comprises the following steps: respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted; determining the individual performance relationship of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted; determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted; and selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted. By executing the scheme, the network structure searching automation can be realized, and the searching efficiency is improved while the searching performance is ensured.

Description

Network structure searching method and device
Technical Field
The embodiment of the application relates to the technical field of computer application, in particular to a network structure searching method and device.
Background
The main purpose of network structure search is to search out the optimal neural network architecture for a specific task to be performed, such as a target classification task. In general, a neural network needs to adjust a large number of hyper-parameters for different kinds of tasks, and in the process of adjustment, a great deal of effort is needed to optimize the network architecture of the neural network. The network structure searching method can realize the automation of network structure adjustment and save manpower and material resources.
At present, an automated network structure search method such as nasbot (neural architecture search with a basic optimization and optimization transport) algorithm is proposed, which provides a network structure search algorithm based on a gaussian process. The algorithm applies an OT (Optimal Transport) problem to the solution of a Gaussian process kernel function on the basis of a Gaussian process-based proxy model, and finally converts the kernel function from a display expression to an implicit expression. In the subsequent iteration process, the difference between two different networks is measured by continuously solving OT, so that the estimation of the network identification rate in the Gaussian process is completed.
However, the gaussian process has a huge demand for the training data scale, and the complicated network structure used by the NASBOT algorithm model causes more time for training the network. Therefore, the NASBOT algorithm usually takes longer time to perform accurate prediction, and cannot give consideration to both the search efficiency and the search performance. .
Disclosure of Invention
The embodiment of the application provides a network structure searching method and device, which can realize the automation of network structure searching and achieve the purpose of improving the searching efficiency and ensuring the searching performance.
In a first aspect, an embodiment of the present application provides a network structure searching method, where the method includes:
respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted;
determining the individual performance relationship of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted;
and selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
In a second aspect, an embodiment of the present application provides a network structure searching apparatus, where the apparatus includes:
the gene fusion result determining module is used for fusing genes of filial generations to be predicted and genes of existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted;
the individual performance relation determining module is used for determining the individual performance relation of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
the to-be-predicted offspring fitness value determining module is used for determining the fitness value of the to-be-predicted offspring according to the individual performance relation of each to-be-predicted gene fusion result;
and the optimal offspring determining module is used for selecting the optimal offspring from the offspring to be predicted according to the fitness value of the offspring to be predicted.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements a network structure searching method according to an embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable by the processor, where the processor executes the computer program to implement the network structure searching method according to the embodiment of the present application.
According to the technical scheme provided by the embodiment of the application, the individual performance relationship of the gene fusion result to be predicted is determined, so that the good and bad relationship between the individual performance of the filial generation to be predicted and the individual performance of the existing individuals in the population is determined, and the fitness value of the filial generation to be predicted is determined according to the individual performance relationship of the gene fusion result to be predicted; in addition, a comparison idea is adopted when the individual performance relationship is determined, namely, the better performance of the offspring to be predicted and the existing individual in the population is given to directly determine the better performance of the offspring to be predicted and the existing individual in the population, and the performances of the offspring to be predicted and the existing individual in the population are not directly predicted respectively, so that the selection accuracy of the optimal offspring is improved, and the searching efficiency of the network structure is further improved.
Drawings
Fig. 1 is a flowchart of a network structure searching method according to an embodiment of the present application;
fig. 2 is a flowchart of another network structure searching method provided in the second embodiment of the present application;
fig. 3 is a flowchart of another network structure searching method provided in the third embodiment of the present application;
FIG. 4 is a schematic diagram of the gene coding rules provided in the examples of the present application;
FIG. 5 is a schematic diagram of the gene fusion rules provided in the examples of the present application;
fig. 6 is a flowchart of another network structure searching method provided in the fourth embodiment of the present application;
fig. 7 is a flowchart of another network structure searching method provided in the fifth embodiment of the present application;
fig. 8 is a schematic structural diagram of a network structure searching apparatus according to a sixth embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an eighth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Example one
Fig. 1 is a flowchart of a network structure searching method according to an embodiment of the present disclosure, which is applicable to a case where an optimal neural network architecture is searched for a task to be executed, such as a target classification. The method can be executed by the network structure searching device provided by the embodiment of the application, and the device can be realized by software and/or hardware and can be integrated in the electronic equipment running the system.
As shown in fig. 1, the network structure searching method includes:
and S110, fusing the genes of the filial generation to be predicted and the genes of the existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted.
The filial generation and the individual are both of a specific network structure, and the filial generation to be predicted refers to the network structure of which the performance is unknown and the performance needs to be predicted. The individual is the smallest unit constituting the population, the existing individuals in the population refer to the individuals existing in the current population, and the existing individuals comprise the individuals newly added into the population and the individuals generated in the population initialization process. Optionally, the individuals in the population initialization process are randomly generated, that is, the number of network structure blocks, the number of convolutional layers, and the connection relationship between convolutional layers included in the individuals generated in the population initialization process are all random. The performance of existing individuals in the population is known, and the existing individuals have a defined performance index. The progeny to be predicted are new individuals relative to existing individuals in the population.
And respectively fusing the gene of the filial generation to be predicted and the gene of the existing individual in the population by adopting a gene fusion rule to obtain a gene fusion result to be predicted. Specifically, existing individuals in the population can be traversed, and the gene fusion rule is adopted to fuse the gene of each existing individual in the population with the gene of the offspring to be predicted, so that the gene fusion result to be predicted is obtained. The gene fusion rule is a rule for setting any two genes to obtain a gene fusion result. The gene fusion result to be predicted is associated with the offspring to be predicted participating in the gene fusion process and the existing individuals in the population, and the existing individuals participating in the gene fusion process all have corresponding gene fusion results to be predicted. It should be noted that the gene fusion rule is a rule related to the sequence, that is, the gene 1 and the gene 2 are fused in different sequences, and the fusion result 1 of the gene to be predicted and the fusion result 2 of the gene to be predicted are different.
S120, determining the individual performance relationship of the gene fusion result to be predicted; and the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the filial generation to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted.
The individual performance relationship corresponds to the gene fusion result to be predicted, the gene fusion result to be predicted is obtained by fusing the gene of the offspring to be predicted and the gene of the existing individual, and the gene fusion result to be predicted comprises all gene characteristics of the offspring to be predicted and the existing individual. And (3) determining the individual performance relationship of the gene fusion result to be predicted, namely actually determining the relationship between the individual performance of the offspring to be predicted and the existing individual. Specifically, the individual performance of which one of the offspring to be predicted and the existing individuals is better is determined.
S130, determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted.
Wherein, the fitness value is obtained by integrating the individual performance relationship between the offspring to be predicted and the existing individuals in the population. The fitness value may be used to represent the performance of the child to be predicted. Optionally, in the process of fusing the gene of the offspring to be predicted and the gene of the existing individual in the population, the existing individual in the population is randomly selected, and the selected gene of the existing individual and the gene of the offspring to be predicted are fused. In order to further improve the accuracy of the fitness value of the offspring to be predicted, preferably, all the existing individuals in the population are selected to be subjected to gene fusion with the offspring to be predicted, and the performance of the offspring to be predicted relative to all the existing individuals in the population is integrated to obtain the fitness value corresponding to the offspring to be predicted.
S140, selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
And the optimal child is the child with the optimal performance in the child to be predicted.
And when the number of the filial generations to be predicted is 1, directly selecting the filial generation to be predicted as the optimal filial generation. And when the number of the filial generations to be predicted is greater than 1, determining the optimal filial generation in all the filial generations to be predicted according to the fitness value.
According to the technical scheme provided by the embodiment of the application, the individual performance relationship of the gene fusion result to be predicted is determined, so that the good and bad relationship between the individual performance of the filial generation to be predicted and the individual performance of the existing individuals in the population is determined, and the fitness value of the filial generation to be predicted is determined according to the individual performance relationship of the gene fusion result to be predicted; in addition, a comparison idea is adopted when the individual performance relationship is determined, namely, the better performance of the offspring to be predicted and the existing individual in the population is given to directly determine the better performance of the offspring to be predicted and the existing individual in the population, and the performances of the offspring to be predicted and the existing individual in the population are not directly predicted respectively, so that the selection accuracy of the optimal offspring is improved, and the searching efficiency of the network structure is further improved.
Example two
Fig. 2 is a flowchart of another network structure searching method provided in the second embodiment of the present application. The present embodiment is further optimized on the basis of the above-described embodiments. Optionally, the operation "determining the individual performance relationship of the gene fusion result to be predicted" is refined into "determining the individual performance relationship of the gene fusion result to be predicted through a proxy model".
As shown in fig. 2, the network structure searching method includes:
s210, fusing the genes of the filial generation to be predicted and the genes of the existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted.
S220, determining the individual performance relationship of the gene fusion result to be predicted through a proxy model.
The agent model is a model used for completing the performance prediction of the descendant to be predicted. Optionally, the agent model is a machine learning model, which can complete a two-classification task, and is an exemplary random forest model. And determining the individual performance relationship of the gene fusion result to be predicted through the agent model, specifically, inputting the gene fusion result to be predicted into the agent model as an input variable, and determining the individual performance relationship of the gene fusion result to be predicted through the agent model.
Because the gene fusion result to be predicted is used as the input of the agent model, the gene fusion result actually comprises the gene information of both parties participating in the gene fusion, the offspring to be predicted and the existing individual are essentially input into the agent model, and then the agent model outputs the performance quality relation between the offspring to be predicted and the existing individual.
In an alternative embodiment, the proxy model is trained by: adopting the gene fusion rule to fuse the genes of different existing individuals in the population to obtain an existing gene fusion result; determining the quality relation between the individual performances of different existing individuals as the label data of the existing gene fusion result; and training the agent model by adopting the existing gene fusion result and the label data of the existing gene fusion result.
The performance index refers to data used for quantifying the ability of existing individuals in a population to complete a certain task to be executed. For example, the performance index may be a classification accuracy for classifying the data set CIFAR-10. The performance index of the existing individuals in the population can be obtained by selecting the task to be executed and training the existing individuals in the population by using the data set of the task to be executed.
Since the performance indexes of the existing individuals in the population are known, a training set can be constructed by utilizing the existing individuals in the population to complete the training of the agent model. Specifically, the existing gene fusion result is used as sample data. Wherein the existing gene fusion result is obtained by fusing genes of different existing individuals in a population by adopting a gene fusion rule. Alternatively, the existing gene fusion result is a one-dimensional vector. After sample data is obtained, determining label data corresponding to the sample data according to the excellent and bad relation between the individual performances of two existing individuals involved in the gene fusion process for one time. Optionally, the tag data is a number. Then, the sample data and the label data corresponding to the sample data are used for training the agent model, so that the trained agent model can determine the individual performance relationship corresponding to the gene fusion result after receiving the gene fusion result.
The individual performance relationship of the gene fusion result to be predicted is determined by adopting the pre-trained agent model, so that the determination speed of the fitness value of the offspring to be predicted can be improved.
In an alternative embodiment, determining the relative merits between the individual performances of different existing individuals as the label data of the existing gene fusion result comprises: determining the label data of the existing gene fusion result according to the following formula:
Figure BDA0002934086750000061
wherein, theiIs a first existing individual niPerformance index of (1), PjIs a second existing individual njPerformance index of (a); e is a bias parameter; y isi,jUsing the tag data to represent the first existing individual and the second existing individualThere is a good-bad relationship between the performance of the individuals.
Wherein, the first existing individual niAnd a second existing individual njAre all existing individuals in the population, the first existing individual being different from the second existing individual. The bias parameter e is an empirical value set by a person skilled in the art according to practical situations, and is set to 0.5% as an example. The bias parameter e is used to balance the fluctuations produced when training the surrogate model while balancing the gap between two individuals with similar performance. Specifically, only the first existing individual niPerformance index P ofiN is higher than the second existing individualjPerformance index P ofjA value of 0.5% can determine the first existing individual niIs superior to the second existing individual njAnd tag data yi,jIs set to 1; otherwise, the tag data yi,jIs set to 0. Illustratively, if P is set to 0.5% with the bias parameter ∈ seti=10%,PjWhen the ratio is 11%, yi,j=0,y i,j1 is ═ 1; if Pi=10%,Pj10.4%, then yi,j=0,yi,j0; if Pi=11%,PjWhen 10%, then yi,j=1,yi,j=0。
Wherein the content of the first and second substances,i,jmeans corresponding to sample data Vi,jTag data of Vi,jIndicates that the gene fusion rule is adopted and the first existing individual n is adoptediGene of the second pre-existing individual njThe gene is subjected to gene fusion in the subsequent order to obtain the existing gene fusion result. Under the condition that all existing individuals in the population participate in the gene fusion process, the number of one existing individual is NpCan generate Np(Np-1) existing gene fusion results as sample data training agent model.
And S230, determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted.
The gene fusion results to be predicted are input into the agent model, the individual performance relations are output from the agent model, and the gene fusion results to be predicted correspond to the individual performance relations one by one.
In an optional embodiment, determining the fitness value of the offspring to be predicted according to the individual performance relationship of the gene fusion result to be predicted includes: determining the fitness value of the child to be predicted according to the following formula:
Figure BDA0002934086750000071
wherein, the N ispThe number of the existing individuals in the population is represented by i, and the score is used for representing the fitness value of the offspring to be predicted; y isi,kAnd yk,iRespectively used for representing the gene fusion result V to be predictedi,kAnd Vk,iThe formula can be called as a fitness value calculation formula. Wherein, Vi,kAdopts gene fusion rule according to existing individuals n in populationiGene first, offspring n to be predictedkThe gene fusion result to be predicted, V, is obtained by gene fusion of the genes in the subsequent orderk,iIs obtained by the method and Vi,kSimilarly, no further description is provided herein. From the formula of the fitness value calculation, only in yk,i=1,yi,kThe fitness value score increases when 0 is equal to yk,i=1,yi,k0 represents the condition that the performance index of the existing individual in the population is better than the performance index of the offspring to be predicted, so that the larger the fitness value score is, the worse the performance of the offspring to be predicted is.
Wherein, Vi,kThe expression adopts a gene fusion rule according to the existing individuals n of the populationiGene first, offspring n to be predictedkCarrying out gene fusion on the genes in the subsequent sequence to obtain a gene fusion result to be predicted; accordingly, Vk,iThe expression adopts a gene fusion rule and follows the offspring n to be predictedkGene preexisting population of individuals niAnd carrying out gene fusion on the genes in the later sequence to obtain a gene fusion result to be predicted. y isi,kAnd yk,iThen respectively are providedFor output by the proxy model, corresponding to Vi,kAnd Vk,iThe individual performance relationship of (1). y isi,kAnd yk,iThere are two values, 0 or 1 respectively.
In a preferred embodiment, the fitness value of the offspring to be predicted is determined according to the individual performance relationship of the gene fusion result to be predicted. In particular, the offspring n to be predictedkN is compared with the existing individuals of the whole populationiRespectively carrying out gene fusion, wherein i represents the number of the existing individuals in the population, and the value range of i is [1, N ]p]K represents the number of the offspring to be predicted, and the value range of k can be determined according to specific practical conditions. In the case of selecting a descendant to be predicted, N can be obtainedpTo Vi,kAnd Vk,iAs input to the proxy model, the proxy model is based on NpTo Vi,kAnd Vk,iCan output NpFor yi,kAnd yk,i. Then, counting the descendant n to be predicted according to the calculation formula of scorekAnd the existing individuals in the population niThe relationship between the two, which makes the prediction of the proxy model more reliable.
S240, selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
According to the technical scheme provided by the embodiment of the application, the agent model is trained by utilizing the training data of different existing individual structures in the population to obtain the trained agent model, the individual performance relation of the gene fusion result to be predicted is determined through the agent model, and the fitness value of the offspring to be predicted is obtained according to the individual performance relation. In the whole process, the offspring to be predicted does not need to be trained, and the performance of the offspring to be predicted can be determined through the agent model. The evaluation of the performance of the offspring to be predicted is completed by comparing the performance of the two individuals, the accuracy of the agent model is improved, the requirement on the number of the existing individuals in the population can be greatly reduced by the mode, and the individuals needing to be trained in the network structure searching process are reduced. By executing the technical scheme of the application, the searching speed of the neural network architecture can be obviously improved, and the whole searching process can be completed in less time.
EXAMPLE III
Fig. 3 is a flowchart of another network structure searching method provided in the third embodiment of the present application. The present embodiment is further optimized on the basis of the above-described embodiments. Optionally, the offspring to be predicted and the existing individuals in the population are both neural network architectures. Further, before the gene fusion result to be predicted is obtained by respectively fusing the gene of the filial generation to be predicted and the gene of the existing individual in the population by adopting the gene fusion rule, the neural network architecture is partitioned according to the position information of the down-sampling layer in the neural network architecture; constructing a one-dimensional vector comprising N elements; wherein the N is equal to a number of the neural network architecture blocks; determining M sub-elements included in the element according to the architecture information of the neural network architecture block; wherein the architecture information comprises: the jump connection condition of the convolutional layers, the number of convolutional layers and the number of channels; and determining the one-dimensional vector as a gene of the neural network architecture. "
As shown in fig. 3, the network structure searching method includes:
and S310, partitioning the neural network architecture according to the position information of the down-sampling layer in the neural network architecture.
Because the offspring to be predicted and the existing individuals in the population are both neural network architectures in the embodiment of the present application, taking the convolutional neural network architecture as an example, it can be known that the convolutional neural network includes a convolutional layer, a downsampling layer, a full connection layer, and the like. The downsampling layer compresses the input feature map, reduces parameters by reducing features, and further simplifies the computational complexity of the convolutional network. The neural network architecture is partitioned according to position information of a down-sampling layer in the neural network architecture.
S320, constructing a one-dimensional vector comprising N elements; wherein the N is equal to the number of neural network architecture blocks.
A network with N blocks can be represented as
Figure BDA0002934086750000091
S330, determining M sub-elements included by the elements according to the architecture information of the neural network architecture blocks; wherein the architecture information comprises: the jump connection condition of the convolutional layers, the number of convolutional layers, and the number of channels.
The architecture information comprises convolutional layer setting mode information of neural network architecture blocks, and the type of the architecture information determines the number of sub-elements. Wherein M is a positive integer greater than or equal to 1. The jump connection condition of the convolutional layers refers to the connection condition between a certain convolutional layer and other convolutional layers in the selected architecture; the number of convolutional layers refers to the number of convolutional layers included in one neural network architecture block; the number of channels refers to the number of channels in the convolutional layer.
S340, determining the one-dimensional vector as a gene of the neural network architecture.
Because the number of elements in the one-dimensional vector is equal to the number of network blocks of the network structure, and the sub-elements included in the elements in the one-dimensional vector are determined according to the architecture information of the neural network, the one-dimensional vector includes the architecture features of the neural network architecture and can be used for representing the neural network architecture.
Fig. 4 is a schematic diagram of a gene coding rule provided in an embodiment of the present application, and as shown in fig. 4, in a case that an ith block of a neural network architecture is selected, a process of coding a network structure to obtain a gene is as follows:
partitioning the ith block of neural network architecture into genes
Figure BDA0002934086750000092
The ith element in
Figure BDA0002934086750000093
Comprising three sub-elements
Figure BDA0002934086750000094
Figure BDA0002934086750000095
Represents, three sub-elements
Figure BDA0002934086750000096
And
Figure BDA0002934086750000097
skip, layer and channel, respectively. In a neural network architecture block, each convolutional layer can select whether to accept the output of other layers or not while receiving the output of the previous layer. Thus, given a neural network architecture block containing k convolutional layers, one k-bit binary number l can be setiIndicating whether the layers use hopping connections. As used herein
Figure BDA0002934086750000098
Is represented byiThe (k) th bit of (a),
Figure BDA0002934086750000099
indicating that the k-th layer does not accept the output of the other layers,
Figure BDA00029340867500000910
indicating that the k-th layer accepts the output of the other layers. Finally, will liConverting into decimal system to obtain skip; the layer is a second sub-element and represents the number of convolutional layers in the ith block of the neural network architecture, and the number of convolutional layers in one block of the neural network architecture is counted to obtain the layer; the channel is a third sub-element and represents the number of channels of the convolutional layers in the neural network architecture block, the number of channels of each convolutional layer in the same neural network architecture is the same, and the channel can be obtained by counting the number of channels of any convolutional layer. CONV is used to represent convolutional layers in the ith block of the neural network architecture, and is a ternary operation set of ReLU-convolutional-BN.
In this example, the layer value is 6, indicating that the neural network architecture block contains 6 convolutional layers. As can be seen from the network architecture shown in FIG. 4, the layer 3 and layer 5 of the partition are subject to some sort of quotaExternal input, no additional input in other layers, and so on
Figure BDA00029340867500000911
And
Figure BDA00029340867500000912
has a value of 1, and
Figure BDA00029340867500000913
and
Figure BDA00029340867500000914
are all equal to 0. I.e. |i(0,0,1,0,1, 0). Will liThe value of skip is 10 when converted to decimal. Further, the value of the channel is 256, indicating that the number of channels per layer is 256. Therefore, the temperature of the molten metal is controlled,
Figure BDA0002934086750000101
and S350, fusing the genes of the filial generation to be predicted and the genes of the existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted.
In an optional embodiment, the gene of the offspring to be predicted and the gene of the existing individual both include N elements, and each element includes M sub-elements; respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted, wherein the gene fusion result comprises the following steps: aiming at each subelement, respectively carrying out first operation and second operation on the gene data of the subelement in the gene of the offspring to be predicted and the gene data of the subelement in the gene of the existing individual to obtain a first operation result and a second operation result; splicing the first operation result and the second operation result according to the sequence of each sub-element to obtain a gene fusion result to be predicted; wherein the first operation is different from the second operation.
The offspring gene to be predicted and the gene of the existing individual are obtained by encoding according to the gene encoding rule provided in the embodiment of the application in fig. 4, and have the same structure, that is, the offspring gene to be predicted and the gene of the existing individual both include N elements, and each element includes M sub-elements. Optionally, the first operation is an addition operation, and the second operation is a subtraction operation. Wherein, the gene data is the data of the corresponding position of the sub-elements included in the gene.
FIG. 5 is a schematic diagram of the gene fusion rule provided in the embodiment of the present application, and as shown in FIG. 5, in the case of any existing individual in the selected population, the offspring n to be predictedkAnd an existing individual niThe process of performing gene fusion of (1) is as follows:
first, define bi,jA jth sub-element of an ith element in a gene representing a neural network architecture. As shown in FIG. 5, the child n to be predictedkThe gene of (2) is called gene 1, and the existing individual niThe gene of (2) is referred to as gene 2. In this example, gene 1 was fused in the order of gene 1 before gene 2.
Specifically, as shown in fig. 5, in the dimension of the subelement, the sum and difference calculation is performed on the gene data of the number of resources at the positions corresponding to gene 1 and gene 2 to obtain the sum and difference result. And then, splicing the summation result and the difference result according to the arrangement sequence of the sub-elements until all the sub-elements in the gene 1 and the gene 2 are traversed. Illustratively, when gene 1 is (1,2,3,.., 14,15) and gene 2 is (2,3,4,.., 15,16), the gene fusion method shown in fig. 5 is used to perform gene fusion in the order of the gene 1 after the gene 2, so as to obtain a predicted gene fusion result of (3, -1,5, -1,7, -1,.., 29, -1,31, -1); if the predicted gene fusion result is obtained in the order of gene 1 before gene 2, (3,1,5,1,7,1,... multidot.29, 1,31, 1). The genes of the two neural network architectures of the offspring to be predicted and the existing individual can be fused together through a gene fusion rule.
S360, determining the individual performance relationship of the gene fusion result to be predicted; and the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the filial generation to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted.
And S370, determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted.
And S380, selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
According to the technical scheme provided by the embodiment of the application, a gene coding mode capable of highlighting architecture characteristics is designed according to the architecture characteristics of a neural network, the filial generation to be predicted and the existing individual in a population are coded to obtain a gene comprising the architecture characteristics of the filial generation to be predicted and the existing individual, and the obtained filial generation to be predicted and the gene with the architecture characteristics of the existing individual are fused together according to a gene fusion rule to obtain a gene fusion result to be predicted. The gene coding mode and the gene fusion rule in the embodiment of the application are designed aiming at the architecture characteristics of the neural network, and the accuracy of network structure search can be improved by executing the technical scheme of the application.
Example four
Fig. 6 is a flowchart of another network structure searching method according to the fourth embodiment of the present application. The present embodiment is further optimized on the basis of the above-described embodiments. Optionally, before the "adopting the gene fusion rule, respectively fusing the gene of the offspring to be predicted and the gene of the existing individual in the population to obtain the gene fusion result to be predicted", additionally operating "adopting the offspring determination rule, and selecting a father individual and a mother individual in the population; respectively fusing the genes of the father individual and the genes of the mother individual with the genes of the existing individuals in the population by adopting the gene fusion rule to obtain a father gene fusion result and a mother gene fusion result; respectively determining individual performance relations of the father gene fusion result and the mother gene fusion result, and respectively determining fitness values of the father individual and the mother individual according to the individual performance relations; determining an optimal parent among the parent and the parent based on the fitness value; performing preset mutation operation on the optimal parent to obtain the offspring to be predicted; wherein the preset mutation operation comprises any one of the following operations: adding convolutional layers, changing the number of channels, removing convolutional layers, adding a jump connection, changing a jump connection, removing a jump connection, adding a downsampling layer, and removing a downsampling layer. "
As shown in fig. 6, the network structure searching method includes:
s610, adopting a descendant determination rule, and selecting a father individual and a mother individual from the population.
The child determination rule is a rule for determining a child, and optionally, the child determination rule may be a binary tournament, a decimal tournament, or roulette. And selecting a parent individual and a mother individual from the existing individuals in the population by using a progeny determination rule.
S620, fusing the genes of the father individuals and the genes of the mother individuals with the genes of the existing individuals in the population respectively by adopting the gene fusion rule to obtain a father gene fusion result and a mother gene fusion result.
Wherein, the father and mother individuals are generated in the existing individuals in the population, and the father and mother individuals are coded by adopting a gene coding rule to obtain father and mother individual genes. The paternal gene fusion result is obtained by fusing genes of the father individual and other existing individuals in the population except the father individual and the mother individual respectively; correspondingly, the maternal gene fusion result is obtained by fusing the genes of the parent individual and other existing individuals in the population except the parent individual and the parent individual respectively.
S630, respectively determining individual performance relations of the father gene fusion result and the mother gene fusion result, and respectively determining fitness values of the father individual and the mother individual according to the individual performance relations.
Optionally, the parent gene fusion result is input into the trained agent model, and the agent model outputs an individual performance relationship of the parent gene fusion result, where the individual performance relationship of the parent gene fusion result refers to a good-bad relationship between the individual performance of the parent individual and the individual performance of other existing individuals in the population except the parent individual and the mother individual, and each parent gene fusion result has a corresponding individual performance relationship.
Correspondingly, the individual performance relationship of the maternal gene fusion result can also be obtained through a proxy model, the individual performance relationship of the maternal gene fusion result refers to the good-bad relationship between the individual performance of the maternal individual and the individual performance of other existing individuals in the population except the father individual and the maternal individual, and each maternal gene fusion result has a corresponding individual performance relationship.
After the individual performance relationship of the parent gene fusion result and the individual performance relationship of the parent gene fusion result are obtained, the individual performance relationship of the parent gene fusion result and the individual performance relationship of the parent gene fusion result can be calculated through the fitness value calculation formula provided by the embodiment of the invention, so that the fitness value of the parent and the fitness value of the parent are obtained.
And S640, determining the optimal parent in the parent individual and the mother individual according to the fitness value.
If the fitness value of the parent individual is smaller than that of the parent individual, determining the parent individual as an optimal parent; otherwise, the parent individual is determined to be the best parent.
S650, carrying out preset mutation operation on the optimal parent to obtain the offspring to be predicted; wherein the preset mutation operation comprises any one of the following operations: adding convolutional layers, changing the number of channels, removing convolutional layers, adding a jump connection, changing a jump connection, removing a jump connection, adding a downsampling layer, and removing a downsampling layer.
And (3) carrying out one of the 8 mutation operations on the optimal parent, actually carrying out mutation on the gene of the optimal parent to obtain the filial generation after evolution, wherein the filial generation is the filial generation to be predicted. The method comprises the following steps of adding a convolution layer, changing the number of channels, removing the convolution layer, adding a jump connection, changing the jump connection and removing the jump connection, wherein mutation operations can affect gene data of a base factor element, and adding a down-sampling layer and removing the down-sampling layer are down-sampling layer adding and down-sampling layer removing, and the two mutation operations can affect the number of the gene elements.
Optionally, the steps S610 to S650 are executed in a loop until the number of offspring to be predicted evolved from the existing individuals in the population reaches the upper limit of the number of offspring to be predicted. Illustratively, an optimal parent is selected from existing individuals in a population, one of the variation operations in the 8 is randomly selected, and the optimal parent is varied to obtain offspring to be predicted until the number of the offspring to be predicted reaches 5000.
And S660, fusing the genes of the filial generation to be predicted and the genes of the existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted.
S670, determining the individual performance relationship of the gene fusion result to be predicted.
And S680, determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted.
And S690, selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
Continuing the above example, after the processing of steps S660 to S680, the fitness value of each child of the 5000 children to be predicted can be obtained, and the child with the lowest fitness value is selected from the 5000 children to be predicted as the optimal child.
According to the technical scheme provided by the embodiment of the application, the father individual and the mother individual are selected from the existing individuals of the population, the optimal parent is determined in the father individual and the mother individual according to the individual performance relation, and the optimal parent is subjected to mutation operation to obtain the offspring to be predicted.
EXAMPLE five
Fig. 7 is a flowchart of another network structure searching method provided in the fifth embodiment of the present application. The present embodiment is further optimized on the basis of the above-described embodiments. Optionally, after "selecting an optimal descendant from the descendants to be predicted according to the fitness value of the descendant to be predicted", an additional operation "training the optimal descendant by using a training data set of a task to be executed to obtain a performance index of the optimal descendant for the task to be executed;
adding the optimal progeny and the performance index of the optimal progeny to the population. "
As shown in fig. 7, the network structure searching method includes:
and S710, fusing the genes of the filial generation to be predicted and the genes of the existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted.
S720, determining the individual performance relationship of the gene fusion result to be predicted.
And S730, determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted.
And S740, selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
And S750, training the optimal filial generation by using the training data set of the task to be executed to obtain the performance index of the optimal filial generation for the task to be executed.
Illustratively, the training dataset of the task to be executed is a dataset CIFAR-10 for a target classification task, and the dataset for training the optimal offspring and the dataset for training the existing individuals in the population belong to the same task to be executed. In order to reduce the scale of the training set, speed up the training, and reduce the time cost generated by the training, optionally, the data set of the task to be executed is sampled to obtain the training data set used for training the optimal offspring or the existing individuals. Preferably, the data set of the task to be executed is sampled in a uniform sampling manner.
Illustratively, under the condition that the task to be executed is a target classification task and the training data set of the task to be executed is obtained by uniformly sampling the data set CIFAR-10, the training data set is utilized to train the optimal offspring to obtain the target classification accuracy of the optimal offspring, and the target classification accuracy is used as the performance index of the optimal offspring for the target classification task.
S760, adding the optimal offspring and the performance indexes of the optimal offspring to the population.
The optimal offspring and the performance indexes of the optimal offspring are added into the population and used as the existing individuals in the population, so that the population scale can be enlarged, and the accuracy of the agent model for individual performance prediction is improved. And continuously adding offspring to be predicted into the population until the number of the existing individuals in the population reaches the upper limit of the existing individuals in the population. Since all the existing individuals in the population are used as candidate objects of the optimal network structure, under a certain condition, the more the number of the existing individuals in the population is, the more the performance of the optimal network structure generated from the existing individuals in the population is for the task to be executed is excellent, the upper limit of the number of the existing individuals in the population is an empirical value designed by related technicians according to actual conditions, and is not limited herein.
In order to make the performance prediction of the offspring to be predicted by the agent model more accurate, optionally, after the performance indexes of the optimal offspring and the optimal offspring are added into the population to become the existing individuals in the population, the existing individuals in the population are continuously used for training the agent model, that is, except for the beginning, after the initial training of the agent model is completed by the existing individuals generated in the population initialization process, each time the optimal offspring is added into the population, the existing individuals in the population are used for training the agent model.
In an optional embodiment, after adding the optimal offspring and the performance index of the optimal offspring to the population, the method further comprises: and selecting the individual with the highest performance index in the population as the optimal solution for the task to be executed according to the performance index.
The optimal solution is an optimal network structure for a specific task to be executed, and the optimal solution is associated with the specific task to be executed. Existing individuals in the population are used as candidate objects of the optimal solution, and one of the existing individuals in the population with the highest performance index is selected as the optimal solution for the task to be executed according to the performance indexes of the existing individuals for the task to be executed. Optionally, the Network structure Search method provided by the present application is installed on a server or a workstation with a GPU (graphics Processing Unit) accelerator card, that is, a whole NAS (Network Architecture Search) system is formed.
According to the technical scheme provided by the embodiment of the application, the optimal offspring selected from the offspring to be predicted is added into the population, the population scale is continuously enlarged, the probability of generating a network structure with better performance aiming at the task to be executed in the population is improved, and the accuracy of network structure searching is further improved. In addition, the optimal offspring and the performance indexes of the optimal offspring are added into the population to become the existing individuals in the population, the existing individuals in the population are continuously utilized to train the agent model, and the accuracy of the agent model for predicting the performance of the offspring to be predicted is effectively improved by training the agent model for multiple times.
EXAMPLE six
Fig. 8 is a network structure searching apparatus according to a sixth embodiment of the present application, which is applicable to a case where an optimal neural network architecture is searched for a task to be performed, such as target classification. The device can be realized by software and/or hardware, and can be integrated in electronic equipment such as an intelligent terminal.
As shown in fig. 8, the apparatus may include: a gene fusion result to be predicted determining module 810, an individual performance relationship determining module 820, a descendant fitness value to be predicted determining module 830 and an optimal descendant determining module 840.
A gene fusion result determining module 810 for fusing the gene of the offspring to be predicted and the gene of the existing individual in the population respectively by using a gene fusion rule to obtain a gene fusion result to be predicted;
an individual performance relationship determining module 820, configured to determine an individual performance relationship of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
a to-be-predicted offspring fitness value determining module 830, configured to determine the fitness value of the to-be-predicted offspring according to the individual performance relationship of each to-be-predicted gene fusion result;
an optimal offspring determining module 840, configured to select an optimal offspring from the offspring to be predicted according to the fitness value of the offspring to be predicted.
According to the technical scheme provided by the embodiment of the application, the individual performance relationship of the gene fusion result to be predicted is determined, so that the good and bad relationship between the individual performance of the filial generation to be predicted and the individual performance of the existing individuals in the population is determined, and the fitness value of the filial generation to be predicted is determined according to the individual performance relationship of the gene fusion result to be predicted; in addition, a comparison idea is adopted when the individual performance relationship is determined, namely, the better performance of the offspring to be predicted and the existing individual in the population is given to directly determine the better performance of the offspring to be predicted and the existing individual in the population, and the performances of the offspring to be predicted and the existing individual in the population are not directly predicted respectively, so that the selection accuracy of the optimal offspring is improved, and the searching efficiency of the network structure is further improved.
Optionally, the gene of the offspring to be predicted and the gene of the existing individual both include N elements, and each element includes M sub-elements; the module 810 for determining the result of gene fusion to be predicted includes: the operation result determining submodule is used for respectively carrying out first operation and second operation on the gene data of the sub-element in the gene of the offspring to be predicted and the gene data of the sub-element in the gene of the existing individual aiming at each sub-element to obtain a first operation result and a second operation result; the prediction gene fusion result determining submodule is used for splicing the first operation result and the second operation result according to the sequence of each subelement to obtain the gene fusion result to be predicted; wherein the first operation is different from the second operation.
Optionally, the individual performance relationship determining module 820 includes: and the individual performance relation determining submodule is used for determining the individual performance relation of the gene fusion result to be predicted through the proxy model.
The apparatus 800 further comprises an agent model determining module, specifically configured to train the agent model; a proxy model determination module comprising: the existing gene fusion result determining submodule is used for fusing genes of different existing individuals in the population by adopting the gene fusion rule to obtain an existing gene fusion result; the tag data determining submodule is used for determining the good-bad relation between the individual performances of different existing individuals and using the good-bad relation as the tag data of the existing gene fusion result; and the agent model determining submodule is used for training the agent model by adopting the existing gene fusion result and the label data of the existing gene fusion result.
Optionally, the tag data determination submodule is specifically configured to determine the tag data of the existing gene fusion result according to the following formula:
Figure BDA0002934086750000161
wherein, theiIs a first existing individual niPerformance index of (1), PjIs a second existing individual njPerformance index of (a); e is a bias parameter; y isi,jThe tag data is used for representing the good-bad relation between the performances of the first existing individual and the second existing individual.
Optionally, the module 830 for determining fitness value of the child to be predicted is specifically configured to determine the fitness value of the child to be predicted according to the following formula:
Figure BDA0002934086750000162
wherein, the N ispThe i table represents the number of existing individuals in the populationThe score is used for representing the fitness value of the filial generation to be predicted; y isi,kAnd yk,iRespectively used for representing the gene fusion result V to be predictedi,kAnd Vk,iThe individual performance relationship of (1).
Optionally, the apparatus 800 further includes: the optimal offspring performance index determining module is used for selecting an optimal offspring from the offspring to be predicted according to the fitness value of the offspring to be predicted, and then training the optimal offspring by using a training data set of a task to be executed to obtain the performance index of the optimal offspring for the task to be executed; a population expansion module to add the optimal offspring and the performance index of the optimal offspring to the population.
Optionally, the apparatus 800 further includes: and the optimal solution determining module is used for selecting an individual with the highest performance index in the population as the optimal solution for the task to be executed according to the performance indexes after the optimal filial generation and the performance indexes of the optimal filial generation are added to the population.
Optionally, the apparatus 800 further includes: a parent individual determining module, which is used for adopting a gene fusion rule to respectively fuse the gene of the filial generation to be predicted and the gene of the existing individual in the population, and adopting the filial generation determining rule to select a father individual and a mother individual in the population before obtaining the gene fusion result to be predicted;
a paternal gene fusion result and maternal gene fusion result determining module, configured to fuse the genes of the paternal individuals and the genes of the maternal individuals with the genes of the existing individuals in the population respectively by using the gene fusion rule, so as to obtain a paternal gene fusion result and a maternal gene fusion result;
a parent individual fitness value and parent individual fitness value determining module, which is used for respectively determining the individual performance relationship of the parent gene fusion result and respectively determining the fitness values of the parent individual and the parent individual according to the individual performance relationship;
an optimal parent determining module for determining an optimal parent among the parent individual and the parent individual based on the fitness value;
a to-be-predicted offspring determining module, configured to perform a preset mutation operation on the optimal parent to obtain the to-be-predicted offspring; wherein the preset mutation operation comprises any one of the following operations: adding convolutional layers, changing the number of channels, removing convolutional layers, adding a jump connection, changing a jump connection, removing a jump connection, adding a downsampling layer, and removing a downsampling layer.
Optionally, the offspring to be predicted and the existing individuals in the population are both neural network architectures; correspondingly, the apparatus 800 further comprises: the neural network architecture partitioning module is used for partitioning the neural network architecture according to position information of a down-sampling layer in the neural network architecture before the gene fusion rule is adopted to respectively fuse genes of filial generations to be predicted and genes of existing individuals in a population to obtain a gene fusion result to be predicted; the one-dimensional vector constructing module is used for constructing a one-dimensional vector comprising N elements; wherein the N is equal to a number of the neural network architecture blocks; the sub-element determining module is used for determining M sub-elements included by the elements according to the architecture information of the neural network architecture blocks; wherein the architecture information comprises: the jump connection condition of the convolutional layers, the number of convolutional layers and the number of channels; and the gene determining module is used for determining the one-dimensional vector as the gene of the neural network architecture.
The network structure searching device provided by the embodiment of the invention can execute the network structure searching method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the network structure searching method.
EXAMPLE seven
A seventh embodiment of the present application further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a network structure search method, including:
respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted;
determining the individual performance relationship of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted;
and selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
Storage media refers to any of various types of memory electronics or storage electronics. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system connected to the computer system through a network (such as the internet). The second computer system may provide the program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different unknowns (e.g., in different computer systems connected by a network). The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the network structure searching operation described above, and may also perform related operations in the network structure searching method provided in any embodiments of the present application.
Example eight
An eighth embodiment of the present application provides an electronic device, where the network structure search apparatus provided in the embodiment of the present application may be integrated in the electronic device, and the electronic device may be configured in a system, or may be a device that performs part or all of functions in the system. Fig. 9 is a schematic structural diagram of an electronic device according to an eighth embodiment of the present application. As shown in fig. 9, the present embodiment provides an electronic apparatus 900, which includes: one or more processors 920; the storage device 910 is configured to store one or more programs, and when the one or more programs are executed by the one or more processors 920, the one or more processors 920 may implement the network structure searching method provided in the embodiment of the present application.
Of course, it can be understood by those skilled in the art that the processor 920 also implements the technical solution of the network structure searching method provided in any embodiment of the present application.
The electronic device 900 shown in fig. 9 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 9, the electronic device 900 includes a processor 920, a storage device 910, an input device 930, and an output device 940; the number of the processors 920 in the electronic device may be one or more, and one processor 920 is taken as an example in fig. 9; the processor 920, the storage device 910, the input device 930, and the output device 940 in the electronic apparatus may be connected by a bus or other means, and fig. 9 illustrates an example in which the processor, the storage device 910, the input device 930, and the output device 940 are connected by a bus 950.
The storage device 910 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and module units, such as program instructions corresponding to the network structure searching method in the embodiment of the present application.
The storage device 910 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. In addition, the storage 910 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the storage device 910 may further include memory located remotely from the processor 920, which may be connected via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 930 may be used to receive input numbers, character information, or voice information, and to generate key signal inputs related to user settings and function control of the electronic apparatus. Output device 940 may include a display screen, speakers, or other electronic device.
The network structure searching device, the medium and the electronic device provided in the above embodiments may execute the network structure searching method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to a network structure search method provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. A method for searching a network structure, the method comprising:
respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted;
determining the individual performance relationship of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
determining the fitness value of the filial generation to be predicted according to the individual performance relation of the gene fusion result to be predicted;
and selecting the optimal filial generation from the filial generation to be predicted according to the fitness value of the filial generation to be predicted.
2. The method according to claim 1, wherein the gene of the offspring to be predicted and the gene of the existing individual each include N elements, and each element includes M subelements;
respectively fusing genes of filial generations to be predicted and genes of existing individuals in a population by adopting a gene fusion rule to obtain a gene fusion result to be predicted, wherein the gene fusion result comprises the following steps:
aiming at each subelement, respectively carrying out first operation and second operation on the gene data of the subelement in the gene of the offspring to be predicted and the gene data of the subelement in the gene of the existing individual to obtain a first operation result and a second operation result;
splicing the first operation result and the second operation result according to the sequence of each sub-element to obtain a gene fusion result to be predicted;
wherein the first operation is different from the second operation.
3. The method of claim 1, wherein determining the individual performance relationship of the gene fusion outcome to be predicted comprises:
determining the individual performance relationship of the gene fusion result to be predicted through a proxy model;
wherein the agent model is obtained by training in the following way:
adopting the gene fusion rule to fuse the genes of different existing individuals in the population to obtain an existing gene fusion result;
determining the quality relation between the individual performances of different existing individuals as the label data of the existing gene fusion result;
and training the agent model by adopting the existing gene fusion result and the label data of the existing gene fusion result.
4. The method of claim 3, wherein said determining the relative merits between the individual performance of different pre-existing individuals as the label data of the pre-existing gene fusion results comprises:
determining the label data of the existing gene fusion result according to the following formula:
Figure FDA0002934086740000011
wherein, the PiIs a first existing individual niPerformance index of (1), PjIs a second existing individual njPerformance index of (a); e is a bias parameter; y isi,jThe tag data is used for representing the good-bad relation between the performances of the first existing individual and the second existing individual.
5. The method of claim 1, wherein determining fitness values of the offspring to be predicted according to the individual performance relationship of the fusion result of each gene to be predicted comprises:
determining the fitness value of the child to be predicted according to the following formula:
Figure FDA0002934086740000021
wherein, the N ispThe number of the existing individuals in the population is represented by i, and the score is used for representing the fitness value of the offspring to be predicted; y isi,kAnd yk,iRespectively used for representing the gene fusion result V to be predictedi,kAnd Vk,iThe individual performance relationship of (1).
6. The method of claim 1, wherein after selecting the best offspring from the offspring to be predicted according to the fitness value of the offspring to be predicted, the method further comprises:
training the optimal offspring by utilizing a training data set of the task to be executed to obtain a performance index of the optimal offspring aiming at the task to be executed;
adding the optimal progeny and the performance index of the optimal progeny to the population.
7. The method of claim 6, wherein after adding the optimal progeny and the performance index of the optimal progeny to the population, the method further comprises:
and selecting the individual with the highest performance index in the population as the optimal solution for the task to be executed according to the performance index.
8. The method of claim 1, wherein before the gene fusion rule is adopted to fuse the gene of the offspring to be predicted and the gene of the existing individual in the population respectively to obtain the gene fusion result to be predicted, the method further comprises:
selecting a parent individual and a parent individual in the population by adopting a progeny determination rule;
respectively fusing the genes of the father individual and the genes of the mother individual with the genes of the existing individuals in the population by adopting the gene fusion rule to obtain a father gene fusion result and a mother gene fusion result;
respectively determining individual performance relations of the father gene fusion result and the mother gene fusion result, and respectively determining fitness values of the father individual and the mother individual according to the individual performance relations;
determining an optimal parent among the parent and the parent based on the fitness value;
performing preset mutation operation on the optimal parent to obtain the offspring to be predicted;
wherein the preset mutation operation comprises any one of the following operations: adding convolutional layers, changing the number of channels, removing convolutional layers, adding a jump connection, changing a jump connection, removing a jump connection, adding a downsampling layer, and removing a downsampling layer.
9. The method according to claim 1 or 2, wherein the offspring to be predicted and the existing individuals in the population are both neural network architectures; correspondingly, before the gene fusion rule is adopted to fuse the gene of the offspring to be predicted and the gene of the existing individual in the population respectively to obtain the gene fusion result to be predicted, the method further comprises the following steps:
partitioning the neural network architecture according to position information of a down-sampling layer in the neural network architecture;
constructing a one-dimensional vector comprising N elements; wherein the N is equal to a number of the neural network architecture blocks;
determining M sub-elements included in the element according to the architecture information of the neural network architecture block; wherein the architecture information comprises: the jump connection condition of the convolutional layers, the number of convolutional layers and the number of channels;
and determining the one-dimensional vector as a gene of the neural network architecture.
10. A network structure search apparatus, characterized in that the apparatus comprises:
the gene fusion result determining module is used for fusing genes of filial generations to be predicted and genes of existing individuals in the population respectively by adopting a gene fusion rule to obtain a gene fusion result to be predicted;
the individual performance relation determining module is used for determining the individual performance relation of the gene fusion result to be predicted; the individual performance relationship of the gene fusion result to be predicted is used for expressing the good-bad relationship between the individual performance of the offspring to be predicted and the individual performance of the existing individual in the gene fusion result to be predicted;
the to-be-predicted offspring fitness value determining module is used for determining the fitness value of the to-be-predicted offspring according to the individual performance relation of each to-be-predicted gene fusion result;
and the optimal offspring determining module is used for selecting the optimal offspring from the offspring to be predicted according to the fitness value of the offspring to be predicted.
CN202110157050.0A 2021-02-04 2021-02-04 Network structure searching method and device Pending CN112906860A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110157050.0A CN112906860A (en) 2021-02-04 2021-02-04 Network structure searching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110157050.0A CN112906860A (en) 2021-02-04 2021-02-04 Network structure searching method and device

Publications (1)

Publication Number Publication Date
CN112906860A true CN112906860A (en) 2021-06-04

Family

ID=76122633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110157050.0A Pending CN112906860A (en) 2021-02-04 2021-02-04 Network structure searching method and device

Country Status (1)

Country Link
CN (1) CN112906860A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800093A (en) * 2012-07-12 2012-11-28 西安电子科技大学 Multi-target remote sensing image segmentation method based on decomposition
CN103345657A (en) * 2013-04-02 2013-10-09 江苏大学 Task scheduling method based on heredity and ant colony in cloud computing environment
US20180322368A1 (en) * 2017-05-02 2018-11-08 Kodak Alaris Inc. System an method for batch-normalized recurrent highway networks
CN108960491A (en) * 2018-06-15 2018-12-07 常州瑞信电子科技有限公司 Method for forecasting photovoltaic power generation quantity based on RBF neural

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800093A (en) * 2012-07-12 2012-11-28 西安电子科技大学 Multi-target remote sensing image segmentation method based on decomposition
CN103345657A (en) * 2013-04-02 2013-10-09 江苏大学 Task scheduling method based on heredity and ant colony in cloud computing environment
US20180322368A1 (en) * 2017-05-02 2018-11-08 Kodak Alaris Inc. System an method for batch-normalized recurrent highway networks
CN108960491A (en) * 2018-06-15 2018-12-07 常州瑞信电子科技有限公司 Method for forecasting photovoltaic power generation quantity based on RBF neural

Similar Documents

Publication Publication Date Title
CN108920720B (en) Large-scale image retrieval method based on depth hash and GPU acceleration
Salesi et al. TAGA: Tabu Asexual Genetic Algorithm embedded in a filter/filter feature selection approach for high-dimensional data
CN107545276A (en) The various visual angles learning method of joint low-rank representation and sparse regression
CN110222838B (en) Document sorting method and device, electronic equipment and storage medium
CN112906865B (en) Neural network architecture searching method and device, electronic equipment and storage medium
Dong et al. An Adaptive Multiobjective Genetic Algorithm with Fuzzy c‐Means for Automatic Data Clustering
CN112395487A (en) Information recommendation method and device, computer-readable storage medium and electronic equipment
CN112164426A (en) Drug small molecule target activity prediction method and device based on TextCNN
CN113282756A (en) Text clustering intelligent evaluation method based on hybrid clustering
CN111079074A (en) Method for constructing prediction model based on improved sine and cosine algorithm
CN113391894A (en) Optimization method of optimal hyper-task network based on RBP neural network
CN112420125A (en) Molecular attribute prediction method and device, intelligent equipment and terminal
Xavier-Júnior et al. A novel evolutionary algorithm for automated machine learning focusing on classifier ensembles
Ganepola et al. Automating generative adversarial networks using neural architecture search: A review
CN112906860A (en) Network structure searching method and device
CN113704565B (en) Learning type space-time index method, device and medium based on global interval error
Yan [Retracted] Audience Evaluation and Analysis of Symphony Performance Effects Based on the Genetic Neural Network Algorithm for the Multilayer Perceptron (GA‐MLP‐NN)
CN115081856A (en) Enterprise knowledge management performance evaluation device and method
CN114595787A (en) Recommendation model training method, recommendation device, medium and equipment
CN113128544B (en) Method and device for training artificial intelligent model
CN111260077A (en) Method and device for determining hyper-parameters of business processing model
CN112884028A (en) System resource adjusting method, device and equipment
Zafar et al. An Optimization Approach for Convolutional Neural Network Using Non-Dominated Sorted Genetic Algorithm-II.
CN113869380B (en) Kmeans clustering-based data classification method and device and electronic equipment
CN113920514A (en) Target detection-oriented high-efficiency evolutionary neural network architecture searching method

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604

RJ01 Rejection of invention patent application after publication