Method and device for reducing redundancy of genetic algorithm, equipment and storage medium
By querying preset dictionaries in the genetic algorithm to avoid redundant evaluation, the problem of slow calculation speed of genetic algorithms during hyperparameter optimization is solved, and more efficient model generation and the effect of reducing R&D costs is achieved.
Patent Information
- Application Number
- CN202411524309.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The calculation speed of genetic algorithms is slow during the hyperparameter optimization process, resulting in long model generation time, high R&D cost, and slow adjustment of parameters of multi-layer neural network models, which makes the training process lengthy.
By querying whether the configuration key of the chromosome exists in the preset dictionary before evaluating the chromosome, marking it as redundant if it exists, skipping the evaluation; if it does not exist, perform evaluation and store key-value pairs to avoid repeated calculations.
It effectively reduces meaningless resource consumption in the process of finding the optimal hyperparameters of machine learning models, improves the efficiency of genetic algorithms, reduces R&D costs, and improves the quality of results.
Smart Images

Figure CN119670838A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and in particular to a method, device, equipment and storage medium for reducing redundancy of a genetic algorithm. Background Art
[0002] New energy sources such as wind energy and photovoltaic energy are playing an increasingly important role in the global energy structure, and medium- and long-term wind power forecasting has gradually gained attention because of its role in the stability of the power dispatching system, economic benefits and cost reduction, resource planning and long-term development. Therefore, how to better forecast wind power generation in the next 1-12 months or even longer time range has become one of the hot topics among relevant practitioners.
[0003] Due to the rapid improvement of computer performance in recent years, machine learning has shined in various fields, which naturally includes wind power prediction. Not surprisingly, for such widely used machine learning, especially the performance optimization of relatively complex deep learning, it has become one of the hot research topics; for example, if you want to create a successful machine learning model, the definition and selection of hyperparameters are crucial. Even relevant experts often need to spend a lot of time debugging and selecting appropriate hyperparameters; therefore, how to automatically search for the optimal hyperparameters within a given range efficiently and labor-savingly has become a science. The content of this patent is an optimization scheme for genetic algorithms suitable for hyperparameter retrieval. It proposes a method of memorizing part of the data, eliminating a large number of unnecessary operations on chromosomes in the genetic algorithm, and effectively improving the efficiency of the genetic algorithm itself and the generation of the associated machine learning model.
[0004] Genetic algorithm is the most popular heuristic search algorithm in hyperparameter optimization algorithm. In an optimization experiment for neural network, the model generated by it achieved an accuracy of 86%, which is much higher than the models generated by other algorithms involved in the comparison. Similarly, in another experiment on convolutional neural network, the hyperparameters optimized by genetic algorithm made the final model classification accuracy at least 11% higher than other algorithms. However, the price of having a higher accuracy is that the calculation speed (or convergence speed) of genetic algorithm when optimizing hyperparameters is not very fast. There are many reasons that affect this speed, such as the configuration of iterative termination conditions, the process of mutation and selection, the selection of fitness function, etc. In this regard, current developers often use a class of programs called high-speed genetic algorithms, which are all based on traditional genetic algorithms and are optimized in terms of speed. Depending on the different usage environments, the effects of these high-speed algorithms are also different. The optimization method proposed in this patent is such a high-speed genetic algorithm, which can be effectively used for machine learning model optimization to reduce the time consumed by the generation of deep learning neural networks such as long short-term memory models. How to properly solve the above problems has become a topic that needs to be solved urgently in the industry. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for reducing redundancy of genetic algorithms, so that the proposed algorithm is lightweight and efficient, which can effectively reduce meaningless resource consumption in the process of finding optimal hyperparameters of machine learning models, solve the problems of slow parameter adjustment and lengthy training process of many multi-layer neural network models, reduce research and development related costs, and improve the quality of results.
[0006] According to a first aspect of the present invention, a method for reducing redundancy of a genetic algorithm is provided, the method for reducing redundancy of a genetic algorithm comprising:
[0007] Before evaluating any chromosome, query whether the key corresponding to the configuration of the chromosome already appears in the preset dictionary;
[0008] If there is no key corresponding to the configuration of the chromosome in the preset dictionary, evaluating the chromosome and storing the corresponding key in the preset dictionary;
[0009] If a key corresponding to the configuration of the chromosome exists in the preset dictionary, the chromosome is marked as redundant and the evaluation of the chromosome is skipped.
[0010] In one embodiment, it further includes:
[0011] Before evaluating the chromosomes, a unique key is generated for each chromosome configuration;
[0012] According to the preset fitness function, the fitness value is calculated based on the configuration of each chromosome;
[0013] Establish a matching relationship between the key and fitness value of any chromosome.
[0014] In one embodiment, if the preset dictionary does not have a key corresponding to the configuration of the chromosome, evaluating the chromosome and storing the corresponding key in the preset dictionary includes:
[0015] If there is no key corresponding to the configuration of the chromosome in the preset dictionary, calculating the fitness value according to the configuration of the chromosome by using a preset fitness function;
[0016] Establishing a corresponding relationship between the fitness value of the chromosome and the key;
[0017] And the fitness value and key of the chromosome are stored in the preset dictionary.
[0018] In one embodiment, if the key corresponding to the configuration of the chromosome exists in the preset dictionary, the chromosome is marked as redundant, and the evaluation of the chromosome is skipped, including:
[0019] If a key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome;
[0020] Skip evaluation of the chromosome and use the fitness value corresponding to the chromosome's key in the dictionary.
[0021] In one embodiment, if the preset dictionary does not have a key corresponding to the configuration of the chromosome, calculating the fitness value according to the configuration of the chromosome by using a preset fitness function includes:
[0022] Adding the chromosome to a hyperparameter set, and training a long short-term memory neural network using a preset data set;
[0023] The generated model is evaluated by verifying the data set, and the fitness value corresponding to the configuration of the chromosome is calculated using the model.
[0024] In one embodiment, it further includes:
[0025] When a new population is generated, the preset dictionary and the keys corresponding to the configuration of each chromosome are regenerated.
[0026] According to a second aspect of the present invention, there is provided a device for reducing redundancy of a genetic algorithm, comprising:
[0027] A query module, used for querying whether a key corresponding to the configuration of any chromosome has appeared in a preset dictionary before evaluating the chromosome;
[0028] An evaluation module, configured to evaluate the chromosome if there is no key corresponding to the configuration of the chromosome in the preset dictionary, and store the corresponding key in the preset dictionary;
[0029] The marking module is used to mark the chromosome as redundant if the key corresponding to the configuration of the chromosome exists in the preset dictionary, and skip the evaluation of the chromosome.
[0030] According to a third aspect of the present invention, there is provided an electronic device, the electronic device comprising: a communication interface, a processor, and a memory;
[0031] The memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, any of the above-mentioned methods for reducing redundancy of the genetic algorithm is implemented.
[0032] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having computer program instructions stored thereon, which implement any of the above-mentioned methods for reducing redundancy of genetic algorithms when executed by a computer (e.g., a processor in the computer).
[0033] In summary, the present invention provides a method and device for reducing redundancy of genetic algorithms, the method comprising: before evaluating any chromosome, querying whether the key corresponding to the configuration of the chromosome has appeared in a preset dictionary; if the key corresponding to the configuration of the chromosome does not exist in the preset dictionary, evaluating the chromosome and storing the corresponding key in the preset dictionary; if the key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome, and the evaluation of the chromosome is skipped. The algorithm proposed in the technical solution of the present application is lightweight and efficient, which can effectively reduce meaningless resource consumption in the process of finding the optimal hyperparameters of the machine learning model, solve the problems of slow parameter adjustment and lengthy training process of many multi-layer neural network models, reduce R&D-related costs, and improve the quality of results.
[0034] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0035] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A flowchart of a method for reducing genetic algorithm redundancy provided by an embodiment of the present invention;
[0038] Figure 2 A flowchart of another method for reducing genetic algorithm redundancy provided by an embodiment of the present invention;
[0039] Figure 3 A flowchart of another method for reducing genetic algorithm redundancy provided by an embodiment of the present invention;
[0040] Figure 4 A flowchart of another method for reducing genetic algorithm redundancy provided by an embodiment of the present invention;
[0041] Figure 5 A flowchart of another method for reducing genetic algorithm redundancy provided by an embodiment of the present invention;
[0042] Figure 6 A structural diagram of a device for reducing redundancy of a genetic algorithm provided by an embodiment of the present invention;
[0043] Figure 7 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0045] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0046] like Figure 1 As shown, the present invention provides a method for reducing redundancy of a genetic algorithm, and the method for reducing redundancy of a genetic algorithm comprises:
[0047] In step S11, before evaluating any chromosome, query whether the key corresponding to the configuration of the chromosome has appeared in a preset dictionary;
[0048] In step S12, if the preset dictionary does not contain a key corresponding to the configuration of the chromosome, the chromosome is evaluated and the corresponding key is stored in the preset dictionary;
[0049] In step S13, if a key corresponding to the configuration of the chromosome exists in the preset dictionary, the chromosome is marked as redundant and the evaluation of the chromosome is skipped.
[0050] In one embodiment, in the field of wind power generation, evaluating different configurations of wind turbines is a key step in optimizing power generation efficiency. Chromosome evaluation in a genetic algorithm, where each chromosome represents a configuration scheme of a wind turbine, and the dictionary represents the set of configurations that have been evaluated. Through this analogy, the analysis can reveal how to optimize the configuration evaluation process through reasonable algorithm design to improve system efficiency and avoid redundant evaluations.
[0051] In the optimization process based on genetic algorithms, each chromosome represents a possible solution or configuration. Whenever a new chromosome configuration needs to be evaluated, it is first necessary to query whether the configuration has been evaluated. Check whether the same configuration has been performance tested or simulated in the wind power generation system. Through the preset dictionary, it is possible to quickly confirm whether the configuration has been evaluated before. This logic can greatly reduce the occurrence of repeated calculations, thereby improving resource utilization. If a configuration has been proven to be effective in previous tests, the retesting step can be skipped directly, and then focus on the new configuration that has not yet been verified. This "query-confirmation" process not only improves the efficiency of optimization, but also provides designers with a mechanism to record and track the performance of different configurations, ensuring that each configuration is evaluated only when necessary.
[0052] When a chromosome configuration already exists in the preset dictionary, the configuration is considered redundant and the evaluation step can be skipped. During the optimization process, this query and skip redundant logic can also significantly improve the system's adaptability. By recording historical data, the system can not only avoid redundant evaluations, but also make inferences based on past evaluation results to better optimize future configurations. The preset dictionary is used to record configurations that have been evaluated to ensure that redundant evaluations are avoided during the optimization process. The logic of querying and skipping redundant configurations not only greatly improves the evaluation efficiency, but also effectively reduces the waste of computing resources. When a new population is generated, the preset dictionary and the keys corresponding to the configurations of each chromosome are regenerated.
[0053] The algorithm proposed in the technical solution of this embodiment is lightweight and efficient, and can effectively reduce meaningless resource consumption in the process of finding the optimal hyperparameters of the machine learning model, solve the problems of slow parameter adjustment and lengthy training process of many multi-layer neural network models, reduce R&D-related costs, and improve the quality of results.
[0054] In one embodiment, Figure 2 As shown, the following steps S21-S23 are also included:
[0055] In step S21, before evaluating the chromosome, a unique key is generated for each chromosome configuration;
[0056] In step S22, a fitness value is calculated based on the configuration of each chromosome according to a preset fitness function;
[0057] In step S23, a matching relationship between the key and fitness value of any chromosome is established.
[0058] In one embodiment, the performance of chromosomes is systematically managed and evaluated through the combination of a unique identifier (key) and an adaptation function, thereby establishing a matching relationship between a key and an adaptation value. Before evaluating each chromosome, a unique key is first generated for it, which is an identifier used to distinguish different chromosome configurations. Chromosomes usually represent a combination of a set of variables, or a possible solution. The significance of generating a unique key is to ensure that each configuration has a unique identifier, which is an essential step for subsequent calculations or record management. The generation of unique keys helps to manage a large number of configurations, especially when facing huge parameter combinations, and these keys can be used for efficient query and storage. In genetic algorithms, generating unique keys also helps to prevent repeated evaluations. When the configurations represented by multiple chromosomes are the same, the system can quickly identify whether a specific configuration has been evaluated through the key, thereby avoiding repeated calculations.
[0059] After the key is generated, the system evaluates the chromosome configuration through the preset fitness function and calculates its fitness value. The fitness value represents the quality or performance of a chromosome configuration and is a crucial indicator in the optimization algorithm. Through the fitness function evaluation, the pros and cons of each chromosome configuration will be quantified, thus providing a basis for subsequent optimization selection. The design of the fitness function needs to be combined with actual problems.
[0060] Establish a matching relationship between the key and fitness value of each chromosome. This step is similar to associating a unique configuration with its performance data in a database, which is convenient for future query and analysis. In addition, this matching relationship also helps to accumulate and utilize historical data. During multiple optimization processes, the key-value matching relationship can be continuously updated and expanded, and the best solution can be found more and more quickly. The storage and query mechanism is particularly important in actual industrial applications because it can greatly improve the operating efficiency of the system, reduce redundant calculations, and accelerate problem solving.
[0061] Different chromosome configurations are identified by unique keys to avoid confusion or repeated calculations; then, the performance of the configuration is evaluated through the fitness function to quantify its fitness value; finally, a matching relationship between the chromosome key and the fitness value is established to facilitate future queries and optimization. In areas such as wind power generation that require complex configuration optimization, it helps to improve optimization efficiency, reduce redundant work, and ensure that the system finds the optimal solution in the shortest time.
[0062] In one embodiment, Figure 3 As shown, step S12 includes the following steps S31-S33:
[0063] In step S21, if there is no key corresponding to the configuration of the chromosome in the preset dictionary, a fitness value is calculated according to the configuration of the chromosome by using a preset fitness function;
[0064] In step S22, a corresponding relationship between the fitness value of the chromosome and the key is established;
[0065] In step S23, the fitness value and key of the chromosome are stored in the preset dictionary.
[0066] In one embodiment, before performing chromosome evaluation, check whether there is a key for the corresponding chromosome configuration in the preset dictionary. The dictionary is similar to a database that records the configurations that have been evaluated, and is used to store the historical evaluation results of the chromosome configurations. If it is found that there is no corresponding configuration key in the dictionary, it means that the configuration has not been evaluated, and the subsequent evaluation process will continue at this time. In complex optimization problems, especially when involving a large number of parameter combinations, many chromosomes may have similar or identical configurations. If such a query is not performed, the configurations that have been evaluated may be repeatedly calculated, wasting valuable computing resources.
[0067] If it is found that there is no key corresponding to the current chromosome configuration in the dictionary, the preset fitness function will be used to calculate the fitness value of the configuration. The fitness value is a quantitative indicator used to measure the pros and cons of the configuration. In genetic algorithms or other optimization methods, the fitness function evaluates the performance of each chromosome configuration based on a series of design goals and constraints (such as cost, efficiency, energy consumption, etc.). Through the fitness function, the system can quickly evaluate the performance of each configuration in actual applications, thereby providing data support for subsequent optimization.
[0068] The calculation of the fitness value is the core step of the entire optimization process, which directly affects the quality of the optimization results. By calculating the fitness value, the system can screen out configurations with superior performance and use them for subsequent selection and crossover operations to further optimize the overall system performance. Therefore, the design and accuracy of the fitness function are crucial in the entire process.
[0069] After the fitness value is calculated, the fitness value of the chromosome is associated with its corresponding key, and this matching relationship is stored in a preset dictionary. When the same chromosome configuration needs to be evaluated in the future, the result can be directly retrieved from the dictionary without re-evaluation. The above storage mechanism can significantly speed up the operation of the system, especially when facing a large number of parameter combinations.
[0070] Through three main steps (querying the dictionary, calculating the fitness value, and storing the key-value pair), repeated evaluation is effectively avoided and the performance data of each chromosome configuration is ensured to be reasonably recorded and utilized. This not only improves the computational efficiency of the system, but also helps the optimization algorithm find the optimal solution faster and more intelligently.
[0071] In one embodiment, Figure 4As shown, step S13 includes the following steps S41-S42:
[0072] In step S41, if a key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome;
[0073] In step S42, the evaluation of the chromosome is skipped, and the fitness value corresponding to the key of the chromosome in the dictionary is used.
[0074] In one embodiment, in an optimization problem, chromosomes represent different configurations of solutions, and a preset dictionary is a database used to store evaluated chromosomes and their fitness values. By looking up the key-value pairs in the dictionary, it is possible to identify the evaluated chromosomes, and by skipping the evaluation steps of redundant chromosomes, the stored fitness values are directly used. This mechanism saves computing resources and speeds up the overall optimization process.
[0075] Check if there is a key corresponding to a chromosome configuration in the preset dictionary. If the key already exists, it means that the chromosome configuration has been evaluated before. In this case, the chromosome is marked as redundant. This process is similar to a database query, which quickly determines whether the current chromosome has been processed through key-value matching. It can avoid repeated evaluation of redundant configurations, especially in complex optimization problems where multiple chromosome configurations may be the same or very similar. By marking redundant chromosomes, unnecessary waste of computation can be avoided. The mechanism of detecting redundancy is very important in engineering applications, especially in scenarios with limited resources or high computational costs.
[0076] When a chromosome is marked as redundant, the system skips re-evaluating the chromosome. There is no need to calculate the fitness value of the configuration again, but the fitness value stored in the dictionary is directly used, saving computing resources and time. In complex optimization algorithms, evaluating a chromosome may require a lot of calculations, especially when multiple variables and complex functions are involved. By skipping the evaluation of known configurations, the system can significantly improve efficiency and use more resources to evaluate chromosomes that have not yet been processed. In addition, this logic also ensures the accuracy and consistency of the system. The fitness value of each chromosome only needs to be calculated once, and the system will ensure that all chromosomes with the same configuration share the same fitness value through dictionary records. This mechanism not only simplifies the calculation process, but also provides more stable data support for subsequent optimization steps (such as selection, crossover, and mutation).
[0077] First, the dictionary is queried to determine whether the chromosome is redundant; if it is redundant, the evaluation is skipped and the stored fitness value is used directly. In this way, the system can effectively reduce repeated calculations and improve optimization efficiency, especially in scenarios involving complex parameters. This logical mechanism provides the system with an intelligent resource management method, which not only speeds up the optimization process but also ensures the efficient operation of the system.
[0078] In one embodiment, Figure 5 As shown, step S31 includes the following steps S51-S52:
[0079] In step S51, the chromosome is added to a hyperparameter set, and a long short-term memory neural network is trained using a preset data set;
[0080] In step S52, the generated model is evaluated by verifying the data set, and the fitness value corresponding to the configuration of the chromosome is calculated using the model.
[0081] In one embodiment, steps such as query of a preset dictionary, model training and fitness calculation are involved to ensure that the chromosome configuration that has not been evaluated is calculated in an effective way. It not only involves traditional optimization algorithms, but also introduces machine learning models to handle complex nonlinear problems. Check whether there is a key corresponding to the current chromosome configuration in the preset dictionary. If the corresponding key is not found in the dictionary, if the chromosome configuration has not been evaluated, the chromosome needs to be further processed. In this case, the fitness value of the chromosome is calculated by a preset fitness function. The fitness value is a key indicator for measuring the performance of the chromosome configuration, and is usually used in genetic algorithms or other optimization methods to evaluate the pros and cons of each solution. Since the dictionary does not record this configuration, the system cannot directly use the previous results, so the fitness value must be calculated through a new evaluation step.
[0082] To calculate the fitness of a chromosome, the system first adds the chromosome to the hyperparameter set. This incorporates the current chromosome configuration into a wider parameter combination, facilitating subsequent model training. Next, the system trains a long short-term memory (LSTM) neural network using a preset data set. LSTM is a neural network commonly used to process time series data. It can remember information over a long time span and is very suitable for solving optimization problems involving time series changes or complex dependencies. By adding the chromosome to the hyperparameter set, the LSTM model can better learn the complex nonlinear relationship between the chromosome configuration and its fitness value.
[0083] After training is complete, the resulting model is evaluated using the validation data set. The evaluation process ensures that the model can accurately predict the fitness value of the chromosome configuration and that it generalizes well. In complex applications such as wind power generation, training an efficient LSTM model helps to make accurate predictions about the performance of different wind turbine configurations, especially when dealing with problems with highly nonlinear, complex time dependencies.
[0084] After evaluating the model, the model is used to calculate the configuration of the chromosome and obtain the corresponding fitness value. The method of predicting fitness values through machine learning models greatly enhances the efficiency of traditional optimization methods. Compared with traditional calculation methods based on physical models or formulas, neural networks such as LSTM can handle more complex data patterns and relationships, provide more accurate and faster fitness value calculations, and are particularly suitable for processing optimization problems with high parameter dimensions and complex interactions.
[0085] By combining machine learning and traditional genetic algorithms, efficient fitness calculation for unevaluated chromosome configurations is achieved. Specifically, when there is no record of a chromosome in the dictionary, the LSTM neural network is trained and verified to calculate the fitness of the chromosome. By introducing this neural network-based fitness calculation method, complex optimization problems can be better handled and the accuracy and speed of fitness calculation can be improved. This method has significant advantages in dealing with large-scale, multi-dimensional parameter optimization problems and can effectively improve the efficiency and accuracy of the optimization process.
[0086] In one embodiment, Figure 6 FIG. 1 is a block diagram of a device for reducing redundancy of a genetic algorithm according to an exemplary embodiment. Figure 6 As shown, the device for reducing redundancy of genetic algorithm includes a query module 61, an evaluation module 62 and a marking module 63.
[0087] The query module 61 is used to query whether the key corresponding to the configuration of any chromosome has appeared in a preset dictionary before evaluating the chromosome;
[0088] The evaluation module 62 is used for evaluating the chromosome if there is no key corresponding to the configuration of the chromosome in the preset dictionary, and storing the corresponding key in the preset dictionary;
[0089] The marking module 63 is used to mark the chromosome as redundant if a key corresponding to the configuration of the chromosome exists in the preset dictionary, and skip the evaluation of the chromosome.
[0090] The query module 61, the evaluation module 62 and the marking module 63 included in the apparatus block diagram for reducing the redundancy of a genetic algorithm are controlled to execute the method for reducing the redundancy of a genetic algorithm described in any one of the above embodiments.
[0091] like Figure 7 As shown, the present invention provides an electronic device 700, which includes: a communication interface, a processor 701, and a memory 702;
[0092] Among them, the memory 702 is used to store program instructions. When the program instructions are executed by the processor 701 that is communicatively connected to the memory 702 through the communication interface, before evaluating any chromosome, it queries whether the key corresponding to the configuration of the chromosome has appeared in a preset dictionary; if the key corresponding to the configuration of the chromosome does not exist in the preset dictionary, the chromosome is evaluated and the corresponding key is stored in the preset dictionary; if the key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome and the evaluation of the chromosome is skipped.
[0093] The present invention provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, before evaluating any chromosome, it is queried whether a key corresponding to the configuration of the chromosome has appeared in a preset dictionary; if the key corresponding to the configuration of the chromosome does not exist in the preset dictionary, the chromosome is evaluated and the corresponding key is stored in the preset dictionary; if the key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome and the evaluation of the chromosome is skipped.
[0094] It should be understood that the specific features, operations and details described hereinabove about the method of the present invention may also be similarly applied to the device and system of the present invention, or, vice versa. In addition, each step of the method of the present invention described above may be performed by the corresponding parts or units of the device or system of the present invention.
[0095] It should be understood that each module / unit of the device of the present invention can be implemented in whole or in part by software, hardware, firmware or a combination thereof. Each module / unit can be embedded in the processor of the computer device in the form of hardware or firmware or independent of the processor, or can be stored in the memory of the computer device in the form of software for the processor to call to perform the operation of each module / unit. Each module / unit can be implemented as an independent component or module, or two or more modules / units can be implemented as a single component or module.
[0096] In one embodiment, a computer device is provided, which includes a memory and a processor, and the memory stores computer instructions executable by the processor, and the computer instructions instruct the processor to execute each step of the method of the embodiment of the present invention when executed by the processor. The computer device can be a server, a terminal, or any other electronic device with necessary computing and / or processing capabilities in a broad sense. In one embodiment, the computer device may include a processor, a memory, a network interface, a communication interface, etc. connected through a system bus. The processor of the computer device can be used to provide necessary computing, processing and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and an internal memory. An operating system, a computer program, etc. may be stored in or on the non-volatile storage medium. The internal memory can provide an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be used to connect and communicate with external devices through a network. The steps of the method of the present invention are executed by the processor.
[0097] The present invention may be implemented as a computer-readable storage medium having a computer program stored thereon, which causes the steps of the method of an embodiment of the present invention to be executed when executed by a processor. In one embodiment, the computer program is distributed on a plurality of computer devices or processors coupled to a network so that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be performed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be performed by one or more computer devices or processors, and one or more other method steps / operations may be performed by one or more other computer devices or processors. One or more computer devices or processors may perform a single method step / operation, or perform two or more method steps / operations.
[0098] It will be appreciated by those skilled in the art that the method steps of the present invention can be completed by instructing related hardware such as a computer device or a processor through a computer program, and the computer program can be stored in a non-temporary computer-readable storage medium, and the steps of the present invention are executed when the computer program is executed. Depending on the circumstances, any reference to memory, storage, database or other media herein may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (the proposed algorithm is lightweight and efficient, which can effectively reduce meaningless resource consumption in the process of finding the optimal hyperparameters of machine learning models, solve the problems of slow parameter adjustment and lengthy training process of many multi-layer neural network models, reduce R&D-related costs, and improve the quality of results PROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0099] The various technical features described above can be combined arbitrarily. Although all possible combinations of these technical features are not described, any combination of these technical features should be considered to be covered by this specification as long as there is no contradiction in such combination.
[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for reducing redundancy of a genetic algorithm, characterized in that: include: Before evaluating any chromosome, query whether the key corresponding to the configuration of the chromosome already appears in the preset dictionary; If there is no key corresponding to the configuration of the chromosome in the preset dictionary, evaluating the chromosome and storing the corresponding key in the preset dictionary; If a key corresponding to the configuration of the chromosome exists in the preset dictionary, the chromosome is marked as redundant and the evaluation of the chromosome is skipped.
2. The method for reducing genetic algorithm redundancy as claimed in claim 1, characterized in that: Also includes: Before evaluating the chromosomes, a unique key is generated for each chromosome configuration; According to the preset fitness function, the fitness value is calculated based on the configuration of each chromosome; Establish a matching relationship between the key and fitness value of any chromosome.
3. The method for reducing genetic algorithm redundancy as claimed in claim 1, characterized in that: If the preset dictionary does not contain a key corresponding to the configuration of the chromosome, evaluating the chromosome and storing the corresponding key in the preset dictionary includes: If there is no key corresponding to the configuration of the chromosome in the preset dictionary, calculating the fitness value according to the configuration of the chromosome by using a preset fitness function; Establishing a corresponding relationship between the fitness value of the chromosome and the key; And the fitness value and key of the chromosome are stored in the preset dictionary.
4. The method for reducing redundancy of a genetic algorithm as claimed in claim 1, characterized in that: If the key corresponding to the configuration of the chromosome exists in the preset dictionary, the chromosome is marked as redundant, and the evaluation of the chromosome is skipped, including: If a key corresponding to the configuration of the chromosome exists in the preset dictionary, it is marked as a redundant chromosome; Skip evaluation of the chromosome and use the fitness value corresponding to the chromosome's key in the dictionary.
5. The method for reducing redundancy of a genetic algorithm as claimed in claim 1, characterized in that: If the preset dictionary does not have a key corresponding to the configuration of the chromosome, calculating the fitness value according to the configuration of the chromosome by using a preset fitness function, includes: Adding the chromosome to a hyperparameter set, and training a long short-term memory neural network using a preset data set; The generated model is evaluated by verifying the data set, and the fitness value corresponding to the configuration of the chromosome is calculated using the model.
6. The method for reducing genetic algorithm redundancy as claimed in claim 1, characterized in that: Also includes: When a new population is generated, the preset dictionary and the keys corresponding to the configuration of each chromosome are regenerated.
7. A device for reducing redundancy of a genetic algorithm, characterized in that: include: A query module, used for querying whether a key corresponding to the configuration of any chromosome has appeared in a preset dictionary before evaluating the chromosome; An evaluation module, configured to evaluate the chromosome if there is no key corresponding to the configuration of the chromosome in the preset dictionary, and store the corresponding key in the preset dictionary; The marking module is used to mark the chromosome as redundant if the key corresponding to the configuration of the chromosome exists in the preset dictionary, and skip the evaluation of the chromosome.
8. The device for reducing redundancy of a genetic algorithm as claimed in claim 7, characterized in that: The query module, the evaluation module and the marking module are controlled to execute the method for reducing redundancy of a genetic algorithm as described in any one of claims 1-6.
9. An electronic device, characterized in that: include: Communication interface, processor, memory; Wherein, the memory is used to store program instructions, and when the program instructions are executed by the processor that is communicatively connected to the memory through the communication interface, the electronic device implements the method for reducing genetic algorithm redundancy as described in any one of claims 1 to 6.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a computer, the computer implements the method for reducing redundancy of a genetic algorithm as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
Parameter optimization method based on improved genetic algorithm, computer equipment and storage medium
CN111898206A
Methods and apparatus to select features using genetic algorithm
CN112036566A