Method and device for predicting bandwidth used in graphics coding
Through clustering and optimization algorithms, the training data and optimization of neural network model parameters are solved, and the problem of large calculation, time-consuming and low accuracy of graphical encoding bandwidth prediction in the prior art is solved, and more efficient and accurate bandwidth prediction is achieved.
Patent Information
- Application Number
- CN202211637752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-12-16
AI Technical Summary
In the prior art, the bandwidth prediction method for graph encoding is too large to calculate, takes a long time, and has low prediction accuracy.
The training set is clustered through the clustering algorithm, and cluster clusters with high similarity to the prediction set are selected as training data, and Q-learning algorithms and genetic algorithms are used to optimize the parameters of the neural network model, reducing the amount of training data and improving the model accuracy.
This reduces the computational cost and time-consuming of model training, improves the accuracy and efficiency of prediction, and avoids the problem of neural networks falling into local optimality.
Smart Images

Figure CN116170328B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a method, device, electronic device and readable storage medium for predicting bandwidth used in graphic coding. Background Art
[0002] The bandwidth prediction of graphic coding is the basis for ensuring that graphic coding can work stably in a short-term and large-scale burst access scenario.
[0003] At present, a prediction model can be used to predict the future bandwidth of graphic coding. Specifically, the model is trained directly using the historical bandwidth data of graphic coding to obtain a prediction model that can perform bandwidth prediction.
[0004] However, when the above solution is implemented, a large amount of training data is needed, which leads to excessive calculation and long time consumption. In addition, the training process is prone to fall into local optimum, resulting in low prediction accuracy. Summary of the invention
[0005] The present invention provides a method, device, electronic device and readable storage medium for predicting bandwidth usage of graphic coding, so as to solve the technical problems in the prior art of excessive calculation, long time consumption and low prediction accuracy.
[0006] In a first aspect, the present invention provides a method for predicting bandwidth usage of graphics coding, the method comprising:
[0007] Acquire a historical bandwidth usage data set for graphic coding, wherein the historical bandwidth usage data set includes a training set and a prediction set;
[0008] Clustering the training set according to a preset clustering algorithm to obtain multiple clusters;
[0009] Determine a target cluster from all clusters, and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion;
[0010] Optimizing the model parameters of the neural network model by using a Q learning algorithm and a genetic algorithm, and training the neural network model with the optimized model parameters by using the training data to obtain a target neural network model;
[0011] The samples in the prediction set are input into a target neural network model to obtain a prediction result of the bandwidth used for the graphics coding.
[0012] In a second aspect, the present invention provides a device for predicting bandwidth usage of graphics coding, the device comprising:
[0013] An acquisition module, used to acquire a historical bandwidth usage data set for graphic coding, wherein the historical bandwidth usage data set includes a training set and a prediction set;
[0014] A clustering module, used to cluster the training set according to a preset clustering algorithm to obtain multiple clusters;
[0015] A screening module is used to determine a target cluster from all clusters and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion;
[0016] A training module, used to optimize the model parameters of the neural network model using a Q learning algorithm and a genetic algorithm, and to train the neural network model with the optimized model parameters using the training data to obtain a target neural network model;
[0017] The prediction module is used to input the samples in the prediction set into the target neural network model to obtain the prediction result of the bandwidth used for the graphic coding.
[0018] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the bandwidth prediction method for the above-mentioned graphic coding when executing the program.
[0019] In a fourth aspect, the present invention provides a readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above-mentioned method for predicting bandwidth usage of graphic coding.
[0020] In an embodiment of the present invention, a clustering algorithm is used to cluster the training set first to obtain multiple clusters, and then based on the similarity between the prediction set data and the data in the clusters, the cluster to which the prediction set data belongs is determined, and the cluster that is highly close to the prediction set data is used as training data, and the remaining data in the clustering results are screened out, thereby effectively screening out a small amount of accurate training data from the training set, and excluding the remaining interference data based on similarity analysis, so that the amount of calculation in the subsequent model training process is greatly reduced, and the training accuracy is improved. In addition, the embodiment of the present invention optimizes the model parameters through the Q learning algorithm and the genetic algorithm. The optimized model parameters can allow the neural network to converge quickly, find the optimal point, and avoid the neural network model from falling into the local optimum, thereby improving the accuracy of the algorithm and reducing the calculation time of the neural network, thereby achieving the effect of improving the accuracy and efficiency of the prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 is a flow chart of the steps of a method for predicting bandwidth used in graphics coding provided by an embodiment of the present invention;
[0023] Figure 2 A flowchart of specific steps of a method for predicting bandwidth used in graphics coding is provided in an embodiment of the present invention;
[0024] Figure 3 It is a structural diagram of a bandwidth prediction device for graphics coding provided by an embodiment of the present invention;
[0025] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Figure 1 FIG. 1 is a flow chart of the steps of a method for predicting bandwidth used in graphics coding provided by an embodiment of the present invention. Figure 1 As shown, the method may include:
[0028] Step 101: Obtain a historical bandwidth usage dataset of graphic coding, wherein the historical bandwidth usage dataset includes a training set and a prediction set.
[0029] In an embodiment of the present invention, a graphic code is a black and white graphic that records data symbol information distributed in a plane (two-dimensional direction) or space (three-dimensional direction) according to a certain rule using a certain specific geometric figure. After scanning the graphic code, the information recorded in the image code can be obtained and the subsequent data access and request links can be entered. Graphic coding cleverly uses the concept of "0" and "1" bit streams that constitute the internal logical basis of the computer in its compilation, and uses several geometric shapes corresponding to binary to represent textual numerical information. By scanning the graphic code through an image input device or an optoelectronic scanning device, the information in the graphic code can be automatically read to realize automatic information processing. Graphic coding includes but is not limited to QR codes, bar codes and other forms. Specific usage scenarios of graphic coding include: health graphic coding (scanning the code to record personal health information), sign-in graphic coding (scanning the code to record sign-in information), lottery graphic coding (scanning the code to draw a lottery), etc.
[0030] In actual applications, due to the widespread use of graphic coding in all walks of life, graphic coding has a huge amount of access, and the huge amount of access is inseparable from the strong support of the underlying hardware devices such as hard disks and servers. These hardware devices are often accessed in large quantities in a short period of time. In order to ensure the normal use of graphic coding during the sudden increase in usage, the performance of these devices must be guaranteed. The bandwidth used is an important indicator that affects the performance of the device. If the operation and maintenance personnel can adjust the bandwidth before the peak of graphic coding usage and adjust the bandwidth according to the usage of graphic coding in different periods, the congestion of graphic coding during the peak of access can be avoided. Therefore, accurate prediction of the bandwidth used by graphic coding can greatly improve the user experience of graphic coding and effectively avoid peak congestion. At the same time, the prediction of the bandwidth used by graphic coding can also allow the operation and maintenance personnel to perceive the current status of the equipment, make predictions in advance, reduce the failure rate of the equipment, and thus improve the operating efficiency of graphic coding.
[0031] In this step, in order to realize the bandwidth usage prediction of graphic coding, it is first necessary to obtain a historical bandwidth usage dataset of graphic coding, and then model training can be performed based on the historical bandwidth usage dataset of graphic coding to obtain a model with prediction function.
[0032] Specifically, according to actual needs, the prediction day for which bandwidth usage prediction is required can be determined first. The historical bandwidth usage data set can be divided into a training set and a prediction set. The historical bandwidth usage data set can be data collected within a period of time before the prediction day (such as within 2 years before the prediction day). The training set is mainly used as training data during model training, and the prediction set is mainly used as input data during model prediction. Among them, the training set can account for a large proportion (such as more than 90%) of the historical bandwidth usage data set, while the prediction set accounts for a smaller proportion. The prediction set includes historical bandwidth usage data close to the prediction day.
[0033] Furthermore, the historical bandwidth usage data includes the average graphic coding bandwidth usage, the maximum graphic coding bandwidth usage, the minimum graphic coding bandwidth usage, the daily graphic coding bandwidth usage, the ambient temperature, the environmental suitability, the holiday conditions, the weather conditions, etc. In the embodiment of the present invention, the historical bandwidth usage data set can be obtained from the graphic coding operation node database, and the ambient temperature, ambient humidity, holiday conditions, and weather conditions can be obtained from the local weather forecast website. The collection interval of the historical bandwidth usage data can be set to 5 minutes to form a historical bandwidth usage data curve with a time interval of 5 minutes. The holiday conditions are divided into ordinary weekends, major holidays, and the day after the holidays. The weather conditions are divided into sunny days, rainy days, and cloudy days; therefore, the historical bandwidth usage data curve for one day is composed of 292 data points (one data point includes a time point and the bandwidth usage corresponding to the time point).
[0034] Step 102: cluster the training set according to a preset clustering algorithm to obtain a plurality of clusters.
[0035] In the embodiment of the present invention, since the amount of data in the historical bandwidth usage data set is large, using the historical bandwidth usage data set for model training will result in excessive calculation and a long time consumption. In addition, there is also a large amount of interference data in the historical bandwidth usage data set. If these interference data are not eliminated, the accuracy of the subsequent training process will also decrease.
[0036] In an embodiment of the present invention, in order to solve the above problem, a clustering algorithm can be used to first cluster the training set to obtain multiple clustering clusters, and then based on the similarity between the prediction set data and the data in the clustering clusters, the clustering cluster to which the prediction set data belongs is determined, thereby determining the category of the prediction set, and the clustering cluster that is highly close to the prediction set data is used as training data, and the remaining data in the clustering results are screened out, thereby effectively screening out a small amount of accurate training data from the training set, and excluding the remaining interference data based on similarity analysis, so that the computational complexity of the subsequent model training process is greatly reduced, and more accurate training data also improves the training accuracy.
[0037] Clustering algorithm is a statistical analysis method for studying sample classification problems. Cluster analysis is composed of several patterns. Usually, a pattern is a vector of measurement, or a point in multidimensional space. Clustering algorithm can measure the similarity between samples based on a specific measurement function, so that the similarity of samples of the same class is as close as possible, and data of different classes are separated as much as possible, so that similar samples of a class eventually form a cluster, and dissimilar samples are separated from the cluster and excluded. In this step, according to the preset clustering algorithm, the training set is clustered, and the samples in the training set can be divided into several categories, that is, multiple clusters are obtained, each cluster is a sample set, and each cluster corresponds to a category.
[0038] Step 103: determine a target cluster from all clusters, and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion.
[0039] In an embodiment of the present invention, the clusters obtained by clustering the training set can be used as a category set, and the distance between the cluster center of the cluster and the sample of the prediction set is further calculated, and the cluster whose distance meets the maximum deviation similarity criterion is used as the target cluster, and the training set samples outside the target cluster are screened out. The maximum deviation similarity criterion is a similarity measurement criterion that can effectively characterize the morphological similarity of frequently fluctuating bandwidth usage data, and has the characteristics of simplicity, rationality, and flexibility. The embodiment of the present invention determines the category of the prediction set by distinguishing the similarity between the prediction set data and the cluster, and focuses the training data on the target cluster, removing the interference of the training set samples outside the target cluster, which helps to reduce the amount of training data, reduce training time, and also improves training accuracy.
[0040] Step 104: Optimize the model parameters of the neural network model using the Q learning algorithm and the genetic algorithm, and train the neural network model with the optimized model parameters using the training data to obtain a target neural network model.
[0041] In an embodiment of the present invention, the model for bandwidth prediction can be a neural network model based on deep learning, specifically a back propagation (BP) neural network model. The BP neural network model is a multi-layer feedforward neural network trained according to the error back propagation algorithm. The BP neural network adds several hidden layers (one or more layers) of neurons between the input layer and the output layer. These neurons are called hidden units. They have no direct connection with the outside world, but the change of their state can affect the relationship between input and output. Each layer can have several nodes. The calculation process of the BP neural network consists of a forward calculation process and a reverse calculation process. In the forward propagation process, the input pattern is processed layer by layer from the input layer through the hidden unit layer and turned to the output layer. The state of each layer of neurons only affects the state of the next layer of neurons. If the expected output cannot be obtained in the output layer, it will turn to back propagation, return the error signal along the original connection path, and minimize the error signal by modifying the weights of each neuron.
[0042] Specifically, there are many model processing layers between the input layer and the output layer of the neural network model, and there are also many model parameters (such as weights, thresholds, etc.) between the layers. If the default model parameter settings are used and the training data is directly used for model training, the trained model will easily fall into the local optimum, thereby reducing the model accuracy.
[0043] In order to solve the above problems, the embodiments of the present invention aim to optimize the model parameters through Q learning algorithm and genetic algorithm. The optimized model parameters can allow the neural network to converge quickly and find the optimal point, thereby preventing the neural network model from falling into the local optimum, thereby improving the accuracy of the algorithm and reducing the calculation time of the neural network, thereby achieving the effect of improving the accuracy and efficiency of the prediction.
[0044] The model parameters of the neural network model optimized by the Q learning algorithm and the genetic algorithm can be imported into the neural network model to realize parameter setting. According to the set optimization parameters, the neural network model with optimized model parameters can be trained using the training data to obtain the final target neural network model.
[0045] Among them, the Q-learning algorithm is an improved algorithm for reinforcement learning (RL), which is a technical idea for searching for the global optimal result. Specifically, reinforcement learning is used to describe and solve the problem of how an agent can maximize its return or achieve a specific goal by learning strategies during its interaction with the environment. It is essentially a sequential decision-making problem, and its core idea is how the agent can choose an action based on the state of the current observable environment (model) to maximize the cumulative reward.
[0046] For the intelligent agent in reinforcement learning, if a certain behavior strategy leads to a positive reward (reinforcement signal) from the environment, then the tendency of the agent to produce this behavior strategy in the future will be strengthened. The agent's goal is to find the optimal strategy in each discrete state to maximize the expected discounted reward. Reinforcement learning regards learning as a trial and evaluation process. The agent selects an action for the environment. The state of the environment changes after accepting the action, and a reinforcement signal (reward or punishment) is generated and fed back to the agent. The agent then selects the next action based on the reinforcement signal and the current state of the environment. The principle of selection is to increase the probability of receiving positive reinforcement (reward). The selected action not only affects the immediate reinforcement value, but also affects the state of the environment at the next moment and the final reinforcement value.
[0047] The Q-learning algorithm is an improved solution based on reinforcement learning. It searches for the optimal state-behavior value (Q-value) function. The Q-function and its corresponding optimal state-behavior value function are obtained through the Q-table (a mapping table between state-action and estimated future return value) and the neural network. The main idea of the Q-learning algorithm is to construct the state and action into a Q-table to store the Q value, and then select the action that can obtain the maximum benefit based on the Q value. According to the above derivation, the Q value can be calculated, so with the Q value, learning can be carried out, which is the update process of the Q-table.
[0048] Genetic algorithms are designed based on the laws of evolution of organisms in nature and can be applied to solve related problems in the computer field. Genetic algorithms use mathematical methods and computer simulation operations to convert the problem-solving process into processes similar to the crossover and mutation of chromosome genes in biological evolution. When solving more complex combinatorial optimization problems, genetic algorithms can usually obtain better optimization results faster than some conventional optimization algorithms.
[0049] In an embodiment of the present invention, based on the optimization scenario of the model parameters, a population can be first constructed based on a genetic algorithm. The individuals (genes) in the population are equivalent to a set of model parameters. The population can perform crossover mutation to iteratively update the individuals and generate new individuals. Furthermore, in an embodiment of the present invention, the model parameters can be used as the state in the Q learning algorithm, and the action of adjusting the model parameters can be used as the action in the Q learning algorithm, and the population is considered to be the environment in the Q learning algorithm.
[0050] In general, after combining the Q-learning algorithm and the genetic algorithm, the model parameters to be optimized can be constructed as individuals into a population, and iterative updates based on crossover mutation can be performed to continuously generate new individuals. The intelligent agent of the Q-learning algorithm selects an action based on the state in the currently observable environment to obtain the maximum cumulative return selection strategy, and selects the optimal individual from the population. Finally, a set of model parameters represented by the optimal individual can be used as the model parameters specifically used by the neural network model.
[0051] Step 105: Input the samples in the prediction set into the target neural network model to obtain a prediction result of the bandwidth used for the graphic coding.
[0052] In an embodiment of the present invention, the samples in the prediction set are samples of the target coding bandwidth usage collected on or near the prediction day. The samples in the prediction set are input into the target neural network model to obtain the prediction results of the bandwidth usage for the graphic coding. Through the prediction results, the operation and maintenance personnel can adjust the relevant equipment before the peak of the graphic coding usage, and make real-time bandwidth adjustments according to the usage of the graphic coding in different time periods to avoid the congestion of the graphic coding during the access peak. Therefore, accurate prediction of the bandwidth usage of the graphic coding can greatly improve the user experience of the graphic coding and effectively avoid peak congestion. At the same time, the prediction of the bandwidth usage of the graphic coding can also allow the operation and maintenance personnel to perceive the current status of the equipment, make predictions in advance, reduce the failure rate of the equipment, and thus improve the operation efficiency of the graphic coding.
[0053] In summary, the embodiment of the present invention utilizes a clustering algorithm to first cluster the training set to obtain multiple cluster clusters, and then determines the cluster cluster to which the prediction set data belongs based on the similarity between the prediction set data and the data in the cluster clusters, and uses the cluster clusters that are highly close to the prediction set data as training data, and screens out the remaining data in the clustering results, thereby effectively screening out a small amount of accurate training data from the training set, and excluding the remaining interference data based on similarity analysis, so that the amount of calculation in the subsequent model training process is greatly reduced, and the training accuracy is improved. In addition, the embodiment of the present invention optimizes the model parameters through the Q learning algorithm and the genetic algorithm. The optimized model parameters can allow the neural network to converge quickly, find the optimal point, and avoid the neural network model from falling into the local optimum, thereby improving the accuracy of the algorithm and reducing the calculation time of the neural network, thereby achieving the effect of improving the accuracy and efficiency of the prediction.
[0054] Figure 2 FIG. 1 is a flowchart of specific steps of a bandwidth prediction method for graphics coding provided by an embodiment of the present invention. Figure 2 As shown, the method may include:
[0055] Step 201: Obtain a historical bandwidth usage dataset of graphic coding, wherein the historical bandwidth usage dataset includes a training set and a prediction set.
[0056] This step may specifically refer to the above step 101, which will not be described in detail here.
[0057] Step 202: Determine the optimal maximum deviation algorithm parameters according to the parameters required by the maximum deviation algorithm and the genetic algorithm.
[0058] Optionally, the maximum deviation algorithm parameters include: one or more of maximum deviation distance, similarity, deviation, and number of categories.
[0059] Before performing the clustering operation in step 203, it is necessary to obtain the maximum deviation algorithm parameters required for the clustering operation, namely, the maximum deviation distance, similarity, deviation, and number of categories. Compared with the clustering inaccuracy caused by using the default maximum deviation algorithm parameters, the embodiment of the present invention can use the idea of genetic algorithm to determine an optimal maximum deviation algorithm parameter, and subsequent clustering using the optimal maximum deviation algorithm parameter can greatly improve the accuracy of clustering.
[0060] Specifically, based on the idea of genetic algorithm, the maximum deviation algorithm parameters can be used as individuals to construct a population, that is, the individuals (genes) in the population are equivalent to a set of maximum deviation algorithm parameters. The population can perform crossover mutation to iteratively update the individuals and generate new individuals. Then, the fitness value of the individual is used as the basis for selecting the optimal individual in each iteration. After the iteration is terminated, the individual with the smallest fitness is selected as the optimal individual. The maximum deviation algorithm parameters represented by the optimal individual are the optimal maximum deviation algorithm parameters.
[0061] Optionally, step 202 may specifically include:
[0062] Sub-step 2021: establishing a first population according to the parameters required by the maximum deviation algorithm, wherein the first population includes a plurality of first individuals, and each first individual corresponds to a set of maximum deviation algorithm parameters.
[0063] Sub-step 2022: Calculate the fitness value of each first individual in the first population, and determine the first individual with the smallest fitness value in the first population.
[0064] Sub-step 2023, based on the genetic algorithm, crossover mutation processing is performed on the first population through multiple rounds of iterations, and the first individual with the smallest fitness value is re-determined in each round of iteration. After reaching a preset number of iterations, the first individual with the smallest fitness value determined in the last iteration is used as the optimal first individual, and the optimal first individual is used as the optimal maximum deviation algorithm parameter.
[0065] In the embodiment of the present invention, for sub-steps 2021-2023, firstly, it is necessary to establish a first population according to the parameters required by the maximum deviation algorithm, and the first population includes multiple first individuals, each of which corresponds to a set of maximum deviation algorithm parameters. Only after the population is constructed, can the idea of the genetic algorithm be used, and the maximum deviation algorithm parameters are regarded as individuals (genes), and subsequent naturalistic operations such as individual crossover and mutation in the population can be performed to generate new individuals. Afterwards, the fitness value of each first individual in the first population can be calculated, and the fitness value can be used as a criterion for judging the quality of the first individual. The better the first individual is, the smaller its fitness value is, and the worse the first individual is, the larger its fitness value is. Finally, based on the genetic algorithm, the first population is subjected to crossover and mutation processing respectively through multiple rounds of iterations, and new individuals are continuously generated in each round of iteration, and the first individual with the smallest fitness value is re-determined, and after reaching the preset number of iterations, the first individual with the smallest fitness value determined in the last iteration is used as the optimal first individual, and the optimal first individual is used as the optimal maximum deviation algorithm parameter, and the subsequent clustering operation can be implemented using the optimal maximum deviation algorithm parameter, thereby improving the accuracy of clustering.
[0066] Optionally, sub-step 2021 may specifically include:
[0067] Sub-step A1: create a first matrix, wherein a row of elements in the first matrix represents a first entity.
[0068] Sub-step A2: performing chaos processing on the first matrix by randomly assigning random numbers within a preset range to elements in the first matrix.
[0069] Sub-step A3: correcting the values of the elements in the first matrix after the chaos processing according to the standard value range of the parameters required by the maximum deviation algorithm, and using the corrected first matrix as the first population.
[0070] In the embodiment of the present invention, with respect to sub-steps A1-A3, the process of creating the first population is described in detail:
[0071] First, we need to construct the first initialized matrix B as the initial population:
[0072]
[0073] The number of columns n (set according to requirements, generally 50) of the first matrix B represents the number of first individuals (genes). A row of data in the first matrix B represents a first individual. Each first individual contains four elements. Taking the first first individual as an example, the first individual includes the maximum deviation distance γ (equivalent to x 11 ), similarity α (equivalent to x 12 ), deviation β (equivalent to x13 ), the number of categories s (equivalent to x 14 ).
[0074] Finally, for the maximum deviation algorithm parameters including the maximum deviation distance γ, similarity α, deviation β, and number of categories s, these four elements have their own corresponding standard value ranges, such as γ∈[0.05,0.25], α∈[0.7,0.9], β∈[n -1 ,1-x 2n ], s∈[1,20], according to the standard value range of the elements of these maximum deviation algorithms, the values of the elements in the first matrix B after chaos processing can be corrected, and the value range of the elements in the corrected first matrix returns to its corresponding standard value range, and finally the corrected first matrix is used as the first population. The correction process is as follows:
[0075]
[0076] In addition, for the corrected first matrix B, the elements in the fourth column (corresponding to the number of categories) need to be rounded down to ensure that the number of categories is an integer.
[0077] Optionally, sub-step 2022 may specifically include:
[0078] Sub-step B1: for each first individual, randomly select the number of target samples of the category from the training set, and use the target samples as the first clustering centers.
[0079] Sub-step B2: Calculate the distance between each sample in the training set and the first cluster center according to the maximum deviation algorithm parameters of the first individual characterization, add the samples whose distance meets the maximum deviation similarity criterion to the first cluster cluster of the first cluster center, and obtain the first cluster clusters of the number of categories.
[0080] Sub-step B3: taking the accumulated value of the distance between each sample in the first cluster and the first cluster center as the fitness value of the first cluster, and taking the accumulated value of the fitness values of the first clusters of the number of categories as the fitness value of the first individual.
[0081] In the embodiment of the present invention, the calculation process of the fitness value is described in detail for sub-steps B1-B3:
[0082] First, determine the fitness value of the first individual. It is necessary to clarify the meaning of the fitness value. In genetics, the fitness value represents the degree of advantage of an individual in the survival of a population and is used to distinguish between "good" and "bad" individuals. The smaller the fitness value, the better the individual, and the larger the fitness value, the worse the individual.
[0083] In the embodiment of the present invention, for each first individual, a target sample of the number of categories (the fourth element of the individual) is randomly selected from the training set, and the target sample is used as the first cluster center. Then, according to the maximum deviation algorithm parameter characterized by the first individual, the distance between each sample in the training set and the first cluster center is calculated, and the samples whose distances meet the maximum deviation similarity criterion are added to the first cluster cluster of the first cluster center to obtain the first cluster clusters of the number of categories. The process includes:
[0084] 1. Calculate the Euclidean distance between the samples in the training set and the first cluster center, the Euclidean distance x ijk The calculation formula is:
[0085] x ijk =||x ik -x jk ||
[0086] 2. If the Euclidean distance x ijk Satisfies the maximum deviation similarity criterion:
[0087]
[0088] It is judged that the sample is similar to the first cluster center, and the sample is classified into the cluster of the first cluster center.
[0089] Finally, the accumulated value of the distance between each sample in the first cluster and the center of the first cluster can be used as the fitness value of the first cluster, and the accumulated value of the fitness values of the first clusters of the number of categories can be used as the fitness value of the first individual, thereby obtaining the fitness value of the first individual. The calculation process of the fitness value is as follows:
[0090]
[0091] Among them, u is the dimension of the samples in the training set; t is the total number of samples belonging to category j.
[0092] It should be noted that, in sub-step 2023, the first population is subjected to crossover mutation processing based on the genetic algorithm through multiple rounds of iterations, and differential mutation calculation can be performed first. The formula for differential mutation calculation is as follows:
[0093] x i (t+1)=x i (t)+λ·[x best (t)-x j (t)]+F·[x m (t)-x n (t)]
[0094] Among them, λ is the greediness of the control algorithm, F is the amplification factor; x best(t) is the optimal first individual in the current first population; x j (t), x m (t) and x n (t) represent three different first individuals randomly selected from the first population, excluding the current first individual.
[0095] Next, we will calculate the vertical and horizontal intersections. The horizontal intersection calculation formula is as follows:
[0096] M hc (i,d)=r1X(i,d)+(1-r1)X(j,d)+c1(X(i,d)-X(j,d))
[0097] M hc (j,d)=r2X(j,d)+(1-r2)X(i,d)+c2(X(j,d)-X(i,d))
[0098] Where c1, c2 are random numbers on [-1, 1]; r1, r2 are random numbers on [-1, 1]; X(i), X(j) are the dth dimension of the parent gene X(i), X(j) respectively; M hc (i,d),M hc (j,d) are the d-th dimensional offspring generated by horizontal crossover of X(i,d) and X(j,d).
[0099] The calculation formula for vertical intersection is as follows:
[0100] M vc (i,d1)=rX(i,d1)+(1-r)X(i,d2)
[0101] Where r is a random number on [0,1]; Mvc(i,d1) is the offspring gene generated by vertical crossover of d1 and d2 dimensions of gene i.
[0102] After that, greedy selection calculation is performed. The offspring individual X after differential mutation i (t+1) will be the same as the original vector X i (t) Compare the fitness values. Only when the offspring individual X i The fitness value of (t+1) is less than the original vector X i (t), it will be selected as the parent of the next generation, otherwise it will directly enter the next generation. After multiple rounds of iterative comparison, the optimal first individual determined by the last iteration is used as the optimal maximum deviation algorithm parameter. It should be noted that the real-time calculation process of the fitness value of the individual in each round of iteration can be specifically referred to the description of the above sub-steps B1-B3, which will not be repeated here.
[0103] Step 203: clustering the training set using the optimal maximum deviation algorithm parameters to obtain multiple clusters.
[0104] In the embodiment of the present invention, the clustering operation performed on the training set can be implemented using the optimal maximum deviation algorithm parameters. Since the maximum deviation algorithm parameters have been optimized and improved by the genetic algorithm, the accuracy of clustering is improved.
[0105] Step 204: determine a target cluster from all clusters, and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion.
[0106] This step may be specifically referred to as the above step 103, which will not be described in detail here.
[0107] Step 205: Optimize the model parameters of the neural network model using the Q learning algorithm and the genetic algorithm, and train the neural network model with the optimized model parameters using the training data to obtain a target neural network model.
[0108] This step may be specifically referred to as the above step 104, which will not be described in detail here.
[0109] Optionally, step 205 may specifically include:
[0110] Sub-step 2051: Initialize the parameters of the genetic algorithm, the parameters of the Q learning algorithm and the model parameters of the neural network model.
[0111] Sub-step 2052: establishing a second population according to the model parameters of the neural network model, wherein the second population includes a plurality of second individuals, and each second individual corresponds to a set of model parameters of the neural network model.
[0112] Sub-step 2053: selecting an optimal second individual from the second population according to the Q learning algorithm and the genetic algorithm, and setting the neural network model using the model parameters represented by the optimal second individual to complete the model parameter optimization of the neural network model.
[0113] In the embodiment of the present invention, for sub-steps 2051-2053, for the optimization of the model parameters of the BP neural network model, it is first necessary to initialize the parameters of the genetic algorithm, the parameters of the Q learning algorithm and the model parameters of the BP neural network model. The genetic algorithm initialization parameters include the maximum number of iterations, the population size, the mutation probability, the maximum deviation coefficient, and the maximum error. Preferably, the maximum number of iterations is set to 10,000, the population size is set to 50, the mutation probability is set to 0.09, and the maximum error is set to 0.00001. The model parameters of the BP neural network include the number of input layers, the number of hidden layers, the number of output layers, and the convergence error. Preferably, the number of input layers is set to 292, the number of hidden layers is set to 25, the number of output layers is set to 288, and the convergence error is set to 10 -6 For the parameters of the Q-learning algorithm, the number of steps m required to look ahead to calculate the Q value is set to 10.
[0114] Then, according to the model parameters of the BP neural network model, a second population is established. The second population includes multiple second individuals (genes), each second individual corresponds to a set of model parameters of the BP neural network model, wherein a second individual represents a set of model parameters of the BP neural network model, and the length of a second individual (the length of a gene) can be determined by the weights and thresholds required to be set in the BP neural network model. Assuming that the input layer of the BP neural network model is 15 layers, the hidden layer is 30 layers, and the output layer is 10 layers, the length of a second individual = 15 × 30 + 30 + 30 × 10 + 10 = 790. It should be noted that the process of constructing the second population can also refer to the description of the process of constructing the first population, which will not be repeated here.
[0115] After constructing the second population, the optimal second individual is selected from the second population according to the Q learning algorithm and the genetic algorithm. The specific idea is to use the model parameters (the second individual) as the state in the Q learning algorithm, and the action of adjusting the model parameters as the action in the Q learning algorithm. The second population is considered to be the environment in the Q learning algorithm, and iterative updates based on crossover mutation are performed in the second population to continuously generate new individuals. The intelligent agent of the Q learning algorithm selects an action according to the state in the currently observable environment to obtain the maximum cumulative return. The optimal second individual is selected from the second individual of the second population using the Q value and fitness value. Finally, a set of model parameters represented by the optimal second individual can be used as the model parameters specifically used by the neural network model. Finally, the model parameters represented by the optimal second individual are used to set the BP neural network model. The model parameter optimization of the BP neural network model is completed by combining the ideas of the Q learning algorithm and the genetic algorithm.
[0116] Optionally, sub-step 2053 may specifically include:
[0117] Sub-step C1: Process the second population using a Q learning algorithm and a genetic algorithm to obtain a third population.
[0118] Sub-step C2: Calculate the fitness value of the second individual in the second population and the fitness value of the third individual in the third population.
[0119] Sub-step C3: by comparing the second population and the third population, retain the second individual with a smaller fitness value in the second population, and replace the second individual with a larger fitness value in the second population with the corresponding third individual with a smaller fitness value in the third population, to obtain the target second population.
[0120] Sub-step C4: Select the second individual with the smallest fitness value in the target second population as the optimal second individual.
[0121] Optionally, sub-step C1 may specifically include:
[0122] Sub-step C11: using n preset parameter selection strategies to process each second individual in the second population, so as to obtain corresponding n new second individuals for each second individual.
[0123] Sub-step C12: Perform crossover mutation processing on the n new second individuals according to the genetic algorithm to obtain n target second individuals.
[0124] Sub-step C13: Calculate the Q value of each target second individual according to the Q learning algorithm, take the target second individual with the largest Q value as the corresponding third individual in the third population, and obtain the third population.
[0125] In the embodiment of the present invention, for sub-steps C1-C4 and sub-steps C11-C13, firstly, the n parameter selection strategies of the Q learning algorithm are used to select and generate n new second individuals based on each second individual in the second population. Then, the n new second individuals are subjected to the crossover mutation process of the genetic algorithm to obtain n target second individuals. Based on the Q value calculation of the Q learning algorithm, the Q value of each target second individual can be calculated. Finally, the target second individual with the largest Q value is used as the third individual corresponding to the original second individual in the third population. After each second individual in the second population is processed as above, a third population corresponding to the second population can be obtained. Finally, by comparing the second population and the third population, the second individual with a smaller fitness value in the second population is retained, and the second individual with a larger fitness value in the second population is replaced by the corresponding third individual with a smaller fitness value in the third population to obtain the target second population. The second individual with the smallest fitness value in the target second population is selected as the optimal second individual. The model parameters characterized by the optimal second individual can be used to set the BP neural network model to complete the parameter optimization of the BP neural network model.
[0126] For each second individual, n new second individuals are generated using the n parameter selection strategies given by the Q learning algorithm, and t=1 is set; the calculation formula of the parameter selection strategy is:
[0127] α=(α0-α1)×(t / MaxIter)+α1
[0128] When t is less than the number of steps m required to look ahead for the Q value, the new second individual can generate n target second individuals based on the following formula:
[0129] x n×i,n =x i *rand(n,n)
[0130] Afterwards, a selection operation is performed on the target second individual. Specifically, the embodiment of the present invention may select a roulette method to implement the selection. The selection strategy is based on the fitness value ratio. The selection probability of each individual i is pi:
[0131]
[0132]
[0133] Among them, Fi is the fitness value of individual i, k is the coefficient, and N is the number of individuals in the second population.
[0134] Furthermore, the formula for the mutation operation used by the genetic algorithm is:
[0135]
[0136] Among them, a max Gene a ij The upper bound of min Gene a ij The lower bound of f(g) = r2(1-g / G max )2; r2 is a random number; g is the current number of iterations; G max is the maximum number of evolutions; r is a random number between [0,1].
[0137] The calculation formula of Q value is as follows:
[0138] Q(a)=r(a)+γQ(a (1) )+γ 2 Q(a (2) )+…γ m Q(a (m) )
[0139] Among them, m represents the number of steps forward that the Q value looks; a,a (i) ∈A, and 1≤i≤m.
[0140] For the calculation of the fitness value of the second individual in the second population and the fitness value of the third individual in the third population, specifically, for each individual (the second individual or the third individual), the model parameters representing the individual can be set for the neural network model, and then all samples in the training set are input into the neural network model respectively. For each input action, the difference between the output value of the neural network model and the true value of the sample annotation is calculated, and the difference corresponding to all inputs is accumulated to obtain the fitness value corresponding to the individual.
[0141] Step 206: Input the samples in the prediction set into the target neural network model to obtain a prediction result of the bandwidth used for the graphics coding.
[0142] This step may be specifically referred to as the above step 105, which will not be described in detail here.
[0143] In summary, the embodiment of the present invention utilizes a clustering algorithm to first cluster the training set to obtain multiple cluster clusters, and then determines the cluster cluster to which the prediction set data belongs based on the similarity between the prediction set data and the data in the cluster clusters, and uses the cluster clusters that are highly close to the prediction set data as training data, and screens out the remaining data in the clustering results, thereby effectively screening out a small amount of accurate training data from the training set, and excluding the remaining interference data based on similarity analysis, so that the amount of calculation in the subsequent model training process is greatly reduced, and the training accuracy is improved. In addition, the embodiment of the present invention optimizes the model parameters through the Q learning algorithm and the genetic algorithm. The optimized model parameters can allow the neural network to converge quickly, find the optimal point, and avoid the neural network model from falling into the local optimum, thereby improving the accuracy of the algorithm and reducing the calculation time of the neural network, thereby achieving the effect of improving the accuracy and efficiency of the prediction.
[0144] Figure 3 : is a structural diagram of a bandwidth prediction device for graphics coding provided by an embodiment of the present invention, and the device may include:
[0145] An acquisition module 301 is used to acquire a historical bandwidth usage data set of graphic coding, wherein the historical bandwidth usage data set includes a training set and a prediction set;
[0146] A clustering module 302 is used to cluster the training set according to a preset clustering algorithm to obtain a plurality of clusters;
[0147] A screening module 303 is used to determine a target cluster from all clusters and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion;
[0148] The training module 304 is used to optimize the model parameters of the neural network model by using the Q learning algorithm and the genetic algorithm, and train the neural network model with the optimized model parameters by using the training data to obtain the target neural network model;
[0149] The prediction module 305 is used to input the samples in the prediction set into the target neural network model to obtain the prediction result of the bandwidth used for the graphic coding.
[0150] Optionally, the clustering module 302 includes:
[0151] The optimal parameter submodule is used to determine the optimal maximum deviation algorithm parameters according to the parameters required by the maximum deviation algorithm and the genetic algorithm;
[0152] The clustering submodule is used to cluster the training set using the optimal maximum deviation algorithm parameters to obtain multiple clusters.
[0153] Optionally, the optimal parameter submodule includes:
[0154] A construction unit, configured to establish a first population according to the parameters required by the maximum deviation algorithm, wherein the first population includes a plurality of first individuals, each first individual corresponding to a set of maximum deviation algorithm parameters;
[0155] A first fitness calculation unit, used to calculate the fitness value of each first individual in the first population, and determine the first individual with the smallest fitness value in the first population;
[0156] A genetic algorithm unit is used to perform crossover mutation processing on the first population through multiple rounds of iterations based on a genetic algorithm, re-determine the first individual with the smallest fitness value in each round of iteration, and after reaching a preset number of iterations, use the first individual with the smallest fitness value determined in the last iteration as the optimal first individual, and use the optimal first individual as the optimal maximum deviation algorithm parameter.
[0157] Optionally, the construction unit includes:
[0158] A creation subunit is used to create a first matrix, wherein a row of elements in the first matrix represents a first entity;
[0159] a chaos processing subunit, configured to perform chaos processing on the first matrix by randomly assigning random numbers within a preset range to elements in the first matrix;
[0160] The correction subunit is used to correct the values of the elements in the first matrix after chaos processing according to the standard value range of the parameters required by the maximum deviation algorithm, and use the corrected first matrix as the first population.
[0161] Optionally, the maximum deviation algorithm parameters include: one or more of maximum deviation distance, similarity, deviation, and number of categories.
[0162] Optionally, the fitness calculation unit includes:
[0163] A cluster center subunit, for randomly selecting target samples of the category quantity from the training set for each first individual, and using the target samples as first cluster centers;
[0164] a matching subunit, configured to calculate the distance between each sample in the training set and the first cluster center according to the maximum deviation algorithm parameter of the first individual representation, add the samples whose distance meets the maximum deviation similarity criterion to the first cluster cluster of the first cluster center, and obtain the first cluster clusters of the number of categories;
[0165] The fitness subunit is used to use the accumulated value of the distance between each sample in the first cluster and the first cluster center as the fitness value of the first cluster, and to use the accumulated value of the fitness values of the first clusters of the number of categories as the fitness value of the first individual.
[0166] Optionally, the training module 304 includes:
[0167] An initialization submodule is used to initialize the parameters of the genetic algorithm, the parameters of the Q learning algorithm and the model parameters of the neural network model;
[0168] An establishment submodule is used to establish a second population according to the model parameters of the neural network model, wherein the second population includes a plurality of second individuals, each second individual corresponding to a set of model parameters of the neural network model;
[0169] A selection submodule is used to select the best second individual from the second population according to the Q learning algorithm and the genetic algorithm, and to set the neural network model using the model parameters represented by the best second individual to complete the model parameter optimization of the neural network model.
[0170] Optionally, the selection submodule includes:
[0171] A new population unit is used to process the second population by using a Q learning algorithm and a genetic algorithm to obtain a third population;
[0172] a second fitness calculation unit, used to calculate the fitness value of the second individual in the second population and the fitness value of the third individual in the third population;
[0173] a replacement unit, configured to retain the second individual with a smaller fitness value in the second population by comparing the second population with the third population, and replace the second individual with a larger fitness value in the second population with a corresponding third individual with a smaller fitness value in the third population, so as to obtain a target second population;
[0174] The optimal individual unit is used to select the second individual with the smallest fitness value in the target second population as the optimal second individual.
[0175] Optionally, the new population unit includes:
[0176] an individual selection subunit, configured to process each second individual in the second population using n preset parameter selection strategies, so as to obtain n new second individuals corresponding to each second individual;
[0177] A crossover mutation subunit, used for performing crossover mutation processing on the n new second individuals according to the genetic algorithm to obtain n target second individuals;
[0178] The Q value screening subunit is used to calculate the Q value of each target second individual according to the Q learning algorithm, and take the target second individual with the largest Q value as the corresponding third individual in the third population to obtain the third population.
[0179] In summary, the embodiment of the present invention utilizes a clustering algorithm to first cluster the training set to obtain multiple cluster clusters, and then determines the cluster cluster to which the prediction set data belongs based on the similarity between the prediction set data and the data in the cluster clusters, and uses the cluster clusters that are highly close to the prediction set data as training data, and screens out the remaining data in the clustering results, thereby effectively screening out a small amount of accurate training data from the training set, and excluding the remaining interference data based on similarity analysis, so that the amount of calculation in the subsequent model training process is greatly reduced, and the training accuracy is improved. In addition, the embodiment of the present invention optimizes the model parameters through the Q learning algorithm and the genetic algorithm. The optimized model parameters can allow the neural network to converge quickly, find the optimal point, and avoid the neural network model from falling into the local optimum, thereby improving the accuracy of the algorithm and reducing the calculation time of the neural network, thereby achieving the effect of improving the accuracy and efficiency of the prediction.
[0180] The present invention also provides an electronic device, see Figure 4 , including: a processor 901, a memory 902, and a computer program 9021 stored in the memory and executable on the processor, wherein when the processor executes the program, the method for predicting bandwidth used in graphic coding of the aforementioned embodiment is implemented.
[0181] The present invention also provides a readable storage medium. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method for predicting bandwidth usage of graphic coding in the aforementioned embodiment.
[0182] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0183] It should be noted that the various information and data obtained in the embodiments of the present invention are all obtained with the authorization of the information / data holder.
[0184] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming voice. It should be understood that various programming voices can be utilized to realize the content of the present invention described herein, and the description of the above specific voices is for the purpose of disclosing the best mode of the present invention.
[0185] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0186] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0187] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0188] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0189] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0190] The user information (including but not limited to the user's device information, user personal information, etc.) and related data involved in the present invention are all information authorized by the user or by all parties.
[0191] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0192] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0193] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for predicting bandwidth usage of graphics coding, characterized in that: The method comprises: Acquire a historical bandwidth usage data set for graphic coding, wherein the historical bandwidth usage data set includes a training set and a prediction set; Clustering the training set according to a preset clustering algorithm to obtain multiple clusters; Determine a target cluster from all clusters, and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion; Optimizing the model parameters of the neural network model by using a Q learning algorithm and a genetic algorithm, and training the neural network model with the optimized model parameters by using the training data to obtain a target neural network model; Inputting the samples in the prediction set into a target neural network model to obtain a prediction result of a bandwidth used for the graphics coding; The step of clustering the training set according to a preset clustering algorithm to obtain a plurality of clusters includes: Determine the optimal maximum deviation algorithm parameters according to the required parameters of the maximum deviation algorithm and the genetic algorithm; Clustering the training set using the optimal maximum deviation algorithm parameters to obtain multiple clusters; The step of determining the optimal maximum deviation algorithm parameters according to the parameters required by the maximum deviation algorithm and the genetic algorithm includes: According to the parameters required by the maximum deviation algorithm, a first population is established, wherein the first population includes a plurality of first individuals, and each first individual corresponds to a set of maximum deviation algorithm parameters; Calculating the fitness value of each first individual in the first population, and determining the first individual with the smallest fitness value in the first population; Based on the genetic algorithm, the first population is subjected to crossover mutation processing through multiple rounds of iterations, and the first individual with the smallest fitness value is re-determined in each round of iteration. After reaching a preset number of iterations, the first individual with the smallest fitness value determined in the last iteration is used as the optimal first individual, and the optimal first individual is used as the optimal maximum deviation algorithm parameter; The step of establishing a first population according to the parameters required by the maximum deviation algorithm comprises: Create a first matrix, wherein a row of elements in the first matrix represents a first entity; Performing chaos processing on the first matrix by randomly assigning random numbers within a preset range to elements in the first matrix; According to the standard value range of the parameters required by the maximum deviation algorithm, the values of the elements in the first matrix after the chaos processing are corrected, and the corrected first matrix is used as the first population.
2. The method according to claim 1, characterized in that The maximum deviation algorithm parameters include: one or more of maximum deviation distance, similarity, deviation, and number of categories.
3. The method according to claim 2, characterized in that The calculating the fitness value of each first individual in the first population includes: For each first individual, randomly select the target samples of the category quantity from the training set, and use the target samples as the first clustering centers; According to the maximum deviation algorithm parameters of the first individual representation, the distance between each sample in the training set and the first cluster center is calculated, and the samples whose distance meets the maximum deviation similarity criterion are added to the first cluster cluster of the first cluster center to obtain the first cluster clusters of the number of categories; The accumulated value of the distance between each sample in the first cluster and the first cluster center is used as the fitness value of the first cluster, and the accumulated value of the fitness values of the first clusters of the number of categories is used as the fitness value of the first individual.
4. The method according to claim 1, characterized in that: The method of optimizing the model parameters of the neural network model by using the Q learning algorithm and the genetic algorithm includes: Initialize the parameters of the genetic algorithm, the parameters of the Q learning algorithm and the model parameters of the neural network model; According to the model parameters of the neural network model, a second population is established, wherein the second population includes a plurality of second individuals, and each second individual corresponds to a set of model parameters of the neural network model; According to the Q learning algorithm and the genetic algorithm, the best second individual is selected from the second population, and the neural network model is set using the model parameters represented by the best second individual to complete the model parameter optimization of the neural network model.
5. The method according to claim 4, characterized in that The step of selecting the optimal second individual from the second population according to the Q learning algorithm and the genetic algorithm comprises: Processing the second population using a Q learning algorithm and a genetic algorithm to obtain a third population; Calculating the fitness value of the second individual in the second population and the fitness value of the third individual in the third population; By comparing the second population and the third population, retaining the second individual with a smaller fitness value in the second population, and replacing the second individual with a larger fitness value in the second population with a corresponding third individual with a smaller fitness value in the third population, a target second population is obtained; The second individual with the smallest fitness value in the target second population is selected as the optimal second individual.
6. The method according to claim 5, characterized in that The method of processing the second population by using a Q learning algorithm and a genetic algorithm to obtain a third population includes: Using n preset parameter selection strategies, processing each second individual in the second population, so as to obtain n new second individuals corresponding to each second individual; According to the genetic algorithm, crossover mutation is performed on the n new second individuals to obtain n target second individuals; According to the Q learning algorithm, the Q value of each target second individual is calculated, and the target second individual with the largest Q value is used as the corresponding third individual in the third population to obtain the third population.
7. A device for predicting bandwidth usage of graphics coding, characterized in that: The device comprises: An acquisition module, used to acquire a historical bandwidth usage data set for graphic coding, wherein the historical bandwidth usage data set includes a training set and a prediction set; A clustering module, used to cluster the training set according to a preset clustering algorithm to obtain multiple clusters; A screening module is used to determine a target cluster from all clusters and use samples in the target cluster as training data; the target cluster is a cluster whose distance between the cluster center and the samples of the prediction set meets the maximum deviation similarity criterion; A training module, used to optimize the model parameters of the neural network model using a Q learning algorithm and a genetic algorithm, and to train the neural network model with the optimized model parameters using the training data to obtain a target neural network model; A prediction module, used for inputting samples in the prediction set into a target neural network model to obtain a prediction result for a bandwidth used for the graphic coding; The clustering module comprises: The optimal parameter submodule is used to determine the optimal maximum deviation algorithm parameters according to the parameters required by the maximum deviation algorithm and the genetic algorithm; A clustering submodule, used to cluster the training set using the optimal maximum deviation algorithm parameters to obtain multiple clusters; The optimal parameter submodule includes: A construction unit, configured to establish a first population according to the parameters required by the maximum deviation algorithm, wherein the first population includes a plurality of first individuals, each first individual corresponding to a set of maximum deviation algorithm parameters; A first fitness calculation unit, used to calculate the fitness value of each first individual in the first population, and determine the first individual with the smallest fitness value in the first population; A genetic algorithm unit, configured to perform crossover mutation processing on the first population through multiple rounds of iterations based on a genetic algorithm, re-determine the first individual with the smallest fitness value in each round of iteration, and after reaching a preset number of iterations, use the first individual with the smallest fitness value determined in the last iteration as the optimal first individual, and use the optimal first individual as the optimal maximum deviation algorithm parameter; The construction unit comprises: A creation subunit is used to create a first matrix, wherein a row of elements in the first matrix represents a first entity; a chaos processing subunit, configured to perform chaos processing on the first matrix by randomly assigning random numbers within a preset range to elements in the first matrix; The correction subunit is used to correct the values of the elements in the first matrix after chaos processing according to the standard value range of the parameters required by the maximum deviation algorithm, and use the corrected first matrix as the first population.
8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program.
9. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the methods described in claims 1-6.
Citation Information
Patent Citations
Computing method for short-term power load forecasting
CN110071502A
Method, device and program for determining for re-learning with respect to input value in neural network model
WO2018092957A1