CN113205185A - Network model optimization method and device, computer equipment and storage medium - Google Patents

Network model optimization method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113205185A
CN113205185A CN202110583232.4A CN202110583232A CN113205185A CN 113205185 A CN113205185 A CN 113205185A CN 202110583232 A CN202110583232 A CN 202110583232A CN 113205185 A CN113205185 A CN 113205185A
Authority
CN
China
Prior art keywords
individuals
network model
population
environmental change
evolution
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
CN202110583232.4A
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 CN202110583232.4A priority Critical patent/CN113205185A/en
Publication of CN113205185A publication Critical patent/CN113205185A/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/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Genetics & Genomics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Physiology (AREA)
  • Feedback Control In General (AREA)

Abstract

The application relates to a network model optimization method, a network model optimization device, computer equipment and a storage medium. The method comprises the following steps: acquiring a target population, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained; evolving a target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number; training the network model to be trained by using individuals in the evolved population to obtain a second number of trained individuals after environmental change; obtaining a first number of environmentally changed individuals from a second number of environmentally changed individuals; and when the model optimization ending condition is not reached, updating the evolution parameters, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization ending condition is reached. By adopting the method of the embodiment of the application, the performance of the network model can be effectively improved.

Description

Network model optimization method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of machine learning technologies, and in particular, to a network model optimization method, apparatus, computer device, and storage medium.
Background
In industrial applications and scientific research, such as optimization fields of job shop scheduling, combinatorial optimization, engineering design, power scheduling, investment management, image segmentation, network communication, data mining, etc., decision makers often encounter a class of optimization problems that have multiple objectives and change over time, which are commonly referred to as dynamic multi-objective optimization problems. With the development of the machine learning technology field, the dynamic multi-objective optimization problem is also becoming one of the hot topics of research. The main characteristic of the dynamic multi-objective optimization problem is the essential change, and most of the optimization algorithms in the traditional technology use a dynamic non-dominated sorting genetic algorithm to deal with the environmental change of the network model and use a gradient descent optimization loss function to optimize the network model.
However, the random selection of the input parameters in the dynamic non-dominated sorting genetic algorithm may cause deviation of the operation trajectory of the optimization algorithm, and the gradient descent optimization loss function is a local search optimization algorithm, which may easily cause the network model to converge to local optimum only, and thus, the performance of the network model is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a network model optimization method, apparatus, computer device, and storage medium capable of effectively improving the performance of a network model.
A method of network model optimization, the method comprising:
obtaining a target population, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained;
evolving the target population based on an evolution parameter to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number;
training the network model to be trained by using individuals in the evolved population to obtain the trained individuals with the second quantity of environmental changes;
obtaining the first number of environmentally changed individuals from the second number of environmentally changed individuals;
and when the model optimization ending condition is not reached, updating the evolution parameters, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization ending condition is reached.
In one embodiment, the obtaining the target population includes:
determining parameters of each model to be optimized in the network model to be trained;
and carrying out random initialization on each model parameter to be optimized to obtain a target population.
In one embodiment, the obtaining the first number of post-environmental-change individuals from the second number of post-environmental-change individuals includes:
respectively carrying out grading division on the individuals of the second quantity and the individuals of the second quantity after the environmental change to obtain a grading division result and a grading division result after the environmental change;
calculating effective scores corresponding to the individuals after the second quantity of environmental changes based on the grading result and the grading result after the environmental changes;
obtaining the first number of environmentally changed individuals from the second number of environmentally changed individuals according to each of the effectiveness scores.
In one embodiment, the ranking the second number of individuals and the second number of individuals after the environmental change respectively to obtain a ranking result and a ranking result after the environmental change includes:
when the levels corresponding to the second number of individuals are different, sorting the levels according to a preset sorting mode to obtain a level sorting result;
when the levels corresponding to the individuals with the second number of changed environments are different after the environment changes, sorting the levels after the environment changes according to the preset sorting mode to obtain a sorting result of the levels after the environment changes;
and obtaining a grading result and a grading result after the environmental change based on the grading sorting result and the grading sorting result after the environmental change respectively.
In one embodiment, the ranking the second number of individuals and the second number of individuals after the environmental change respectively to obtain a ranking result and a ranking result after the environmental change includes:
when the levels corresponding to the second number of individuals are the same, calculating the crowding distance corresponding to the second number of individuals;
when the levels corresponding to the individuals after the environment changes in the second number are the same, calculating the crowding distance after the environment changes corresponding to the individuals after the environment changes in the second number;
sequencing each crowding distance and each crowding distance after the environmental change according to the preset sequencing mode to respectively obtain a distance sequencing result and a crowding distance sequencing result after the environmental change;
and obtaining a corresponding grading result and a grading result after the environment change according to the distance sorting result and the crowding distance sorting result after the environment change.
In one embodiment, the calculating the effective scores corresponding to the second number of individuals with changed environment based on the ranking result and the ranking result after changed environment includes:
obtaining scores corresponding to the individuals of the second number and scores corresponding to the individuals after the environment of the second number changes according to the corresponding relation between the preset grade and the scores;
determining the score weight after the environmental change corresponding to the individuals after the environmental change of the second number based on the preset score weight corresponding to the individuals of the second number and a preset fuzzy rule;
and calculating the effective scores corresponding to the individuals after the second quantity of environmental changes according to the scores, the score weights, the scores after the environmental changes and the score weights after the environmental changes.
In one embodiment, the calculating the effective scores corresponding to the second number of individuals after the environmental change according to the score, the score weight, the score after the environmental change, and the score weight after the environmental change includes:
calculating the environmental influence factors and the scores to be modified corresponding to the individuals after the environmental change of the second quantity according to the scores, the score weights, the scores after the environmental change and the score weights after the environmental change;
and calculating effective scores corresponding to the individuals after the second quantity of environment changes based on the scores to be modified and the environment influence factors.
In one embodiment, the updating manner of the evolution parameter includes:
obtaining a temporary evolution parameter based on the preset fuzzy rule and the evolution parameter;
determining a temporary model performance parameter of the trained network model corresponding to the temporary evolution parameter;
and when the temporary model performance parameters are superior to the model performance parameters of the trained network model corresponding to the evolution parameters, updating the evolution parameters to the temporary evolution parameters.
An apparatus for network model optimization, the apparatus comprising:
the device comprises a population acquisition module, a population training module and a population training module, wherein the population acquisition module is used for acquiring a target population, the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained;
the population evolution module is used for evolving the target population based on the evolution parameters or the evolution parameters updated by the parameter adjustment module to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number;
the model training module is used for training the network model to be trained by using the individuals in the evolved population to obtain the trained individuals with the second quantity of environment changes;
an individual determination module, configured to obtain the first number of individuals with changed environments from the second number of individuals with changed environments;
a training end judgment module, configured to end the network model optimization when the individuals determine that a model optimization end condition is reached according to the first number of environmental changes;
and the parameter adjusting module is used for updating the evolution parameters when the training end judging module determines that the model optimization end condition is not reached.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
According to the network model optimization method, the network model optimization device, the computer equipment and the storage medium, a target population is obtained, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained; evolving a target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number; training the network model to be trained by using individuals in the evolved population to obtain a second number of trained individuals after environmental change; obtaining a first number of environmentally changed individuals from a second number of environmentally changed individuals; and when the model optimization ending condition is not reached, updating the evolution parameters, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization ending condition is reached. By adopting the method of the embodiment of the application, random selection of individuals in the genetic algorithm can be avoided by selecting and determining the new target population, and the genetic algorithm can adapt to environmental changes generated in the network model training process by updating the evolution parameters, so that the network model is optimized, and the performance of the network model can be effectively improved.
Drawings
FIG. 1 is a diagram of an environment in which a method for optimizing a network model may be implemented in one embodiment;
FIG. 2 is a schematic flow chart diagram illustrating a method for optimizing a network model in one embodiment;
FIG. 3 is a diagram illustrating a method for optimizing a network model in an exemplary embodiment;
FIG. 4 is a schematic flow chart diagram illustrating a method for optimizing a network model in an exemplary embodiment;
FIG. 5 is a block diagram of an apparatus for optimizing a network model according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment;
fig. 7 is an internal structural view of a computer device in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, the network model optimization method provided by the present application may be applied to an application environment as shown in fig. 1, where the application environment may involve both a terminal 102 and a server 104, the terminal 102 communicates with the server 104 through a network or other communication methods, the terminal 102 may be used to evolve a target population, and the server 104 may be used to train a network model to be trained. Specifically, the terminal 102 obtains a target population, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of the network model to be trained; evolving a target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, the second number is larger than the first number, and the server 104 trains the network model to be trained by using the individuals in the evolved population to obtain a second number of trained individuals after environmental change; obtaining a first number of environmentally changed individuals from a second number of environmentally changed individuals; when the model optimization end condition is not reached, the terminal 102 updates the evolution parameters, uses the individuals with the first quantity of environment changes as a new target population, and returns to the step of evolving the target population based on the evolution parameters until the model optimization end condition is reached.
In one embodiment, the application environment of the network model optimization method provided by the present application may only involve the server 104, and the server 104 may be configured to evolve the target population and train the network model to be trained. Specifically, the server 104 obtains a target population, evolves the target population based on the evolution parameters, obtains an evolved population, and trains the network model to be trained by using individuals in the evolved population until a model optimization end condition is reached.
In one embodiment, an application environment of the network model optimization method provided by the present application may only relate to the terminal 102, and the terminal 102 may be configured to evolve the target population and train the network model to be trained. Specifically, the terminal 102 acquires a target population, evolves the target population based on the evolution parameters, acquires an evolved population, and trains the network model to be trained by using individuals in the evolved population until a model optimization end condition is reached.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a network model optimization method is provided, which is described by taking the method as an example applied to the terminal 102 and/or the server 104 in fig. 1, and includes the following steps:
step S202, a target population is obtained, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of the network model to be trained.
In one embodiment, the network model optimization method provided by the application is mainly used for optimizing a network model to be trained by improving a traditional genetic algorithm. The Genetic Algorithm (GA) is designed and proposed according to the biological evolution rule in nature, is a calculation model for simulating the natural selection and Genetic mechanism of Darwinian biological evolution theory, and can search for an optimal solution by simulating the natural evolution process. The genetic algorithm converts the solving process of the problem into the processes of crossover, variation and the like of chromosome genes in the similar biological evolution in a mathematical mode, can quickly obtain a better optimization result, and is widely applied to the fields of combination optimization, machine learning, signal processing and the like.
In one embodiment, the genetic algorithm referred to in this application is a predominantly non-dominated sorting genetic algorithm. The Non-dominant Sorting Genetic algorithm (NSGA) is a Genetic algorithm based on the pareto (pareto) optimal concept, and before the selection operation of the Genetic algorithm is executed, the population is sorted according to the dominant and Non-dominant relationship between individuals and then subjected to subsequent operation.
In one embodiment, in biology, a population refers to all individuals of the same species living in a natural area at the same time. In genetic algorithms, populations are the basic unit of evolution, consisting of individuals. Wherein, the population operated in the genetic algorithm is called a target population, and the target population comprises a first number of individuals. The untrained network model is called a network model to be trained, and the individual corresponds to a group of model parameters of the network model to be trained. In particular, the model parameters may include the number of feature maps convolved, the pooling layer type, the receptive field size, and the like.
Step S204, evolving the target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is larger than the first number.
In one embodiment, the genetic algorithm mainly comprises a selection operation, a cross operation and a mutation operation. The crossover operation is an operation of generating a new individual by replacing and recombining partial structures of individuals in the population, namely, applying a crossover operator to a target population. The mutation operation is to change the gene values of some gene loci of individuals in the population, namely to apply the mutation operator to the target population. It can be seen that the evolution parameters include at least one of crossover operators and mutation operators. Specifically, a target population is evolved based on the evolution parameters, and the obtained next generation population is referred to as an evolved population. Wherein the population after evolution comprises a second number of individuals, and the second number is greater than the first number.
And S206, training the network model to be trained by using the individuals in the evolved population to obtain a second number of trained individuals after environmental change.
In one embodiment, the individual corresponds to a set of model parameters of the network model to be trained, and the network model to be trained may be trained using individuals in the evolved population. In the training process of the network model to be trained, model parameters, objective functions, constraint conditions, or the like may dynamically change over time, and such dynamic change is referred to as environmental change. Specifically, after the network model to be trained is trained, the trained individuals with the changed environment are obtained. Wherein, the training process does not change the number of individuals, so the number of individuals is the second number after the environment is changed.
In one embodiment, before the network model to be trained is trained, targets are selected for dynamic multi-objective optimization. Specifically, dynamic multi-objective optimization may be performed with multiple loss functions in the network model to be trained as targets, or with model performance parameters of the network model to be trained as targets.
In step S208, a first number of individuals with changed environment are obtained from a second number of individuals with changed environment.
In one embodiment, when the genetic algorithm is iterated again after the network model to be trained is trained, since the size of the target population input in the genetic algorithm is determined, it is necessary to select individuals in the population after evolution. However, the conventional genetic algorithm randomly selects individuals in the evolved population, and because the random selection may reduce the performance of the network model to be trained, a counting method is introduced, by performing level division on the individuals after environmental change, and giving scores according to the divided levels, and obtaining a first number of individuals after environmental change from a second number of individuals after environmental change based on the scores, the performance of the network model to be trained is improved. The grade and the score have a preset corresponding relation, and the higher the grade is, the higher the score is given.
In one embodiment, the ranking may be in a non-dominated ordering. For example, if individual a corresponds to parameters 1 and 2 and individual B corresponds to parameters 0 and 1, assuming a larger more preferred individual, individual a dominates B because 1>0, 2>1, then individual a has a higher pareto rating than individual B. If the parameters corresponding to the individual A are 1 and 2, and the parameters corresponding to the individual B are 2 and 1, the individual A and the individual B cannot be compared, and the pareto grades of the individual A and the individual B are the same.
In one embodiment, after the individuals after the environmental change are ranked, when the ranks of the individuals are different, the ranks corresponding to the individuals may be ranked according to a preset ranking mode, and a first number of the individuals after the environmental change ranked before are selected. When the grades of the individuals are the same, the distances corresponding to the individuals need to be calculated, the distances corresponding to the individuals are sorted according to a preset sorting mode, and the individuals after the environment change of the first quantity sorted in the front are selected. Specifically, the preset sorting mode is a mode of sorting in descending order. The distance may be a crowding distance calculated by a crowding distance algorithm, and the crowding distance may be used as an index for judging the distance between an individual and an adjacent individual. The greater the crowding distance, the more dispersed the individuals in the population.
In one embodiment, the counting method may be a Borda counting method. The DOA counting method is a sorting voting method, theoretically, all candidates are sorted, corresponding scores are obtained according to different sorting ranks, and the candidate with the highest score wins the election. Specifically, the second number of individuals after the environmental change may be understood as all candidates, and the individuals after the environmental change are sorted according to the scores corresponding to the individuals after the environmental change in a preset sorting manner, and the first number of individuals after the environmental change which is sorted in the front is selected. The preset sorting mode is a mode of sorting in descending order.
And step S210, updating the evolution parameters when the model optimization end conditions are not met, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization end conditions are met.
In one embodiment, the model optimization termination condition may be set by a user. Specifically, the model optimization end condition may be set as the number of model iterations or a model performance index. And when the iteration times of the model or the performance index of the model is reached, determining that the optimization end condition of the model is reached. And when the iteration times or the performance indexes of the model are not reached, determining that the optimization end conditions of the model are not reached. When the model optimization ending condition is not reached, after the model training is ended and before the next model training is carried out, the evolution parameters can be updated, the individuals with the first quantity of environment changes obtained by the operation are used as a new target population, and the step S204 is returned until the model optimization ending condition is reached.
In the network model optimization method, a target population is obtained, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained; evolving a target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number; training the network model to be trained by using individuals in the evolved population to obtain a second number of trained individuals after environmental change; obtaining a first number of environmentally changed individuals from a second number of environmentally changed individuals; and when the model optimization ending condition is not reached, updating the evolution parameters, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization ending condition is reached. By adopting the method of the embodiment, random selection of individuals in the genetic algorithm can be avoided by selecting and determining the new target population, and the genetic algorithm can adapt to environmental changes generated in the network model training process by updating the evolution parameters, so that the network model is optimized, and the performance of the network model can be effectively improved.
In one embodiment, the step S202 of obtaining the target population includes:
step S302, determining each model parameter to be optimized in the network model to be trained.
In one embodiment, the target population may be determined by each model parameter to be optimized in the network model to be trained. The model parameters to be optimized may include the number of feature mappings of convolution, the type of pooling layer, the size of receptive field, and the like.
And step S304, carrying out random initialization on each model parameter to be optimized to obtain a target population.
In one embodiment, random initialization is performed on each model parameter to be optimized to obtain a group of individuals, and a first number of individuals are initialized randomly in total to obtain a target population. Wherein, the individual corresponds to a group of model parameters of the network model to be trained. Specifically, during the first operation, the target population is determined through the steps, and during the second operation, the individuals with the first number of changed environments obtained after the first model training is finished are used as a new target population, and so on.
In one embodiment, step S208 obtains the first number of post-environmental-change individuals from the second number of post-environmental-change individuals, and includes:
step S402, respectively carrying out grading division on the second quantity of individuals and the second quantity of individuals after the environmental change to obtain a grading division result and a grading division result after the environmental change.
In one embodiment, a second number of individuals and a second number of individuals after environmental change are respectively graded according to a non-dominated sorting, a result obtained after the second number of individuals are graded is referred to as a graded result, and a result obtained after the second number of individuals after environmental change are graded is referred to as a graded result after environmental change.
In one embodiment, when the levels corresponding to the second number of individuals are different, the levels are sorted according to a preset sorting mode, and a level sorting result is obtained. And when the levels corresponding to the individuals after the environment changes in the second quantity are different, sorting the levels after the environment changes according to a preset sorting mode to obtain a sorting result of the levels after the environment changes. And obtaining a grading result and a grading result after the environment change based on the grading sorting result and the grading sorting result after the environment change. The preset sorting mode is a mode of sorting in descending order.
In one embodiment, the congestion distance is calculated for a second number of individuals when the levels corresponding to the second number of individuals are the same. And when the levels corresponding to the individuals after the environment change of the second number are the same, calculating the crowding distance after the environment change corresponding to the individuals after the environment change of the second number. And sequencing the crowding distances and the crowding distances after the environment changes according to a preset sequencing mode to respectively obtain a distance sequencing result and a crowding distance sequencing result after the environment changes. And obtaining a corresponding grading result and a grading result after the environment change according to the distance sorting result and the crowding distance sorting result after the environment change. The preset sorting mode is a mode of sorting in descending order.
Step S404, calculating the effective scores corresponding to the individuals with the second quantity of changed environments based on the grading result and the grading result after the environment change.
In one embodiment, a final score corresponding to a second number of individuals with changed environment is calculated based on the ranking result and the ranking result after the environment change, and the final score is called as an effective score. In particular, the effective score corresponding to an individual may be determined by calculating the impact of environmental changes on the individual.
Step S406, obtaining a first number of individuals after environmental change from a second number of individuals after environmental change according to each effective score.
In one embodiment, the effectiveness scores are sorted according to a preset sorting mode, and a first number of the individuals after the environmental change, which are sorted at the front, are selected. The preset sorting mode is a mode of sorting in descending order.
In one embodiment, step S404 calculates the effective scores corresponding to the second number of individuals after the environmental change based on the ranking result and the ranking result after the environmental change, including:
step S502, obtaining scores corresponding to the individuals of the second quantity and scores corresponding to the individuals after the environmental change of the second quantity according to the corresponding relation between the preset grade and the scores.
In one embodiment, a preset corresponding relationship exists between the grades and the scores, and the higher the grade is, the higher the score is given. Specifically, the scores corresponding to the individuals of the second number are obtained according to the grade division results corresponding to the individuals of the second number and the corresponding relation between the preset grade and the scores. And obtaining the scores after the environmental changes corresponding to the individuals after the environmental changes of the second quantity according to the grading results after the environmental changes corresponding to the individuals after the environmental changes of the second quantity.
Step S504, determining the score weight after the environmental change corresponding to the individuals after the environmental change of the second number based on the score weight corresponding to the individuals of the second number and the preset fuzzy rule.
In one embodiment, the preset fuzzy rule refers to a Mamdani fuzzy rule, and is used for implementing inference calculation from input to output through a set of inference rules mastered in advance. In particular, the amount of environmental change and model performance parameters before the environmental change may be used to create the Mamdani fuzzy rule. And taking the model performance parameters before the environmental change, the score weights corresponding to the second number of individuals and the environmental variation as the input of the fuzzy rule, and taking the score weights after the environmental change corresponding to the second number of individuals after the environmental change as the output of the fuzzy rule, so as to determine the score weights after the environmental change corresponding to the second number of individuals after the environmental change.
Step S506, calculating effective scores corresponding to the individuals after the second quantity of environmental changes according to the scores, the score weights, the scores after the environmental changes and the score weights after the environmental changes.
In one embodiment, the effective scores corresponding to the individuals with the second number of environmental changes are calculated according to the scores and the score weights corresponding to the individuals with the second number of environmental changes, and the scores and the score weights corresponding to the individuals with the second number of environmental changes after the environmental changes.
In one embodiment, the step S506 of calculating the effective scores corresponding to the second number of individuals after the environmental change according to the score, the score weight, the score after the environmental change, and the score weight after the environmental change includes:
step S602, calculating the environmental impact factors and the scores to be modified corresponding to the individuals after the environmental change in the second quantity according to the scores, the score weights, the scores after the environmental change and the score weights after the environmental change.
In one embodiment, the environmental impact factor corresponding to the individual after the second amount of environmental change is expressed as EOC, and the calculation formula is as follows:
Figure BDA0003086932000000121
the score represents a score corresponding to the second number of individuals, and the score after the environmental change represents a score after the environmental change corresponding to the second number of individuals after the environmental change.
In one embodiment, the score to be modified corresponding to the individual after the second number of environmental changes is calculated according to the following formula:
when the score to be modified is the score multiplied by the score weight plus the score multiplied by the score weight after the environmental change
The score and the score weight represent the score and the score weight corresponding to the second number of individuals, and the score weight after the environmental change represent the score and the score weight after the environmental change corresponding to the second number of individuals after the environmental change.
Step S604, calculating effective scores corresponding to the individuals after the environment changes of the second quantity based on the scores to be modified and the environment influence factors.
In one embodiment, the calculation of the effective score is as follows:
effective fraction-to-be-modified fraction-EOC
The effective score represents the effective score corresponding to the individual after the environment of the second quantity changes, the score to be modified represents the score to be modified corresponding to the individual after the environment of the second quantity changes, and the EOC represents the environmental impact factor corresponding to the individual after the environment of the second quantity changes.
In one embodiment, the updating method of the evolution parameters includes:
step S702, obtaining a temporary evolution parameter based on a preset fuzzy rule and the evolution parameter.
In one embodiment, the preset fuzzy rule refers to a Mamdani fuzzy rule, and is used for implementing inference calculation from input to output through a set of inference rules mastered in advance. In particular, the evolutionary operator may be adjusted using a Mamdani fuzzy rule. And taking the mutation operator before the environment change, the crossover operator before the environment change, the model performance parameter before the environment change and the environment variation as the input of the fuzzy rule, and taking the mutation operator after the environment change and the crossover operator after the environment change as the output of the fuzzy rule, thereby determining the temporary evolution parameter.
Step S704, determining a temporary model performance parameter of the trained network model corresponding to the temporary evolution parameter.
In one embodiment, a target population is evolved based on a temporary evolution parameter to obtain a temporary evolved population, individuals in the temporary evolved population are used for training a network model to be trained, and a temporary model performance parameter of the trained network model corresponding to the temporary evolution parameter is determined.
Step S706, when the performance parameter of the temporary model is superior to the performance parameter of the trained network model corresponding to the evolution parameter, the evolution parameter is updated to the temporary evolution parameter.
In one embodiment, when the performance parameters of the temporary model are better than the performance parameters of the trained network model corresponding to the evolution parameters, the evolution parameters are updated to the temporary evolution parameters, otherwise, the evolution parameters are not updated.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings and one embodiment thereof. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 3, the network model optimization method includes a genetic algorithm operation part and a network model training part, and performs dynamic multi-objective optimization with the loss functions f1 and f2 of the network model to be trained as targets. As shown in fig. 4, the network model optimization method includes the following specific steps:
1. determining parameters of each model to be optimized in a network model to be trained, carrying out random initialization on the parameters of each model to be optimized to obtain a group of individuals, and randomly initializing a first number of individuals in total to obtain a target population;
2. evolving a target population based on the evolution parameters to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number;
3. training the network model to be trained by using individuals in the evolved population to obtain a second number of trained individuals after environmental change;
4. grading the second number of individuals and the second number of individuals after the environmental change according to the non-dominated sorting, calculating effective scores corresponding to the second number of individuals after the environmental change, and obtaining the first number of individuals after the environmental change from the second number of individuals after the environmental change;
5. and when the model optimization end condition is not reached, updating the evolution parameters based on a preset fuzzy rule, taking the individuals with the first quantity of environment changes as a new target population, and returning to the step 2 until the model optimization end condition is reached.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, as shown in fig. 5, there is provided a network model optimization apparatus, including: a population obtaining module 510, a population evolution module 520, a model training module 530, an individual determining module 540, a training end determining module 550 and a parameter adjusting module 560, wherein:
a population obtaining module 510, configured to obtain a target population, where the target population includes a first number of individuals, and the individuals correspond to a set of model parameters of a network model to be trained.
And a population evolution module 520, configured to evolve the target population based on the evolution parameters or the evolution parameters updated by the parameter adjustment module to obtain an evolved population, where the evolved population includes a second number of individuals, and the second number is greater than the first number.
A model training module 530, configured to train the to-be-trained network model using the individuals in the evolved population to obtain the trained individuals with the second number of environmental changes.
An individual determining module 540, configured to obtain the first number of individuals after the environmental change from the second number of individuals after the environmental change.
And a training end determining module 550, configured to end the optimization of the network model when the individual determines that the model optimization end condition is reached according to the first number of environmental changes.
And a parameter adjusting module 560, configured to update the evolution parameter when the training end determining module determines that the model optimization end condition is not met.
In one embodiment, the population obtaining module 510 includes the following elements:
and the model parameter determining unit to be optimized is used for determining each model parameter to be optimized in the network model to be trained.
And the target population obtaining unit is used for carrying out random initialization on each model parameter to be optimized to obtain a target population.
In one embodiment, the individual determination module 540 includes the following units:
and the grading unit is used for grading the second number of individuals and the second number of individuals after the environmental change respectively to obtain a grading result and a grading result after the environmental change.
And the effective score calculating unit is used for calculating the effective scores corresponding to the second number of the individuals after the environmental change based on the grading result and the grading result after the environmental change.
And the individual after environment change determining unit is used for obtaining the individual after environment change of the first number from the individual after environment change of the second number according to each effective score.
In one embodiment, the ranking unit includes the following units:
and the first sequencing unit is used for sequencing the grades according to a preset sequencing mode when the grades corresponding to the second number of individuals are different, and acquiring a grade sequencing result.
And the second sorting unit is used for sorting the grades after the environmental changes according to the preset sorting mode when the grades after the environmental changes corresponding to the individuals after the environmental changes in the second quantity are different, and acquiring a sorting result of the grades after the environmental changes.
And the first grade division result determining unit is used for obtaining a grade division result and a grade division result after the environmental change based on the grade sorting result and the grade sorting result after the environmental change respectively.
In one embodiment, the ranking unit includes the following units:
a first distance calculating unit, configured to calculate a congestion distance corresponding to the second number of individuals when the levels corresponding to the second number of individuals are the same.
And a second distance calculating unit, configured to calculate the post-environment-change congestion distance corresponding to the second number of post-environment-change individuals when the levels corresponding to the second number of post-environment-change individuals are the same.
And the third sorting unit is used for sorting the congestion distances and the congestion distances after the environmental change according to the preset sorting mode to respectively obtain a distance sorting result and a congestion distance sorting result after the environmental change.
And the second grading result determining unit is used for obtaining corresponding grading results and grading results after the environment changes according to the distance sorting results and the crowding distance sorting results after the environment changes.
In one embodiment, the effectiveness score calculation unit includes the following units:
and the score determining unit is used for obtaining the scores corresponding to the individuals of the second quantity and the scores corresponding to the individuals of the second quantity after the environmental change according to the corresponding relation between the preset grade and the scores.
And the score weight determining unit is used for determining the score weight after the environmental change corresponding to the individuals after the environmental change of the second number based on the preset score weight corresponding to the individuals of the second number and a preset fuzzy rule.
And the calculating unit is used for calculating the effective scores corresponding to the individuals after the second quantity of environmental changes according to the scores, the score weights, the scores after the environmental changes and the score weights after the environmental changes.
In one embodiment, the calculation unit comprises the following units:
and the score to be modified calculating unit is used for calculating the environmental influence factors and the scores to be modified corresponding to the individuals after the second quantity of environmental changes according to the scores, the score weights, the scores after the environmental changes and the score weights after the environmental changes.
And the effective score determining unit is used for calculating the effective scores corresponding to the individuals after the second quantity of environment changes based on the score to be modified and the environment influence factors.
In one embodiment, the network model optimization module further comprises:
and the evolution parameter updating module is used for updating the evolution parameters.
In one embodiment, the evolution parameter updating module comprises the following units:
and the temporary evolution parameter determining unit is used for obtaining a temporary evolution parameter based on the preset fuzzy rule and the evolution parameter.
And the temporary model performance parameter determining unit is used for determining the temporary model performance parameters of the trained network model corresponding to the temporary evolution parameters.
And the evolution parameter updating unit is used for updating the evolution parameters into the temporary evolution parameters when the temporary model performance parameters are superior to the model performance parameters of the trained network model corresponding to the evolution parameters.
For specific limitations of the network model optimization device, reference may be made to the above limitations of the network model optimization method, which are not described herein again. The various modules in the network model optimization device described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing network model optimization data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a network model optimization method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a network model optimization method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the configurations shown in fig. 6 and 7 are merely block diagrams of some configurations relevant to the present disclosure, and do not constitute a limitation on the computing devices to which the present disclosure may be applied, and that a particular computing device may include more or fewer components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the network model optimization method when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the network model optimization method described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of network model optimization, the method comprising:
obtaining a target population, wherein the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained;
evolving the target population based on an evolution parameter to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number;
training the network model to be trained by using individuals in the evolved population to obtain the trained individuals with the second quantity of environmental changes;
obtaining the first number of environmentally changed individuals from the second number of environmentally changed individuals;
and when the model optimization ending condition is not reached, updating the evolution parameters, taking the individuals with the first quantity of changed environments as a new target population, and returning to the step of evolving the target population based on the evolution parameters until the model optimization ending condition is reached.
2. The method of claim 1, wherein the obtaining the target population comprises:
determining parameters of each model to be optimized in the network model to be trained;
and carrying out random initialization on each model parameter to be optimized to obtain a target population.
3. The method of claim 1, wherein obtaining the first number of environmentally changed individuals from the second number of environmentally changed individuals comprises:
respectively carrying out grading division on the individuals of the second quantity and the individuals of the second quantity after the environmental change to obtain a grading division result and a grading division result after the environmental change;
calculating effective scores corresponding to the individuals after the second quantity of environmental changes based on the grading result and the grading result after the environmental changes;
obtaining the first number of environmentally changed individuals from the second number of environmentally changed individuals according to each of the effectiveness scores.
4. The method of claim 3, wherein the ranking the second number of individuals and the second number of individuals after environmental change respectively to obtain a ranking result and a ranking result after environmental change comprises at least one of:
the first item:
when the levels corresponding to the second number of individuals are different, sorting the levels according to a preset sorting mode to obtain a level sorting result;
when the levels corresponding to the individuals with the second number of changed environments are different after the environment changes, sorting the levels after the environment changes according to the preset sorting mode to obtain a sorting result of the levels after the environment changes;
obtaining a grading result and a grading result after the environmental change based on the grading sorting result and the grading sorting result after the environmental change respectively;
the second term is:
when the levels corresponding to the second number of individuals are the same, calculating the crowding distance corresponding to the second number of individuals;
when the levels corresponding to the individuals after the environment changes in the second number are the same, calculating the crowding distance after the environment changes corresponding to the individuals after the environment changes in the second number;
sequencing each crowding distance and each crowding distance after the environmental change according to the preset sequencing mode to respectively obtain a distance sequencing result and a crowding distance sequencing result after the environmental change;
and obtaining a corresponding grading result and a grading result after the environment change according to the distance sorting result and the crowding distance sorting result after the environment change.
5. The method of claim 3, wherein calculating the effective scores corresponding to the second number of individuals after the environmental change based on the ranking results and the ranking results after the environmental change comprises:
obtaining scores corresponding to the individuals of the second number and scores corresponding to the individuals after the environment of the second number changes according to the corresponding relation between the preset grade and the scores;
determining the score weight after the environmental change corresponding to the individuals after the environmental change of the second number based on the preset score weight corresponding to the individuals of the second number and a preset fuzzy rule;
and calculating the effective scores corresponding to the individuals after the second quantity of environmental changes according to the scores, the score weights, the scores after the environmental changes and the score weights after the environmental changes.
6. The method of claim 5, wherein said calculating a valid score for said second number of post-environmental change individuals based on said score, said score weight, said post-environmental change score, and said post-environmental change score weight comprises:
calculating the environmental influence factors and the scores to be modified corresponding to the individuals after the environmental change of the second quantity according to the scores, the score weights, the scores after the environmental change and the score weights after the environmental change;
and calculating effective scores corresponding to the individuals after the second quantity of environment changes based on the scores to be modified and the environment influence factors.
7. The method of claim 5, wherein the updating manner of the evolution parameters comprises:
obtaining a temporary evolution parameter based on the preset fuzzy rule and the evolution parameter;
determining a temporary model performance parameter of the trained network model corresponding to the temporary evolution parameter;
and when the temporary model performance parameters are superior to the model performance parameters of the trained network model corresponding to the evolution parameters, updating the evolution parameters to the temporary evolution parameters.
8. An apparatus for network model optimization, the apparatus comprising:
the device comprises a population acquisition module, a population training module and a population training module, wherein the population acquisition module is used for acquiring a target population, the target population comprises a first number of individuals, and the individuals correspond to a group of model parameters of a network model to be trained;
the population evolution module is used for evolving the target population based on the evolution parameters or the evolution parameters updated by the parameter adjustment module to obtain an evolved population, wherein the evolved population comprises a second number of individuals, and the second number is greater than the first number;
the model training module is used for training the network model to be trained by using the individuals in the evolved population to obtain the trained individuals with the second quantity of environment changes;
an individual determination module, configured to obtain the first number of individuals with changed environments from the second number of individuals with changed environments;
a training end judgment module, configured to end the network model optimization when the individuals determine that a model optimization end condition is reached according to the first number of environmental changes;
and the parameter adjusting module is used for updating the evolution parameters when the training end judging module determines that the model optimization end condition is not reached.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110583232.4A 2021-05-27 2021-05-27 Network model optimization method and device, computer equipment and storage medium Pending CN113205185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110583232.4A CN113205185A (en) 2021-05-27 2021-05-27 Network model optimization method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110583232.4A CN113205185A (en) 2021-05-27 2021-05-27 Network model optimization method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113205185A true CN113205185A (en) 2021-08-03

Family

ID=77023415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110583232.4A Pending CN113205185A (en) 2021-05-27 2021-05-27 Network model optimization method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113205185A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115130322A (en) * 2022-07-22 2022-09-30 中国原子能科学研究院 Optimization method and optimization device of beam shaping device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115130322A (en) * 2022-07-22 2022-09-30 中国原子能科学研究院 Optimization method and optimization device of beam shaping device
CN115130322B (en) * 2022-07-22 2023-11-03 中国原子能科学研究院 Optimization method and optimization device of beam shaping device

Similar Documents

Publication Publication Date Title
He et al. A discrete multi-objective fireworks algorithm for flowshop scheduling with sequence-dependent setup times
Wang et al. A Pareto-based estimation of distribution algorithm for the multi-objective flexible job-shop scheduling problem
US8700548B2 (en) Optimization technique using evolutionary algorithms
Jensen et al. Towards scalable fuzzy–rough feature selection
CN110827924B (en) Clustering method and device for gene expression data, computer equipment and storage medium
CN110119558B (en) Circuit parameter optimization method based on differential optimization algorithm
CN112785005B (en) Multi-objective task assistant decision-making method and device, computer equipment and medium
CN112256739B (en) Method for screening data items in dynamic flow big data based on multi-arm gambling machine
Yu et al. An iterative locally auto-weighted least squares method for microarray missing value estimation
Sheng et al. Multilocal search and adaptive niching based memetic algorithm with a consensus criterion for data clustering
CN113032367A (en) Dynamic load scene-oriented cross-layer configuration parameter collaborative tuning method and system for big data system
CN113205185A (en) Network model optimization method and device, computer equipment and storage medium
CN107909498B (en) Recommendation method based on area below maximized receiver operation characteristic curve
CN117554814A (en) Battery state of charge prediction method and device, electronic equipment and storage medium
CN113435101A (en) Power failure prediction method for support vector machine based on particle swarm optimization
CN112765367A (en) Method and device for constructing theme knowledge graph
Pourtaheri et al. Stability investigation of multi-objective heuristic ensemble classifiers
Guo et al. Data mining and application of ship impact spectrum acceleration based on PNN neural network
Villacorta et al. Sensitivity analysis in the scenario method: A multi-objective approach
Saha et al. Improved differential evolution for microarray analysis
CN108764586A (en) Fuzzy Petri Net parameter optimization method, system and electronic equipment
Sengupta et al. A scoring scheme for online feature selection: Simulating model performance without retraining
Zhaoming et al. Improving the efficiency of multi-objective grasshopper optimization algorithm to enhance ontology alignment
Saha et al. Unsupervised and supervised learning approaches together for microarray analysis
Chen et al. A multiobjective evolutionary algorithm based on surrogate individual selection mechanism

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: 20210803

RJ01 Rejection of invention patent application after publication