Neural network architecture search method and apparatus
By acquiring the feature vectors of the target dataset and platform, and using a precision prediction model to automatically select the search space and algorithm for neural network architecture search, the problem of fixed search space limitations in existing technologies is solved, and more efficient neural network architecture search is achieved.
Patent Information
- Application Number
- CN202210313420.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In existing technologies for neural network architecture search, the pre-defined search space limits the ability of automated machine learning, making it impossible to effectively select a suitable search space and search algorithm.
By acquiring the target dataset, target platform, candidate search space set, candidate search algorithm set, and benchmark model set, the target feature vector is calculated, and the target search space and target search algorithm that meet the test accuracy conditions are determined using the accuracy prediction model, thereby achieving automatic selection of the search space and search algorithm.
It improves the autonomy and flexibility of the search space and search algorithm, enhances the accuracy and applicability of neural network architecture search, and improves the accuracy and search quality of the target neural network.
Smart Images

Figure CN114662669B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to the technical field of computer and the technical field of Internet, in particular to the technical field of artificial intelligence, and more particularly to a neural network architecture search method and device. BACKGROUND
[0002] With the continuous development and wide application of deep neural networks, the design of neural network structure is transforming from manual design to machine automatic design. Through neural network architecture search (NAS), the optimal neural network structure can be automatically searched by developers. Based on how to generate candidate network structures, existing technologies are divided into reinforcement learning, evolutionary learning, differential method and Bayesian optimization.
[0003] Existing technologies all assume that the search space is fixed and pre-defined, including unit structure, chain structure, chain jump structure, hierarchical structure, etc. For example, in the unit-based architecture search, the number of units and nodes is pre-defined; in the chain structure search space, the maximum number of layers and other information need to be pre-defined, etc. However, due to the pre-defined search space, fixing the search space before designing the search algorithm will limit the ability of automated machine learning. SUMMARY
[0004] Embodiments of the present disclosure provide a neural network architecture search method, device, electronic equipment and computer readable medium.
[0005] In a first aspect, the embodiments of the present disclosure provide a neural network architecture search method, comprising: obtaining a target dataset, a target platform, a candidate search space set, a candidate search algorithm set and a benchmark model set, wherein the candidate search space set comprises a plurality of candidate search spaces in a plurality of candidate platforms, and the benchmark model set comprises a plurality of benchmark models in the plurality of candidate search spaces; calculating a target feature vector corresponding to the target dataset in the target platform, the target feature vector comprising a performance parameter of each benchmark model in the target platform for the target dataset; determining a target search space and a target search algorithm that meet a first preset condition in test accuracy based on the target feature vector, the candidate search algorithm set, the candidate search space set and an accuracy prediction model; and searching a target neural network based on the target search space and the target search algorithm.
[0006] In some embodiments, determining a target search space and a target search algorithm whose test accuracy meets a first preset condition based on a target feature vector, a set of candidate search algorithms, a set of candidate search spaces, and an accuracy prediction model includes: fixing candidate search algorithms in the set of candidate search algorithms; inputting the target feature vector, candidate search algorithms, and each candidate search space in the set of candidate search spaces into the accuracy prediction model to generate a first test accuracy set corresponding to each candidate search space; determining a target search space whose first test accuracy meets the first preset condition based on the first test accuracy set; inputting the target feature vector, each candidate search algorithm in the set of candidate search algorithms, and the target search space into the accuracy prediction model to generate a second test accuracy set corresponding to each candidate search algorithm; and determining a target search algorithm whose second test accuracy meets the first preset condition based on the second test accuracy set.
[0007] In some embodiments, the accuracy prediction model is obtained based on the following steps: obtaining a first candidate dataset and calculating the candidate feature vector corresponding to the first candidate dataset in the target platform; determining the search space and search algorithm that meet the first preset condition for the test accuracy based on the candidate feature vector, the candidate search algorithm set, the candidate search space set, and the initial model used to predict the test accuracy; and determining the accuracy prediction model based on the search space, the search algorithm, and the initial model.
[0008] In some embodiments, determining an accuracy prediction model based on a search space, a search algorithm, and an initial model includes: determining a candidate neural network based on the search space and the search algorithm; training and obtaining the performance parameters of the candidate neural network; and adjusting the initial model based on the performance parameters of the candidate neural network to obtain the accuracy prediction model.
[0009] In some embodiments, the candidate search space set is obtained in the following manner: obtaining a second candidate dataset, multiple initial platforms, an initial search space set, and an initial benchmark model set; obtaining the initial performance parameters of each initial benchmark model on the initial platform for the second candidate dataset; based on the initial performance parameters, obtaining the initial platform corresponding to the initial benchmark model that meets the second preset condition, and merging the initial search spaces of the corresponding initial platforms to obtain the candidate search space; and generating a candidate search space set based on the candidate search space and the initial search space.
[0010] In some embodiments, searching for a target neural network based on a target search space and a target search algorithm includes: obtaining the search type of the target search algorithm; and performing a search using a search method corresponding to the search type based on the target search space and the target search algorithm to obtain a multi-target neural network.
[0011] In some embodiments, based on the target search space and the target search algorithm, the search is performed using a search manner corresponding to the search type to obtain the multi-objective neural network, including: in response to determining that the search type of the target search algorithm is a black-box search manner, based on the target search space and the target search algorithm, the search is performed using a multi-objective function value to obtain the multi-objective neural network.
[0012] In some embodiments, based on the target search space and the target search algorithm, the search is performed using a search manner corresponding to the search type to obtain the multi-objective neural network, including: in response to determining that the search type of the target search algorithm is a differential search manner, based on the target search space and the target search algorithm, the search is performed using a multi-objective loss function value to obtain the multi-objective neural network.
[0013] In a second aspect, embodiments of the present disclosure provide a neural network architecture search device, the device comprising: an acquisition module configured to acquire a target dataset, a target platform, a candidate search space set, a candidate search algorithm set and a benchmark model set, wherein the candidate search space set comprises a plurality of candidate search spaces in a plurality of candidate platforms, and the benchmark model set comprises a plurality of benchmark models in the plurality of candidate search spaces; a calculation module configured to calculate a target feature vector corresponding to the target dataset in the target platform, the target feature vector comprising a performance parameter of each benchmark model in the target platform for the target dataset; a determination module configured to determine a target search space and a target search algorithm whose test accuracy meets a first preset condition based on the target feature vector, the candidate search algorithm set, the candidate search space set and an accuracy prediction model; and a search module configured to search for a target neural network based on the target search space and the target search algorithm.
[0014] In some embodiments, the determination module comprises: a first generation unit configured to fix a candidate search algorithm in the candidate search algorithm set, input the target feature vector, the candidate search algorithm and each candidate search space in the candidate search space set into the accuracy prediction model, and generate a first test accuracy set corresponding to each candidate search space; a first determination unit configured to determine the target search space whose first test accuracy meets the first preset condition based on the first test accuracy set; a second generation unit configured to input the target feature vector, each candidate search algorithm in the candidate search algorithm set and the target search space into the accuracy prediction model, and generate a second test accuracy set corresponding to each candidate search algorithm; and a second determination unit configured to determine the target search algorithm whose second test accuracy meets the first preset condition based on the second test accuracy set.
[0015] In some embodiments, the precision prediction model is obtained based on the following steps: obtaining a first candidate dataset, and calculating a candidate feature vector corresponding to the first candidate dataset in a target platform; determining a search space and a search algorithm that meet a first preset condition for test precision based on the candidate feature vector, a candidate search algorithm set, a candidate search space set, and an initial model for predicting test precision; and determining the precision prediction model based on the search space, the search algorithm, and the initial model.
[0016] In some embodiments, the precision prediction model is determined based on the search space, the search algorithm, and the initial model, including: determining a candidate neural network based on the search space and the search algorithm; training and obtaining a performance parameter of the candidate neural network; and adjusting the initial model based on the performance parameter of the candidate neural network to obtain the precision prediction model.
[0017] In some embodiments, the candidate search space set is obtained based on the following manner: obtaining a second candidate dataset, a plurality of initial platforms, an initial search space set, and an initial benchmark model set; obtaining an initial performance parameter of each initial benchmark model for the second candidate dataset in the initial platform; obtaining an initial platform corresponding to an initial benchmark model that meets a second preset condition based on the initial performance parameter, and merging the initial search space of the corresponding initial platform to obtain a candidate search space; and generating the candidate search space set based on the candidate search space and the initial search space.
[0018] In some embodiments, the search module includes: an obtaining unit configured to obtain a search type of a target search algorithm; and a searching unit configured to search based on a target search space and the target search algorithm using a search manner corresponding to the search type to obtain a multi-objective neural network.
[0019] In some embodiments, the searching unit is further configured to: in response to determining that the search type of the target search algorithm is a black-box search manner, search based on the target search space and the target search algorithm using a multi-objective function value to obtain the multi-objective neural network.
[0020] In some embodiments, the searching unit is further configured to: in response to determining that the search type of the target search algorithm is a differential search manner, search based on the target search space and the target search algorithm using a multi-objective loss function value to obtain the multi-objective neural network.
[0021] In a third aspect, embodiments of the present disclosure provide an electronic device, including: one or more processors; a storage device having one or more programs stored thereon; and when the one or more programs are executed by the one or more processors, the one or more processors implement the neural network architecture search method as described in any of the embodiments of the first aspect.
[0022] In a fourth aspect, an embodiment of the present disclosure provides a computer readable medium, having stored thereon a computer program, which, when executed by a processor, implements the neural network architecture search method according to any one of the first aspect.
[0023] The neural network architecture search method and device provided by the embodiment of the present disclosure, the execution subject first acquires the target data set, the target platform, the candidate search space set, the candidate search algorithm set and the benchmark model set, the candidate search space set includes a plurality of candidate search spaces in a plurality of candidate platforms, the benchmark model set includes a plurality of benchmark models in a plurality of candidate search spaces, then the target feature vector corresponding to the target data set in the target platform is calculated, the target feature vector includes the performance parameter of each benchmark model in the target platform for the target data set, then based on the target feature vector, the candidate search algorithm set, the candidate search space set and the precision prediction model, the target search space and the target search algorithm meeting the first preset condition are determined, and finally based on the target search space and the target search algorithm, the target neural network is searched, the search space and the search algorithm of a plurality of candidate platforms can be fused, the automatic selection of the search space and the search algorithm is realized, the appropriate search space and search algorithm can be selected, the autonomy and flexibility of determining the search space and the search algorithm are improved, and the accuracy and applicability of the search space and the search algorithm are improved, so that the accuracy and search quality of the target neural network can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0024] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments made with reference to the accompanying drawings:
[0025] Figure 1 is an exemplary system architecture diagram to which an embodiment of the present disclosure can be applied;
[0026] Figure 2 is a flowchart of one embodiment of the neural network architecture search method according to the present disclosure;
[0027] Figure 3 is a flowchart of one embodiment of determining the target search space and the target search algorithm according to the present disclosure;
[0028] Figure 4 is a flowchart of one embodiment of acquiring the precision prediction model according to the present disclosure;
[0029] Figure 5 is a flowchart of one embodiment of acquiring the candidate search space set according to the present disclosure;
[0030] Figure 6 is a structural schematic diagram of one embodiment of searching the target neural network according to the present disclosure;
[0031] Figure 7 is a structural schematic diagram of one embodiment of a neural network architecture search device according to the present disclosure;
[0032] Figure 8 is a structural schematic diagram of an electronic device suitable for implementing embodiments of the present disclosure. DETAILED DESCRIPTION
[0033] The present disclosure will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the relevant disclosure, but not to limit the disclosure. In addition, it should be noted that, for the sake of description, only the parts related to the disclosure are shown in the drawings.
[0034] It should be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
[0035] Figure 1 An exemplary system architecture 100 of a neural network architecture search method and a neural network architecture search device to which embodiments of the present disclosure can be applied is shown.
[0036] As shown in Figure 1 , the system architecture 100 can include terminal devices 104, 105, 106, a network 107, servers 101, 102, 103. The network 107 is a medium for providing a communication link between the terminal devices 104, 105, 106 and the servers 101, 102, 103. The network 107 can include various connection types, such as wired, wireless communication links or fiber optic cables, etc.
[0037] A user can interact with the servers 101, 102, 103 belonging to the same server cluster through the terminal devices 104, 105, 106 through the network 107 to receive or send information, etc. Various applications can be installed on the terminal devices 104, 105, 106, such as an item display application, a data analysis application, a search application, etc.
[0038] The terminal devices 104, 105, 106 can be hardware or software. When the terminal device is hardware, it can be various electronic devices with a display screen and supporting communication with a server, including but not limited to a smart phone, a tablet computer, a laptop computer and a desktop computer, etc. When the terminal device is software, it can be installed in the above-mentioned electronic devices. It can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made herein.
[0039] The servers 101, 102, 103 can be servers providing various services, for example, a background server receiving a request sent by a terminal device establishing a communication connection therewith. The background server can receive and analyze the request sent by the terminal device and the like, and generate a processing result.
[0040] The servers 101, 102, 103 can obtain a target dataset, a target platform, a candidate search space set including a plurality of candidate search spaces in a plurality of candidate platforms, a candidate search algorithm set, and a benchmark model set including a plurality of benchmark models in the plurality of candidate search spaces. Then, the servers 101, 102, 103 can calculate a target feature vector corresponding to the target dataset in the target platform, the target feature vector including a performance parameter of each benchmark model in the target platform for the target dataset. Then, the servers 101, 102, 103 can determine a target search space and a target search algorithm satisfying a first preset condition in test accuracy based on the target feature vector, the candidate search algorithm set, the candidate search space set, and an accuracy prediction model, and search for a target neural network based on the target search space and the target search algorithm.
[0041] It should be noted that the server can be hardware or software. When the server is hardware, it can be various electronic devices providing various services for terminal devices. When the server is software, it can be implemented as a plurality of software or software modules providing various services for terminal devices, or as a single software or software module providing various services for terminal devices. No specific limitation is made herein.
[0042] It should be noted that the neural network architecture search method provided by the embodiments of the present disclosure can be executed by the servers 101, 102, 103. Accordingly, the neural network architecture search apparatus is arranged in the servers 101, 102, 103.
[0043] It should be understood that Figure 1 The number of terminal devices, networks, and servers in
[0044] With reference to Figure 2 , a flow 200 of one embodiment of the neural network architecture search method according to the present disclosure is shown. The neural network architecture search method includes the following steps:
[0045] In step 210, a target dataset, a target platform, a candidate search space set, a candidate search algorithm set, and a benchmark model set are obtained.
[0046] In this step, the execution subject (for example, the server 101, 102, 103) on which the neural network architecture search method runs can obtain the target dataset, the target platform, the candidate search space set, the candidate search algorithm set, and the benchmark model set. Figure 1The target data set, the target platform, the candidate search space set, the candidate search algorithm set, and the benchmark model set can be obtained by the server 101, 102, 103 in the system through network reading and local reading. The target platform can be a platform determined from a plurality of candidate platforms, which can be any platform such as a GPU, an x86 series CPU, a Power series CPU, etc. The target platform can be the currently used platform. Since each candidate platform can include a plurality of candidate search spaces, each candidate search space includes a collection of a series of model structures, and the plurality of candidate search spaces included in each candidate platform form a candidate search space set, the candidate search space set includes a plurality of candidate search spaces in a plurality of candidate platforms. Each candidate search space includes a respective benchmark model, and the benchmark models of each candidate search space form a benchmark model set, the benchmark model set includes a plurality of benchmark models in a plurality of candidate search spaces. The candidate search algorithm set can include a random search algorithm, a Bayesian optimization algorithm, a genetic algorithm, a reinforcement learning algorithm, a gradient-based algorithm, etc.
[0047] In step 220, the target feature vector corresponding to the target data set in the target platform is calculated.
[0048] In this step, after the above execution subject obtains the target data set, the target platform, and the benchmark model set, the performance parameters of each benchmark model running in the target platform can be obtained according to the target data set and each benchmark model in the benchmark model set by using various technical means for obtaining model performance parameters. The performance parameters of each benchmark model are used to generate the target feature vector corresponding to the target data set in the target platform. The performance parameters can include parameters representing model performance, such as accuracy, loss, running time, etc. The above execution subject can obtain the performance parameters of each benchmark model running in the target platform by any means supported by related technologies.
[0049] As an example, if the benchmark model set includes three benchmark models, the above execution subject can train the first benchmark model in the target platform using the target data set, obtain the first performance parameter of the first benchmark model, then train the second benchmark model in the target platform using the target data set, obtain the second performance parameter of the second benchmark model, and train the third benchmark model in the target platform using the target data set, obtain the third performance parameter of the third benchmark model. Finally, the target feature vector corresponding to the target data set in the target platform is generated according to the first performance parameter, the second performance parameter, and the third performance parameter.
[0050] And, since the performance parameters of the same model running in different candidate platforms will be different, the feature vectors obtained in different candidate platforms are different for the same data set and the same benchmark model set, therefore, the feature vector corresponding to the data set is associated with the candidate platform, and the feature vector corresponding to other candidate platforms is different from the target feature vector corresponding to the target platform.
[0051] In step 230, based on the target feature vector, the candidate search algorithm set, the candidate search space set and the precision prediction model, the target search space and the target search algorithm meeting the first preset condition are determined.
[0052] In this step, after the above execution subject obtains the target feature vector corresponding to the target data set in the target platform, the target feature vector, the candidate search algorithm set and the candidate search space set can be input into the precision prediction model. The precision prediction model can process the target feature vector, the candidate search algorithm and the candidate search space, and output the test precision corresponding to the candidate search algorithm and the candidate search space. The test precision can represent the degree of fitness of the input candidate search algorithm and candidate search space to the target data set, which is used to select the optimal search algorithm and search space. Then the above execution subject can obtain multiple test precisions output by the precision prediction model, determine the test precision meeting the first preset condition from the multiple test precisions, and further determine the candidate search algorithm and the candidate search space corresponding to the test precision. The first preset condition can include that the test precision value is maximum, and the determined candidate search algorithm and candidate search space are used as the target search space and the target search algorithm.
[0053] Alternatively, the above execution subject can combine each candidate search algorithm in the candidate search algorithm set and each candidate search space in the candidate search space set to obtain multiple different combination results, respectively input each combination result and the target feature vector into the precision prediction model, and the precision prediction model can process the input combination result and the target feature vector, and output the test precision corresponding to each combination result and the target feature vector respectively, so as to obtain a test precision set. Then the above execution subject sorts the multiple test precisions in the test precision set, selects a test precision with the maximum test precision value, and obtains the candidate search space and the candidate search algorithm corresponding to the maximum test precision, and uses the candidate search space and the candidate search algorithm as the target search space and the target search algorithm.
[0054] In step 240, based on the target search space and the target search algorithm, the target neural network is searched.
[0055] In this step, after the execution subject obtains the target search space and the target search algorithm based on the precision prediction model, the execution subject can search for a plurality of neural network architectures in different network layers in the target search space according to the target search algorithm. Then the execution subject can evaluate the performance of the plurality of neural network architectures by using a plurality of performance evaluation methods of neural networks, and determine the target neural network according to the performance evaluation results.
[0056] Therefore, the execution subject can search for the target neural network based on the target search space and the target search algorithm in any manner supported by any related technology.
[0057] The neural network architecture search method provided by the embodiments of the present disclosure can first obtain a target data set, a target platform, a candidate search space set, a candidate search algorithm set, and a benchmark model set. The candidate search space set includes a plurality of candidate search spaces in a plurality of candidate platforms, and the benchmark model set includes a plurality of benchmark models in the plurality of candidate search spaces. Then, the target feature vector corresponding to the target data set in the target platform is calculated. The target feature vector includes the performance parameters of each benchmark model in the target platform for the target data set. Then, the target search space and the target search algorithm that meet the first preset condition of the test precision are determined based on the target feature vector, the candidate search algorithm set, the candidate search space set, and the precision prediction model. Finally, the target neural network is searched based on the target search space and the target search algorithm. The search space and the search algorithm of a plurality of candidate platforms can be fused, the automatic selection of the search space and the search algorithm is realized, the appropriate search space and search algorithm can be selected, the autonomy and flexibility of determining the search space and the search algorithm are improved, and the accuracy and applicability of the search space and the search algorithm are improved. Therefore, the accuracy and search quality of the target neural network can be improved.
[0058] Reference Figure 3 , Figure 3 A flowchart of one embodiment of determining the target search space and the target search algorithm is shown, that is, the step 230. The target search space and the target search algorithm that meet the first preset condition of the test precision are determined based on the target feature vector, the candidate search algorithm set, the candidate search space set, and the precision prediction model. The step can include the following steps:
[0059] In step 310, the candidate search algorithm in the candidate search algorithm set is fixed. The target feature vector, the candidate search algorithm, and each candidate search space in the candidate search space set are input into the precision prediction model to generate a first test precision set corresponding to each candidate search space.
[0060] After the target feature vector corresponding to the target data set in the target platform is obtained by the execution subject, a candidate search algorithm is randomly selected from the candidate search algorithm set, the candidate search algorithm is fixed, and the target feature vector, the candidate search algorithm, and each candidate search space in the candidate search space set are input into the precision prediction model. The precision prediction model can process the target feature vector, the candidate search algorithm, and each candidate search space respectively, and output the first test precision corresponding to each candidate search space while keeping the candidate search algorithm unchanged. The first test precisions form a first test precision set.
[0061] For example, if the candidate search algorithm set includes a first candidate search algorithm, a second candidate search algorithm, and a third candidate search algorithm, and the candidate search space set includes a first candidate search space, a second candidate search space, and a third candidate search space, the execution subject can select the first candidate search algorithm from the candidate search algorithm set. The target feature vector, the first candidate search algorithm, and the first candidate search space are first input into the precision prediction model. The precision prediction model can process the target feature vector, the first candidate search algorithm, and the first candidate search space respectively, and output the first test precision A corresponding to the first candidate search space. Then, the target feature vector, the first candidate search algorithm, and the second candidate search space are input into the precision prediction model. The precision prediction model can process the target feature vector, the first candidate search algorithm, and the second candidate search space respectively, and output the first test precision B corresponding to the second candidate search space. Then, the target feature vector, the first candidate search algorithm, and the third candidate search space are input into the precision prediction model. The precision prediction model can process the target feature vector, the first candidate search algorithm, and the third candidate search space respectively, and output the first test precision C corresponding to the third candidate search space. Finally, the execution subject forms a first test precision set corresponding to each candidate search space by using the first test precision A, the first test precision B, and the first test precision C.
[0062] In step 320, based on the first test precision set, a target search space with a first test precision meeting a first preset condition is determined.
[0063] After the execution subject obtains the first test precision set corresponding to each candidate search space, each first test precision in the first test precision set can be sorted in ascending order or descending order. The first test precision meeting the first preset condition is determined from the sorting result, and the candidate search space corresponding to the first test precision is further determined as the target search space.
[0064] As an example, the execution subject above groups the first test precision A, the first test precision B and the first test precision C into a first test precision set corresponding to each candidate search space, sorts the first test precision A, the first test precision B and the first test precision C in the first test precision set in ascending order, determines that the sorting result is the first test precision A, the first test precision B and the first test precision C, determines that the maximum test precision is the first test precision C, and determines that the candidate search space corresponding to the first test precision C is the third candidate search space, and takes the third candidate search space as the target search space.
[0065] In step 330, the target feature vector, each candidate search algorithm in the candidate search algorithm set and the target search space are input into the precision prediction model to generate a second test precision set corresponding to each candidate search algorithm.
[0066] In this step, after the execution subject above determines the target search space, the input of the candidate search space in the precision prediction model can be fixed, and then the target feature vector, each candidate search algorithm in the candidate search algorithm set and the target search space are input into the precision prediction model. The precision prediction model can process the target feature vector, each candidate search algorithm and the target search space respectively, output the second test precision corresponding to each candidate search algorithm while keeping the target search space unchanged, and group multiple second test precisions into a second test precision set.
[0067] As an example, if the candidate search algorithm set above includes a first candidate search algorithm, a second candidate search algorithm and a third candidate search algorithm, and the target search space has been determined, the execution subject above can first input the target feature vector, the first candidate search algorithm and the target search space into the precision prediction model. The precision prediction model can process the target feature vector, the first candidate search algorithm and the target search space respectively, and output the second test precision D corresponding to the first candidate search algorithm. Then, the target feature vector, the second candidate search algorithm and the target search space are input into the precision prediction model. The precision prediction model can process the target feature vector, the second candidate search algorithm and the target search space respectively, and output the second test precision E corresponding to the second candidate search algorithm. Again, the target feature vector, the third candidate search algorithm and the target search space are input into the precision prediction model. The precision prediction model can process the target feature vector, the third candidate search algorithm and the target search space respectively, and output the second test precision F corresponding to the third candidate search algorithm. Finally, the execution subject above groups the second test precision D, the second test precision E and the second test precision F into a second test precision set corresponding to each candidate search algorithm.
[0068] In step 340, based on the second test precision set, a target search algorithm whose second test precision meets a first preset condition is determined.
[0069] In this step, after the execution subject obtains the second test accuracy set corresponding to each candidate search algorithm, the execution subject can sort each second test accuracy in the second test accuracy set in ascending order or descending order, determine the second test accuracy that meets the first preset condition from the sorting result, and further determine the candidate search algorithm corresponding to the second test accuracy, and take the candidate search algorithm as the target search algorithm.
[0070] As an example, the execution subject groups the second test accuracy D, the second test accuracy E and the second test accuracy F into the second test accuracy set corresponding to each candidate search algorithm, sorts the second test accuracy D, the second test accuracy E and the second test accuracy F in the second test accuracy set in ascending order, determines that the sorting result is the second test accuracy D, the second test accuracy E and the second test accuracy F, determines that the maximum test accuracy is the second test accuracy F, and determines that the candidate search algorithm corresponding to the second test accuracy F is the third candidate search algorithm, and takes the third candidate search algorithm as the target search algorithm.
[0071] In this implementation, by fixing the candidate search algorithm first, determining the first test accuracy set corresponding to each candidate search space, and determining the target search space, then taking the target search space as a fixed input, determining the second test accuracy set corresponding to each candidate search algorithm, and determining the target search algorithm, one input can be fixed first, and then another input can be fixed, the combination optimization of different search algorithms and search spaces is realized, and the efficiency and accuracy of determining the target search space and the target search algorithm are improved.
[0072] Reference Figure 4 , Figure 4 A flowchart showing one embodiment of obtaining an accuracy prediction model is shown. The accuracy prediction model can be obtained based on the following steps:
[0073] Step 410: Obtain a first candidate data set and calculate a candidate feature vector corresponding to the first candidate data set in a target platform.
[0074] In this step, the execution subject can obtain the first candidate data set, the target platform, the candidate search space set, the candidate search algorithm set and the benchmark model set through network reading and local reading. Then, the execution subject can obtain the performance parameters of each benchmark model running in the target platform by various technical means for obtaining model performance parameters according to the first candidate data set and each benchmark model in the benchmark model set, and generate the candidate feature vector corresponding to the first candidate data set in the target platform from the performance parameters of each benchmark model.
[0075] As an example, if three reference models are included in the reference model set, the execution subject can train a first reference model in the target platform using the first candidate dataset, obtain a first performance parameter of the first reference model, train a second reference model in the target platform using the first candidate dataset, obtain a second performance parameter of the second reference model, train a third reference model in the target platform using the first candidate dataset, obtain a third performance parameter of the third reference model, and finally generate a candidate feature vector corresponding to the first candidate dataset in the target platform according to the first performance parameter, the second performance parameter and the third performance parameter.
[0076] In step 420, based on the candidate feature vector, the candidate search algorithm set, the candidate search space set and the initial model for predicting the test accuracy, a search space and a search algorithm are determined, which meet the first preset condition for the test accuracy.
[0077] In this step, after the execution subject obtains the candidate feature vector corresponding to the first candidate dataset in the target platform, the execution subject obtains an initial model for predicting the test accuracy. The initial model can be any untrained neural network in the related art. The execution subject can input the candidate feature vector, the candidate search algorithm set and the candidate search space set into the initial model. The initial model can process the candidate feature vector, the candidate search algorithm and the candidate search space, and output the test accuracy corresponding to the candidate search algorithm and the candidate search space. Then the execution subject can obtain multiple test accuracies output by the initial model, determine a test accuracy meeting the first preset condition from the multiple test accuracies, further determine the candidate search algorithm and the candidate search space corresponding to the test accuracy, and determine the candidate search algorithm and the candidate search space as the search space and the search algorithm.
[0078] In step 430, based on the search space, the search algorithm and the initial model, an accuracy prediction model is determined.
[0079] In this step, after the execution subject obtains the search space and the search algorithm, the execution subject can determine the initial model according to the determined search space and search algorithm. That is, the execution subject can first determine whether the search space and the search algorithm are the optimal search space and search algorithm according to the determination means in the related art. If it is determined that the search space and the search algorithm are the optimal search space and search algorithm, the initial model is directly determined as the accuracy prediction model. If it is determined that the search space and the search algorithm are not the optimal search space and search algorithm, the initial model needs to be adjusted to obtain the accuracy prediction model.
[0080] As an optional implementation, step 430 of determining the accuracy prediction model based on the search space, the search algorithm and the initial model can include the following steps:
[0081] The first step is to determine the candidate neural network based on the search space and the search algorithm.
[0082] Specifically, after determining the search space and the search algorithm, the execution subject can search for multiple neural network architectures in different network layers in the search space according to the search algorithm. Then the execution subject can evaluate the performance of the obtained multiple neural network architectures through various performance evaluation methods, and determine the candidate neural network according to the performance evaluation results.
[0083] The second step is to train and obtain the performance parameters of the candidate neural network.
[0084] Specifically, after obtaining the candidate neural network, the execution subject can train the candidate neural network and obtain the performance parameters of the candidate neural network through various technical means for obtaining model performance parameters. The performance parameters can include parameters representing model performance, such as accuracy, loss, running time, etc. The execution subject can obtain the performance parameters of the candidate neural network in any way supported by related technologies.
[0085] The third step is to adjust the initial model based on the performance parameters of the candidate neural network to obtain the accuracy prediction model.
[0086] Specifically, after obtaining the performance parameters of the candidate neural network, if the performance parameters do not meet the requirements of the neural network architecture search, which can be the search requirements set by the staff before the neural network architecture search, including various requirements such as the performance parameters of the searched neural network, the initial model needs to be adjusted according to the performance parameters of the candidate neural network, so that the initial model can output search space and search algorithm that meet the conditions, to further make the searched candidate neural network meet the requirements of the neural network architecture search, so as to use the adjusted initial model as the accuracy prediction model. The execution subject can adjust the initial model according to the performance parameters of the candidate neural network in any way supported by related technologies.
[0087] In this implementation, by obtaining the initial model and obtaining the accuracy prediction model according to the initial model, the accuracy prediction model can output the test accuracy of the search space and the search algorithm, which can realize the combination optimization of different search algorithms and search spaces, and improve the determination efficiency of the search algorithm and the search space.
[0088] Reference Figure 5 , Figure 5 A flowchart showing one embodiment of obtaining a candidate search space set can include the following steps:
[0089] At step 510, a second candidate dataset, a plurality of initial platforms, an initial search space set and an initial benchmark model set are obtained.
[0090] In this step, the above execution subject can obtain the second candidate dataset, the plurality of initial platforms, the initial search space set and the initial benchmark model set through network reading and local reading. The initial platform can be any platform used by users in the prior art, such as GPU, x86 series CPU, Power series CPU, etc. Since each initial platform can include a plurality of initial search spaces, each initial search space includes a collection of a series of model structures, and the plurality of initial search spaces included in each initial platform form an initial search space set, the initial search space set includes a plurality of initial search spaces in the plurality of initial platforms. In addition, each initial search space includes a respective initial benchmark model, and the initial benchmark models of each initial search space form an initial benchmark model set, and the initial benchmark model set includes a plurality of initial benchmark models in the plurality of initial search spaces.
[0091] At step 520, the initial performance parameters of each initial benchmark model on the second candidate dataset in the initial platform are obtained respectively.
[0092] In this step, after the above execution subject obtains the second candidate dataset, the plurality of initial platforms and the initial benchmark model set, it can obtain the performance parameters of each initial benchmark model running in the respective initial platform according to the second candidate dataset and each initial benchmark model in the initial benchmark model set through a plurality of technical means for obtaining model performance parameters. The performance parameters can include parameters representing model performance, such as accuracy, loss, running time, etc. The above execution subject can obtain the performance parameters of each initial benchmark model running in the initial platform through any related technology supported manner.
[0093] As an example, the above initial platform includes a first initial platform, a second initial platform and a third initial platform, the first initial platform includes a first initial search space and a first initial benchmark model, the second initial platform includes a second initial search space and a second initial benchmark model, and the third initial platform includes a third initial search space and a third initial benchmark model. The above execution subject can train the first initial benchmark model in the first initial platform using the second candidate dataset and obtain the first initial performance parameters of the first initial benchmark model. It can train the second initial benchmark model in the second initial platform using the second candidate dataset and obtain the second initial performance parameters of the second initial benchmark model. It can train the third initial benchmark model in the third initial platform using the second candidate dataset and obtain the third initial performance parameters of the third initial benchmark model. Thus, the above execution subject can obtain the performance parameters of each initial benchmark model running in the respective initial platform.
[0094] In step 530, based on the initial performance parameters, an initial platform corresponding to an initial benchmark model meeting a second preset condition is obtained, and an initial search space of the corresponding initial platform is merged to obtain a candidate search space.
[0095] In this step, after the execution subject obtains the initial performance parameters of each initial benchmark model, it can compare each initial performance parameter, calculate the distance between each two initial performance parameters, which can include distance information representing similarity such as Euclidean distance, and determine the initial performance parameters meeting the second preset condition according to the calculated distance. The second preset condition can represent that the distance between two initial performance parameters is less than a preset threshold. After the execution subject determines the multiple initial performance parameters meeting the second preset condition, it determines the initial benchmark model corresponding to each initial performance parameter, and further determines the initial platform corresponding to the initial benchmark model. The initial platforms meeting the second preset condition can be merged to obtain a candidate platform, and the initial benchmark models can also be merged to obtain the benchmark models in the candidate platform. In addition, the execution subject can merge the initial search spaces in the initial platforms to be merged to obtain the merged candidate search space. The candidate platform includes the candidate search space, and the candidate search space has the merged benchmark models.
[0096] In addition, the execution subject can also determine the initial platforms corresponding to the initial benchmark models not meeting the second preset condition according to the initial performance parameters, and then does not perform other operations on these initial platforms.
[0097] As an example, the initial platform includes a first initial platform, a second initial platform and a third initial platform, the first initial platform includes a first initial search space and a first initial reference model, the second initial platform includes a second initial search space and a second initial reference model, and the third initial platform includes a third initial search space and a third initial reference model. The execution subject obtains a first initial performance parameter of the first initial reference model, a second initial performance parameter of the second initial reference model, and a third initial performance parameter of the third initial reference model. The first initial performance parameter and the second initial performance parameter can be compared to calculate a first distance between the first initial performance parameter and the second initial performance parameter. The first initial performance parameter and the third initial performance parameter are compared to calculate a second distance between the first initial performance parameter and the third initial performance parameter. The second initial performance parameter and the third initial performance parameter are compared to calculate a third distance between the second initial performance parameter and the third initial performance parameter. Then the execution subject compares the first distance, the second distance and the third distance with a preset threshold value. If it is determined that the first distance exceeds the preset threshold value, it is determined that the first initial reference model and the second initial reference model meet the second preset condition, and the second distance and the third distance do not exceed the preset threshold value. The execution subject can combine the first initial platform and the second initial platform to generate a candidate platform, combine the first initial search space and the second initial search space to generate a candidate search space, and combine the first initial reference model and the second initial reference model to generate a reference model in the candidate search space. No operation is performed on the third initial platform.
[0098] In step 540, a candidate search space set is generated based on the candidate search space and the initial search space.
[0099] In this step, the execution subject obtains the candidate search space and determines that no operation is performed on other initial search spaces. The candidate search space and the initial search space can be combined to form a candidate search space set.
[0100] In this implementation, by combining the initial search spaces whose performance parameters meet the second preset condition, the search space is expanded, the candidate search space is expanded, the target search space is expanded, the range of neural network architecture search is larger, and the accuracy and search quality of the target neural network are further improved.
[0101] Reference Figure 6 , Figure 6 A flowchart of one embodiment of searching for a target neural network is shown, i.e., step 240, searching for a target neural network based on a target search space and a target search algorithm, which can include the following steps:
[0102] In step 610, the search type of the target search algorithm is obtained.
[0103] In this step, after the execution subject determines the target search space and the target search algorithm, the search type of the target search algorithm can be determined according to the target search algorithm. The search type can represent the algorithm type of the search algorithm, and can include a black box search method and a differential search method. The black box search method can represent that the search algorithm does not know the specific form of the optimization target function (i.e., the functional relationship between each network structure and the performance of the network), and can include reinforcement learning, evolutionary algorithm, etc.
[0104] In step 620, based on the target search space and the target search algorithm, a search is performed using a search method corresponding to the search type to obtain a multi-objective neural network.
[0105] In this step, after the execution subject determines the search type of the target search algorithm, a neural network architecture search can be performed in different network layers in the target search space using a search method corresponding to the search type. A plurality of neural network architectures are searched. Then, the execution subject can perform performance evaluation on the plurality of neural network architectures obtained by using a plurality of performance evaluation methods of neural networks, and determine a multi-objective neural network according to the performance evaluation result.
[0106] As an optional implementation, in step 620, based on the target search space and the target search algorithm, a search is performed using a search method corresponding to the search type to obtain a multi-objective neural network, which can include: in response to determining that the search type of the target search algorithm is a black box search method, based on the target search space and the target search algorithm, a search is performed using a multi-objective function value to obtain a multi-objective neural network.
[0107] Specifically, after the execution subject determines that the search type of the target search algorithm is a black box search method, the multi-objective function value can be set as a feedback signal, and a neural network architecture search is performed in different network layers in the target search space. A plurality of neural network architectures are searched. Then, the execution subject can perform performance evaluation on the plurality of neural network architectures obtained by using a plurality of performance evaluation methods of neural networks, and determine a multi-objective neural network according to the performance evaluation result.
[0108] As an optional implementation, in step 620, based on the target search space and the target search algorithm, a search is performed using a search method corresponding to the search type to obtain a multi-objective neural network, which can include: in response to determining that the search type of the target search algorithm is a differential search method, based on the target search space and the target search algorithm, a search is performed using a multi-objective loss function value to obtain a multi-objective neural network.
[0109] Specifically, after the execution subject determines that the search type of the target search algorithm is the differential search mode, it needs to calculate the multi-objective loss function value, perform neural network architecture search in different network layers in the target search space, and search for multiple neural network architectures. Then the execution subject can evaluate the performance of the obtained multiple neural network architectures through various performance evaluation methods of neural networks, and determine the multi-objective neural network according to the performance evaluation result.
[0110] In the implementation, by determining the search type of the target search algorithm and performing neural network architecture search using the search mode corresponding to the search type, different search modes can be performed for different search algorithms, the pertinence and diversity of neural network architecture search are improved, and the search of the optimal multi-objective neural network under different search algorithms is realized, and the accuracy and search quality of the multi-objective neural network are improved.
[0111] Further reference Figure 7 As an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a neural network architecture search device. The device embodiment corresponds to the method embodiment shown in Figure 2 .
[0112] As shown in Figure 7 , the neural network architecture search device 700 of the embodiment can include an acquisition module 710, a calculation module 720, a determination module 730, and a search module 740.
[0113] The acquisition module 710 is configured to acquire a target data set, a target platform, a candidate search space set, a candidate search algorithm set, and a benchmark model set, wherein the candidate search space set includes multiple candidate search spaces in multiple candidate platforms, and the benchmark model set includes multiple benchmark models in the multiple candidate search spaces.
[0114] The calculation module 720 is configured to calculate a target feature vector corresponding to the target data set in the target platform, wherein the target feature vector includes a performance parameter of each benchmark model in the target platform for the target data set.
[0115] The determination module 730 is configured to determine a target search space and a target search algorithm that meet a first preset condition in terms of test accuracy based on the target feature vector, the candidate search algorithm set, the candidate search space set, and an accuracy prediction model.
[0116] The search module 740 is configured to search for a target neural network based on the target search space and the target search algorithm.
[0117] In some optional implementation manners of the present embodiment, the determining module comprises: a first generating unit configured to fix a candidate search algorithm in the candidate search algorithm set, input the target feature vector, the candidate search algorithm and each candidate search space in the candidate search space set into the precision prediction model, and generate a first test precision set corresponding to each candidate search space; a first determining unit configured to determine a target search space with a first test precision meeting a first preset condition based on the first test precision set; a second generating unit configured to input the target feature vector, each candidate search algorithm in the candidate search algorithm set and the target search space into the precision prediction model, and generate a second test precision set corresponding to each candidate search algorithm; and a second determining unit configured to determine a target search algorithm with a second test precision meeting the first preset condition based on the second test precision set.
[0118] In some optional implementation manners of the present embodiment, the precision prediction model is obtained based on the following steps: obtaining a first candidate data set, and calculating a candidate feature vector corresponding to the first candidate data set in the target platform; determining a search space and a search algorithm with a test precision meeting a first preset condition based on the candidate feature vector, the candidate search algorithm set, the candidate search space set and an initial model for predicting the test precision; and determining the precision prediction model based on the search space, the search algorithm and the initial model.
[0119] In some optional implementation manners of the present embodiment, the precision prediction model is determined based on the search space, the search algorithm and the initial model, comprising: determining a candidate neural network based on the search space and the search algorithm; training and obtaining a performance parameter of the candidate neural network; adjusting the initial model based on the performance parameter of the candidate neural network to obtain the precision prediction model.
[0120] In some optional implementation manners of the present embodiment, the candidate search space set is obtained based on the following manner: obtaining a second candidate data set, a plurality of initial platforms, an initial search space set and an initial benchmark model set; obtaining an initial performance parameter of each initial benchmark model for the second candidate data set in the initial platform; obtaining an initial platform corresponding to an initial benchmark model meeting a second preset condition based on the initial performance parameter, and merging the initial search space of the corresponding initial platform to obtain a candidate search space; and generating the candidate search space set based on the candidate search space and the initial search space.
[0121] In some optional implementation manners of the present embodiment, the searching module comprises: an obtaining unit configured to obtain a search type of a target search algorithm; and a searching unit configured to search based on the target search space and the target search algorithm by using a search manner corresponding to the search type to obtain a multi-target neural network.
[0122] In some optional implementations of the present embodiment, the searching unit is further configured to: in response to determining that the search type of the target search algorithm is a black-box search mode, search based on the target search space and the target search algorithm using the multi-objective function value to obtain the multi-objective neural network.
[0123] In some optional implementations of the present embodiment, the searching unit is further configured to: in response to determining that the search type of the target search algorithm is a differential search mode, search based on the target search space and the target search algorithm using the multi-objective loss function value to obtain the multi-objective neural network.
[0124] The neural network architecture searching apparatus provided by the above embodiments of the present disclosure, the execution subject first acquires a target data set, a target platform, a candidate search space set, a candidate search algorithm set and a benchmark model set, the candidate search space set includes a plurality of candidate search spaces in a plurality of candidate platforms, the benchmark model set includes a plurality of benchmark models in a plurality of candidate search spaces, then calculates a target feature vector corresponding to the target data set in the target platform, the target feature vector includes a performance parameter of each benchmark model in the target platform for the target data set, then based on the target feature vector, the candidate search algorithm set, the candidate search space set and the precision prediction model, determines a target search space and a target search algorithm whose test precision meets a first preset condition, and finally searches for a target neural network based on the target search space and the target search algorithm, can fuse the search spaces and search algorithms of a plurality of candidate platforms, realizes the automatic selection of the search spaces and search algorithms, can select appropriate search spaces and search algorithms, improves the autonomy and flexibility of determining the search spaces and search algorithms, and improves the accuracy and applicability of the search spaces and search algorithms, so as to improve the accuracy and search quality of the target neural network.
[0125] Those skilled in the art can understand that the above apparatus also includes some other well-known structures, such as processors, memories, etc., in order not to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are not shown in the Figure 7 .
[0126] Reference is made below to Figure 8 , which shows a structural schematic diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include but is not limited to mobile terminals such as smart screens, notebook computers, PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 8 The terminal device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0127] As shown in FIG. 8, Figure 8 The electronic device 800 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 802 or loaded into a random access memory (RAM) 803 from a storage device 808. Various programs and data required for the operation of the electronic device 800 are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0128] In general, the following devices can be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication devices 809 can allow the electronic device 800 to communicate wirelessly or wired with other devices to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it is understood that all of the shown devices are not required to be implemented or present. More or less devices can alternatively be implemented or present. Figure 8 Each block shown in FIG. 8 can represent a device or multiple devices as needed.
[0129] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the methods of embodiments of the present disclosure are executed. It should be noted that the computer readable medium of embodiments of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, but not limited to, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, 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 above. In embodiments of the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In embodiments of the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as part of a carrier wave, in which the computer readable program code is carried. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal or any suitable combination thereof. The computer readable signal medium can 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. The program code contained on the computer readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), etc., or any suitable combination of the above.
[0130] Computer program code for carrying out operations of embodiments of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can 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 latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0131] The computer program instructions can also be loaded onto a computer or other programmable information processing apparatus to cause a series of operations to be performed on the computer or other programmable information processing apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable information processing apparatus implement the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0132] The units described in the embodiments of the present application can be implemented by software, or by hardware. The units described can also be implemented by a processor, for example, can be described as: a processor includes an acquisition module, a calculation module, a determination module, and a search module, wherein the names of the modules do not constitute a limitation on the modules themselves in some cases.
[0133] As another aspect, the present application also provides a computer readable medium, which can be included in the electronic device or exist independently without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: obtain a target data set, a target platform, a candidate search space set, a candidate search algorithm set and a benchmark model set, wherein the candidate search space set includes a plurality of candidate search spaces in a plurality of candidate platforms, and the benchmark model set includes a plurality of benchmark models in the plurality of candidate search spaces; calculate a target feature vector corresponding to the target data set in the target platform, the target feature vector including a performance parameter of each benchmark model in the target platform for the target data set; determine a target search space and a target search algorithm that meet a first preset condition for test accuracy based on the target feature vector, the candidate search algorithm set, the candidate search space set and an accuracy prediction model; and search for a target neural network based on the target search space and the target search algorithm.
[0134] The above description is merely the preferred embodiments of the present disclosure and the explanation of the principles of the applied technology. It should be understood by those skilled in the art that the inventive scope involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combinations of the above technical features or equivalent features without departing from the inventive concept. For example, the above features can be replaced with the technical features disclosed in the embodiments of the present disclosure (but not limited to) having similar functions to form technical solutions.
Claims
1. A method for searching neural network architectures, the method comprising: Obtain the target dataset, target platform, candidate search space set, candidate search algorithm set, and benchmark model set, wherein the candidate search space set includes multiple candidate search spaces from multiple candidate platforms, and the benchmark model set includes multiple benchmark models from the multiple candidate spaces; Calculate the target feature vector corresponding to the target dataset in the target platform, wherein the target feature vector includes the performance parameters of each benchmark model for the target dataset in the target platform; Based on the target feature vector, the candidate search algorithm set, the candidate search space set, and the accuracy prediction model, determine the target search space and target search algorithm whose test accuracy meets the first preset condition; Based on the target search space and the target search algorithm, search for the target neural network; The candidate search space set is obtained based on the following method: Obtain a second candidate dataset, multiple initial platforms, an initial search space set, and an initial benchmark model set; obtain the initial performance parameters of each initial benchmark model on the initial platform for the second candidate dataset; based on the initial performance parameters, obtain the initial platform corresponding to the initial benchmark model that meets the second preset condition, and merge the initial search spaces of the corresponding initial platforms to obtain a candidate search space; generate a candidate search space set based on the candidate search space and the initial search space; wherein, the second preset condition includes that the distance between the initial performance parameters is less than a preset threshold.
2. The method according to claim 1, wherein, The step of determining the target search space and target search algorithm that meet the first preset condition in terms of test accuracy based on the target feature vector, the candidate search algorithm set, the candidate search space set, and the accuracy prediction model includes: By fixing the candidate search algorithms in the candidate search algorithm set, the target feature vector, the candidate search algorithm and each candidate search space in the candidate search space set are input into the accuracy prediction model to generate a first test accuracy set corresponding to each candidate search space; Based on the first set of test accuracies, a target search space is determined that the first test accuracies meet the first preset conditions. The target feature vector, each candidate search algorithm in the candidate search algorithm set, and the target search space are input into the accuracy prediction model to generate a second test accuracy set corresponding to each candidate search algorithm. Based on the second set of test accuracies, a target search algorithm is determined that meets the first preset condition for the second test accuracies.
3. The method according to claim 1 or 2, wherein, The accuracy prediction model is obtained based on the following steps: Obtain a first candidate dataset and calculate the candidate feature vector corresponding to the first candidate dataset in the target platform; Based on the candidate feature vectors, the candidate search algorithm set, the candidate search space set, and the initial model used to predict test accuracy, determine the search space and search algorithm whose test accuracy meets the first preset condition; Based on the search space, the search algorithm, and the initial model, the accuracy prediction model is determined.
4. The method according to claim 3, wherein, The step of determining the accuracy prediction model based on the search space, the search algorithm, and the initial model includes: Candidate neural networks are determined based on the search space and the search algorithm; Train and obtain the performance parameters of the candidate neural network; The initial model is adjusted based on the performance parameters of the candidate neural network to obtain the accuracy prediction model.
5. The method according to claim 1, wherein, The step of searching for the target neural network based on the target search space and the target search algorithm includes: Obtain the search type of the target search algorithm; Based on the target search space and the target search algorithm, a multi-target neural network is obtained by using a search method corresponding to the search type.
6. The method according to claim 5, wherein, The step of searching based on the target search space and the target search algorithm, using a search method corresponding to the search type, to obtain a multi-target neural network includes: In response to determining that the search type of the target search algorithm is a black-box search method, a multi-objective neural network is obtained by using multi-objective function values based on the target search space and the target search algorithm.
7. The method according to claim 5, wherein, The step of searching based on the target search space and the target search algorithm, using a search method corresponding to the search type, to obtain a multi-target neural network includes: In response to determining that the search type of the target search algorithm is differential search, a multi-target neural network is obtained by searching using the multi-target loss function value based on the target search space and the target search algorithm.
8. A neural network architecture search device, the device comprising: The acquisition module is configured to acquire the target dataset, the target platform, the candidate search space set, the candidate search algorithm set, and the benchmark model set, wherein the candidate search space set includes multiple candidate search spaces from multiple candidate platforms, and the benchmark model set includes multiple benchmark models from the multiple candidate spaces; The computation module is configured to compute a target feature vector corresponding to the target dataset in the target platform, the target feature vector including the performance parameters of each benchmark model for the target dataset in the target platform; The determination module is configured to determine the target search space and target search algorithm that meet the first preset condition based on the target feature vector, the candidate search algorithm set, the candidate search space set, and the accuracy prediction model; The search module is configured to search for the target neural network based on the target search space and the target search algorithm; The candidate search space set is obtained based on the following method: Obtain a second candidate dataset, multiple initial platforms, an initial search space set, and an initial benchmark model set; obtain the initial performance parameters of each initial benchmark model on the initial platform for the second candidate dataset; based on the initial performance parameters, obtain the initial platform corresponding to the initial benchmark model that meets the second preset condition, and merge the initial search spaces of the corresponding initial platforms to obtain a candidate search space; generate a candidate search space set based on the candidate search space and the initial search space; wherein, the second preset condition includes that the distance between the initial performance parameters is less than a preset threshold.
9. The apparatus according to claim 8, wherein, The search module includes: The acquisition unit is configured to acquire the search type of the target search algorithm; The search unit is configured to perform a search based on the target search space and the target search algorithm, using a search method corresponding to the search type, to obtain a multi-target neural network.
10. The apparatus according to claim 9, wherein, The search unit is further configured to: In response to determining that the search type of the target search algorithm is a black-box search method, a multi-objective neural network is obtained by using multi-objective function values based on the target search space and the target search algorithm.
11. The apparatus according to claim 9, wherein, The search unit is further configured to: In response to determining that the search type of the target search algorithm is differential search, a multi-target neural network is obtained by searching using the multi-target loss function value based on the target search space and the target search algorithm.
12. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.
13. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1-7.