Hyperparameter determination method, device, deep reinforcement learning framework, medium and equipment
By generating interactive samples and discretized hyperspace, the value combination of hyperparameter combinations is determined, which solves the problem of hyperparameter settings relying on human experience, improves the convergence efficiency and training efficiency of the model, and ensures the matching between the model and the application scenario.
Patent Information
- Application Number
- CN202110351935.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-31
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-03-31
AI Technical Summary
In the existing technology, the setting of hyperparameters relies on human experience, resulting in the model being unable to converge or the convergence speed being too slow, and each hyperparameter is prone to falling into a saddle point when optimizing, affecting model training efficiency.
By obtaining the sampling value combination of the target hyperparameter combination, generate interactive samples, update the state value in the multiple parameter determination model, discretize the hyperspace, determine the candidate space, and finally determine the value combination of the target hyperparameter combination to ensure super The accuracy of parameter settings and the optimized characteristic parameters of the model.
It achieves accurate setting of hyperparameters, avoids the limitations of human experience, improves the convergence efficiency of the model, reduces the number of iterations, ensures the matching between the model and the application scenario, and avoids saddle point problems.
Smart Images

Figure CN113052253B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular, to a method and apparatus for determining hyperparameters, a deep reinforcement learning framework, a medium, and a device. Background Art
[0002] With the development of random computer technology, various large models and complex machine learning models have gradually begun to be applied. A large number of parameters need to be calculated in the model so that the model can meet the needs of users. Some parameters in the model can be optimized through model training, such as the weights in the neural network model, while some parameters cannot be optimized through model training. These parameters are the hyperparameters of the model, such as the number of hidden layers in the neural network. Hyperparameters are used to adjust the training process of the model. They are usually set by staff based on experience. Hyperparameters do not directly participate in the training process of the model and will not be updated during the training process of the model. The setting of hyperparameters has a great impact on the number of iterations and convergence efficiency of model training. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a method for determining a hyperparameter, the method comprising:
[0005] Obtaining, under a sampling value combination corresponding to a target hyperparameter combination of a target model, a sampling sample corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters;
[0006] Generate an interactive sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interactive sample includes the sampling value combination and the optimized feature parameters corresponding to the target model;
[0007] For each parameter determination model among multiple parameter determination models used to determine the target hyperparameter combination, the state value corresponding to the target hyperparameter combination in the parameter determination model is updated according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into multiple value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into multiple value spaces, and the multiple value spaces corresponding to multiple parameter determination models are divided in the same way;
[0008] For each of the parameter determination models, determining a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model;
[0009] Determine the target space according to the candidate space determined by the model according to each of the parameters;
[0010] The target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0011] In a second aspect, a hyperparameter determination device is provided, the device comprising:
[0012] A first acquisition module is used to acquire, under a sampling value combination corresponding to a target hyperparameter combination of a target model, a sampling sample corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters;
[0013] A generating module, configured to generate an interaction sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interaction sample includes the sampling value combination and the optimized feature parameters corresponding to the target model;
[0014] An updating module, for updating, for each parameter determination model in a plurality of parameter determination models for determining the target hyperparameter combination, a state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into a plurality of value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into a plurality of value spaces, and the plurality of value spaces corresponding to the plurality of parameter determination models are divided in the same way;
[0015] A first determination module is used to determine, for each of the parameter determination models, a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model;
[0016] A second determination module is used to determine the target space according to the candidate space determined by each parameter determination model;
[0017] The third determination module is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0018] In a third aspect, a deep reinforcement learning framework is provided, wherein the values of multiple hyperparameters with associated relationships in the deep reinforcement learning framework are determined based on the hyperparameter determination method described in the first aspect.
[0019] According to a fourth aspect, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect are implemented.
[0020] In a fifth aspect, an electronic device is provided, including:
[0021] a storage device having a computer program stored thereon;
[0022] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0023] In the above technical solution, in multiple parameter determination models, for multiple target hyperparameters with associated relationships, the parameter space of each target hyperparameter can be simultaneously represented by the target hyperspace, so that the parameter space of the target hyperparameter under each dimension can be discretized in each dimension, thereby discretizing the target hyperspace into multiple value spaces, so that the candidate space for the target hyperparameter combination to take values in each parameter determination model can be determined based on the sampling samples corresponding to the target model using the target hyperparameter combination and the optimized characteristic parameters of the target model, so that the target value combination corresponding to the target hyperparameter combination can be further determined based on multiple parameter determination models. Therefore, through the above technical solution, on the one hand, the values of the hyperparameters of the model can be accurately set to avoid the phenomenon that the target model cannot converge or converges too slowly due to inappropriate hyperparameter setting values due to the limitations of human experience. On the other hand, by uniformly determining the values of multiple hyperparameters with associated relationships, the target space is determined by combining the candidate space determined by the multiple parameter determination model, and then the value corresponding to the target hyperparameter combination is determined, so as to ensure the accuracy of the target hyperparameter value while improving the matching degree between the target value and the actual application scenario of the target model, and avoiding the problem of falling into the saddle point when each hyperparameter is optimized separately. At the same time, the target value combination is determined based on the optimized characteristic parameters of the target model, and the determined target value can make the optimized characteristic parameters of the target model better, thereby effectively improving the training efficiency of the target model, so as to reduce the number of iterations of the target model training to a certain extent and improve the convergence efficiency of the target model.
[0024] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0026] Figure 1 is a flowchart of a method for determining hyperparameters provided in an embodiment of the present disclosure;
[0027] Figure 2 is a schematic diagram of a target hyperspace provided according to an embodiment of the present disclosure;
[0028] Figure 3It is a flowchart of an exemplary implementation method of determining a candidate space from multiple value spaces according to an updated state value corresponding to a target hyperparameter combination in a model according to the parameter determination provided in an embodiment of the present disclosure;
[0029] Figure 4 is a block diagram of a hyperparameter determination device provided according to an embodiment of the present disclosure;
[0030] Figure 5 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0032] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0033] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0034] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0035] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0037] Figure 1 As shown, it is a flowchart of a method for determining a hyperparameter provided in an embodiment of the present disclosure, such as Figure 1 As shown, the method may include:
[0038] In step 11, a sampling sample corresponding to the sampling value combination is obtained under the sampling value combination corresponding to the target hyperparameter combination of the target model, wherein the target hyperparameter combination includes multiple target hyperparameters with a correlation relationship, and the sampling value combination includes sampling values corresponding to each of the target hyperparameters.
[0039] By way of example, the target model can be a deep reinforcement learning model. Among them, the deep reinforcement learning model combines the perception ability of deep learning with the decision-making ability of reinforcement learning. It obtains a high-dimensional observation by interacting with the environment at each moment, and uses deep learning methods to perceive the observation to obtain a specific state feature representation of the observation; then the value function (state value function) of each state and the value function (action value function) of the state-action pair can be evaluated based on the expected return, and the decision strategy is improved based on these two value functions. The decision strategy is used to map the current state to the corresponding decision action; the environment will respond to this decision action and obtain the next observation. By continuously looping the above process, the optimal strategy to achieve the goal is obtained. By way of example, the goal is to maximize the cumulative return.
[0040] For example, taking the deep reinforcement learning model as an example, in the deep reinforcement model, the search space of the strategy π can be represented by two target hyperparameters, and the target hyperparameter combination α can be expressed as: α = (τ1, τ2), then the sampling value combination can respectively include the sampling values of the target hyperparameters τ1 and τ2.
[0041] Therefore, in this application scenario, the sampling sample can be an interaction sequence obtained by sampling during the interaction between the virtual object and the virtual environment, wherein the virtual object is controlled based on the deep reinforcement learning model, and the interaction sequence includes multiple sampling data under the sampling value, each of the sampling data includes the environmental state of the virtual environment, the decision action performed by the virtual object under the environmental state determined by the deep reinforcement learning model, and the reward value corresponding to the decision action.
[0042] The virtual environment may be a virtual scene environment generated by a computer, such as a game scene. For example, multimedia data for interacting with a user is rendered, so that the multimedia data can be rendered and displayed as a game scene. The virtual environment provides a multimedia virtual world. Users can control the actions of virtual objects through controls on the operation interface, or directly control the operable virtual objects in the virtual environment, and observe objects, characters, scenery, etc. in the virtual environment from the perspective of the virtual objects, and interact with other virtual objects in the virtual environment through virtual objects. As another example, the virtual environment may also include other virtual objects in the scene. A virtual object may be a virtual image used to simulate a user in a virtual environment, which may be a human image or other animal image.
[0043] The application scenario may be a scenario in which a virtual object perceives its environment and performs actions based on the perceived environmental information. The application scenario may include a virtual object and multiple environmental objects contained in the environment in which the virtual object is located. In this scenario, the virtual object may fuse the environmental information of the environment in which the virtual object is located, and input the fused environmental information into the target model to obtain the target action to be performed by the virtual object. The virtual object may be any intelligent entity that can interact with the environment and perform actions based on the environmental information of the environment in which it is located.
[0044] For example, the virtual object is a gaming artificial intelligence (game AI), the deep reinforcement learning model is used to train the gaming artificial intelligence, the sampling samples are interaction sequences obtained by sampling the gaming artificial intelligence in a game of a target game, and the virtual environment is the training environment of the gaming artificial intelligence in the target game.
[0045] As an example, if the target game is a shooting game, the virtual object can be the game battle AI, and the corresponding decision-making action can be to control the game battle AI character to attack, move, and stop, etc. As another example, if the target game is a driving game, the virtual object can be the game vehicle AI that performs automatic driving, and the corresponding decision-making action can be to control the vehicle to turn, go straight, and brake, etc. As another example, if the target game is an assembly game, the virtual object can be a robot AI, and the corresponding decision-making action can be to control the robot AI to move, grab objects to be assembled, and put down objects to be assembled, etc.
[0046] For example, when sampling the interaction sequence obtained by the game artificial intelligence in the game of the target game, the game artificial intelligence can perceive the environment in which the game artificial intelligence is located to obtain the multimodal environmental state of the training environment in which the game artificial intelligence is located. Among them, the environmental state may include an environmental image, and the object information of each environmental object in the environmental image, and the object information includes the specific parameters corresponding to the environmental object. For example, when the virtual object is a game battle AI in a shooting game, the virtual environment can be the training environment in which the game battle AI is located in the shooting game, then the environmental image can be the game map where the game battle AI is located, and the environmental object can be the enemy unit, road and building in the game map, etc., and the object information can include the numerical parameters (for example: blood volume, attack power, skills), name and location of the enemy unit. When the virtual object is a game vehicle AI in a driving game, the virtual environment can be the training environment in which the game vehicle AI is located in the driving game, then the environmental image can be the image taken around the vehicle, and the environmental object can be other vehicles, obstacles and roads around the vehicle, etc., and the object information can include information such as the speed, driving direction and size of other vehicles. When the virtual object is a robot AI in an assembly game, the virtual environment can be the training environment of the robot AI in the assembly game, the environmental image can be a captured image of the area where the object to be assembled is located, the environmental object can be the object to be assembled, and the object information can include information such as the size, shape, and position of the object to be assembled. Then, the object information of each environmental object can be preprocessed to obtain an object feature vector of each environmental object. For example, the object information of each environmental object can be input into a pre-trained deep learning network to convert the object information of each environmental object into the object feature vector of the environmental object.
[0047] As an example, the virtual object can perform a decision action in the first state of the virtual environment. After the virtual image performs the decision action, the virtual environment can respond to the decision action, thereby obtaining the second state of the virtual environment and the reward value corresponding to the execution of the decision action. When sampling is performed during the interaction between the virtual object and the virtual environment, the first state, the decision action, the second state and the reward value can be used as the sampling data corresponding to the sampling moment. If not otherwise specified, the environment state in the sampling data described in the embodiment of the present disclosure is the first state in the sampling data. In a complete interaction process, the sampling data in the order of the sampling time forms an interaction sequence. For example, the target model can be a deep reinforcement learning model, the target game is a maze game, the virtual object is for the game AI, and the virtual environment can be a virtual maze environment. Virtual rewards may appear in random positions in the virtual maze scene. The deep reinforcement learning model can be trained to determine the strategy of the game AI from the virtual maze entrance E1 to the exit E2, so that the game AI obtains the most virtual rewards in the process from the entrance E1 to the exit E2. For example, sampling is performed at the entrance E1 at the initial moment. The corresponding action of the game AI in the first state of the virtual maze environment at the initial moment is to go straight or turn right. The corresponding decision action in the state of the initial moment can be determined according to the strategy. For example, the decision action is to go straight. The environment reacts based on the decision action to obtain a reward value and a second state, and a sampling data is obtained by sampling. Sampling is performed at the next moment to obtain the first state of the game AI in the virtual maze environment at the next moment. The corresponding action in the first state is to go straight or turn right. The corresponding decision action in the first state of the next moment can be determined according to the strategy. For example, the decision action is to turn right. Similarly, the environment reacts based on the decision action to obtain a reward value and a second state, and the next sampling data is obtained. In the process of the game AI moving to the exit E2, sampling in the above manner can obtain an interactive sequence containing multiple sampling data.
[0048] When sampling, an image of the virtual environment corresponding to the sampling moment can be obtained, so that features can be extracted from the image to obtain the first state. The reward value can be a change in the score value corresponding to the virtual object after the decision action is executed, or a change in the virtual life bar, etc. It can be set according to the actual usage scenario, and the present disclosure does not limit this.
[0049] In step 12, an interaction sample corresponding to the target hyperparameter combination is generated according to the sampling sample, wherein the interaction sample includes the sampling value combination and the optimization feature parameters corresponding to the target model.
[0050] The optimization feature parameter may be the cumulative reward corresponding to the interaction sequence. As an example, the cumulative reward may be the sum of the reward values corresponding to each decision action included in the interaction sequence. As another example, the decision action farther away from the current decision action has a smaller impact on the current decision action. The cumulative reward may be the cumulative sum of the product of the reward value of each decision action in the interaction sequence and the attenuation coefficient corresponding to the decision action, wherein the attenuation coefficient corresponding to the decision action decreases in the order of the decision actions from the first to the last, for example:
[0051] G t =R t+1 +γR t+2 +γ 2 R t+3 +…+γ n-1 R t+n
[0052] =R t+1 +γ(R t+2 +γR t+3 +…+γ n-2 R t+n )
[0053] =R t+1 +γG t+1
[0054] Among them, R i It is used to represent the reward value of the decision action at time i, γ is used to represent the attenuation coefficient, and n can be used to represent the number of sampled data from time t to the end of the interaction in the interaction sequence.
[0055] Therefore, in another embodiment, starting from the last decision action in the interaction sequence, its reward value can be multiplied by the decay value and added to the reward value of the previous decision action, until it is added to the reward value of the first decision action in the interaction sequence to obtain the cumulative reward. The decay value can be set according to the actual usage scenario.
[0056] In step 13, for each parameter determination model among the multiple parameter determination models used to determine the target hyperparameter combination, the state value corresponding to the target hyperparameter combination in the parameter determination model is updated according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into multiple value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into multiple value spaces, and the multiple value spaces corresponding to the multiple parameter determination models are divided the same.
[0057] Continuing with the above example, the target hyperparameter combination contains two target hyperparameters, τ1 and τ2. Then the target hyperspace corresponding to the target hyperparameter combination is a two-dimensional space, such as Figure 2 As shown, the X-axis dimension corresponds to the target hyperparameter τ1, and the Y-axis dimension corresponds to the target hyperparameter τ2. The parameter spaces corresponding to the target hyperparameters τ1 and τ2 can be discretized in their corresponding dimensions, wherein the intervals for discretization in different dimensions can be the same or different, and users can set them based on actual usage scenarios, which is not limited in the present disclosure.
[0058] like Figure 2 As shown, the parameter space of the target hyperparameter τ1 is discretized with discrete intervals H1 in the X-axis dimension, and the parameter space of the target hyperparameter τ2 is discretized with discrete intervals H2 in the Y-axis dimension. Then the target hyperspace is discretized as Figure 2 The 12 value spaces (C00-C23) shown in FIG. 1 and 1 are shown in FIG. 2. The state value corresponding to the target hyperparameter combination can be represented by a vector, that is, the state value corresponding to each of the 12 value spaces is a dimension value in the vector.
[0059] In this embodiment, multiple parameter determination models can be used to determine the value of each target hyperparameter in the target hyperparameter combination. For example, 5 parameter determination models can be randomly initialized, and the learning rates of the 5 parameter determination models can be pre-set. In the present disclosure, the learning rate of each parameter determination model is different. When different parameter determination models are learned based on the same interaction sample, their respective parameters can be adjusted under multiple learning step sizes, so that each parameter determination model can perform personalized learning, increase the diversity of the multiple parameter determination models when determining the corresponding values of the target hyperparameter combination based on each parameter determination model, thereby ensuring that the multiple parameter determination models consider the comprehensiveness of the features when determining the target value combination, and improve the accuracy of the target value combination.
[0060] Among them, in this field, when the model is known, the expected cumulative return brought by any strategy π can be estimated. The state value function is usually used to evaluate the value of a certain state. The value of a certain state can be expressed by the value of all actions in this state, that is, the expectation of the cumulative return that can be obtained based on the state s. Under this strategy, the cumulative return obeys a distribution, and the expected value of the cumulative return at the state is defined as the state value function V(s):
[0061] V π (s) = E π [G t |S t =s]
[0062] V π(s) means the state S at time t under strategy π t When the value is s, the cumulative return G t The expected value at s. In this embodiment, the state value function can be used to evaluate the state value of all value spaces of state s. The method for determining the cumulative reward has been described in detail above and will not be repeated here.
[0063] In the deep reinforcement learning model, the calculation of the state value function can be realized by a neural network. Therefore, the environmental state in the sampled data can be input into the state value function network, so as to obtain the output value of the state value function network, that is, the state value corresponding to the state value function and the environmental state.
[0064] As an example, for each parameter model, the parameter space of each target hyperparameter in the corresponding target hyperparameter combination is discretized into multiple value intervals, so that the target hyperspace corresponding to the target hyperparameter combination is discretized into multiple value spaces, and the state value corresponding to the target hyperparameter combination can be used to characterize the cumulative return brought by further selecting each target hyperparameter value in the target hyperparameter combination from each value space based on the strategy when the value of the target hyperparameter in the target hyperparameter combination is the corresponding sampling value in the sampling value combination. For example, in the present disclosure, the state value corresponding to the target hyperparameter combination can be determined by iterative updating, that is, the state value corresponding to the target hyperparameter combination is iteratively updated according to the sampling value combination corresponding to the interaction sample.
[0065] As an example, when discretizing the parameter space under each dimension in the target hyperspace, for each dimension, the number of value intervals corresponding to the parameter space can be predetermined, and then the parameter space of the target hyperparameter can be evenly divided to obtain multiple value intervals. For example, if the parameter space of the target hyperparameter is [0,9], and the parameter space is divided into 9 value intervals, then the value range corresponding to the value interval A1 is [0,1), the value range corresponding to the value interval A2 is [1,2), and the value ranges corresponding to other value intervals are similar, and will not be repeated here.
[0066] In step 14, a model is determined for each parameter, and an updated state value corresponding to a target hyperparameter combination in the model is determined based on the parameter, and a candidate space is determined from multiple value spaces.
[0067] As described above, if the learning rate of each parameter determination model is different, the state value corresponding to the target hyperparameter combination determined in each parameter determination model is generally different. Therefore, in the disclosed embodiment, for each parameter determination model, it can determine the value space for taking values in the parameter determination model, i.e., the candidate space, according to the updated state value corresponding to the target hyperparameter combination in the respective model.
[0068] In this step, for each parameter determination model, the cumulative return of the target hyperparameter combination from each value space can be accurately evaluated by determining the state value corresponding to the target hyperparameter combination based on the sampling samples of the target model. Therefore, the candidate space for determining the value of the target hyperparameter combination can be selected based on the evaluation results to ensure the accuracy of the target hyperparameter combination value and the consistency of the target hyperparameter combination value with the actual application process of the target model.
[0069] In step 15, the target space is determined based on the candidate space determined by the model according to each parameter, so as to improve the accuracy and credibility of the target space.
[0070] In step 16, the target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0071] As an embodiment, uniformly distributed sampling may be performed within the value range corresponding to the target space, and the value corresponding to the sampled point in each dimension is determined as the target value of the target hyperparameter corresponding to the dimension. Figure 2 As shown, the determined target space is C13, and the sampling point obtained by sampling from the target space is P1. The value Px corresponding to P1 in the X-axis dimension can be determined as the target value of the target hyperparameter τ1, and the value Py corresponding to P1 in the Y-axis dimension can be determined as the target value of the target hyperparameter τ2 to obtain the target value combination.
[0072] Therefore, in the above technical solution, in multiple parameter determination models, for multiple target hyperparameters with associated relationships, the parameter space of each target hyperparameter can be simultaneously represented by the target hyperspace, so that the parameter space of the target hyperparameter under each dimension can be discretized in each dimension, thereby discretizing the target hyperspace into multiple value spaces, so that the candidate space for the target hyperparameter combination to take values in each parameter determination model can be determined based on the sampling samples corresponding to the target model using the target hyperparameter combination and the optimized characteristic parameters of the target model, so that the target value combination corresponding to the target hyperparameter combination can be further determined based on multiple parameter determination models. Therefore, through the above technical solution, on the one hand, the values of the hyperparameters of the model can be accurately set to avoid the phenomenon that the target model cannot converge or converges too slowly due to inappropriate hyperparameter setting values due to the limitations of human experience. On the other hand, by uniformly determining the values of multiple hyperparameters with associated relationships, the target space is determined by combining the candidate space determined by the multiple parameter determination model, and then the value corresponding to the target hyperparameter combination is determined, so as to ensure the accuracy of the target hyperparameter value while improving the matching degree between the target value and the actual application scenario of the target model, and avoiding the problem of falling into the saddle point when each hyperparameter is optimized separately. At the same time, the target value combination is determined based on the optimized characteristic parameters of the target model, and the determined target value can make the optimized characteristic parameters of the target model better, thereby effectively improving the training efficiency of the target model, so as to reduce the number of iterations of the target model training to a certain extent and improve the convergence efficiency of the target model.
[0073] As mentioned above, the virtual environment can be a game environment, and sampling can be performed during the interaction between the virtual object and the virtual environment to obtain interaction data. During the training process of the deep reinforcement learning model, the values of multiple hyperparameters with associated relationships in the deep reinforcement learning model can be determined based on the above method, so that the deep reinforcement learning model can obtain greater rewards when determining the decision-making actions of the virtual object, ensure the accuracy of the decision-making actions of the virtual object, improve the accuracy of the control of the virtual object, and at the same time reduce the amount of data and manpower required in the training process.
[0074] In a possible embodiment, the method may further include:
[0075] The target value combination is used as a new sampling value combination corresponding to the target hyperparameter combination, and the steps of obtaining sampling samples corresponding to the sampling value combination under the sampling value combination corresponding to the target hyperparameter combination of the target model and determining the target value combination corresponding to the target hyperparameter combination according to the target space are re-executed until the training of the target model is completed.
[0076] Among them, the sampled value combination corresponding to the target hyperparameter combination can be initially obtained based on randomly initialized model sampling. In this embodiment, a parameter determination model can be selected from multiple initialization parameter determination models to determine the sampled value,
[0077] After determining the target value combination corresponding to the target hyperparameter combination, the value of the corresponding target hyperparameter in the target model can be updated to its corresponding target value, so that steps 11 to 16 can be re-executed to further determine whether the target value combination is accurate for the interaction samples of the target hyperparameter combination of the target model under the target value combination, so that dynamic adjustment of the values corresponding to the target hyperparameter combination can be achieved, and the optimization feature parameters corresponding to the target model can also be optimized. While further improving the accuracy of the values corresponding to the target hyperparameter combination, the convergence and accuracy of the target model are guaranteed, the training efficiency of the target model is improved, and at the same time, there is no need to manually set the values of the hyperparameters of the target model, thereby reducing manual workload.
[0078] In a possible embodiment, for each parameter determination model among a plurality of parameter determination models used to determine the target hyperparameter combination, an exemplary implementation method of updating the state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample is as follows, and this step may include:
[0079] For each parameter determination model, in the parameter determination model, according to the sampling value combination, a value space to which the sampling value combination belongs is determined as the value space to be updated.
[0080] For example, for example, according to each sampled value in the sampled value combination, the identifier of the sampled value in the dimension corresponding to the sampled value can be determined respectively. For example, the value interval to which the sampled value belongs can be determined based on the range length corresponding to the value interval of the sampled value. The subscript i of the value interval to which the sampled value belongs can be determined by the following formula:
[0081] i=(min(max(x,l),r)-l) / / acc
[0082] Among them, x is used to represent the sampling value; l is used to represent the left boundary of the parameter space; r is used to represent the right boundary of the parameter space; / / is used to represent the integer division symbol; acc is used to represent the range length of the value interval.
[0083] Therefore, when the subscript of the sampling interval corresponding to each sampling value is determined based on the above method, the value space to be updated is determined based on the dimension of each sampling value. For example, the subscript determined by the X-axis dimension is 2, and the subscript determined by the Y-axis dimension is 1, then the value space to which the sampling value combination belongs is C21.
[0084] Afterwards, the state value of the value space to be updated is updated according to the optimized feature parameters.
[0085] In this embodiment, the value space to be updated corresponding to the sampled value can be determined through the relationship between the sampled value and the parameter space, so that the state value of the value space to be updated can be updated. For other value spaces except the value space to be updated, the corresponding state values do not need to be updated, thereby ensuring the accuracy of the state value corresponding to the target hyperparameter combination and providing data support for the subsequent accurate selection of the target space.
[0086] In a possible embodiment, the value space to which the sample value combination belongs is determined as the value space to be updated, and the state value of the value space to be updated can be updated according to the optimized characteristic parameters by the following formula, which is as follows:
[0087]
[0088] Wherein, T is used to represent the optimization characteristic parameter. If the optimization characteristic parameter is the cumulative return, that is, the cumulative return is optimized in the direction of increasing during optimization, then T can be G t , if the optimized characteristic parameter is the error rate error of the target model, that is, the error rate is optimized in the direction of reduction during optimization, then T can be -error; K(s) is used to represent the number of hits in the value space s to be updated, that is, the number of times the value of the target hyperparameter combination corresponding to the sampling sample belongs to the value space s to be updated, V(s) is used to represent the current state value of the value space s to be updated, and V'(s) is used to represent the updated state value of the value space s to be updated.
[0089] For example, the state value of the value space to be updated can be updated according to the optimized feature parameters through the following formula:
[0090] V'(s)=V(s)+lr k *(TV(s))
[0091] Among them, lr k Used to represent the learning rate for updating the state value in the k-th parameter determination model.
[0092] Therefore, through the above technical solution, the state value corresponding to the target hyperparameter space can be updated based on the interaction samples, so that the state value corresponds to the actual optimized feature parameters in the target model, thereby ensuring the accuracy of the target value combination determined subsequently and optimizing the training efficiency of the target model.
[0093] Among them, in order to improve the efficiency of determining the hyperparameter values, when the number of the interaction samples reaches a preset threshold, for each parameter determination model in the multiple parameter determination models used to determine the target hyperparameter combination, a step of updating the state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction samples is executed, wherein each interaction sample corresponds to the value of the target hyperparameter combination in different value spaces, that is, the state value corresponding to the target hyperparameter combination can be updated based on multiple interaction samples at the same time, and the updating method based on each interaction sample is the same as described above, and will not be repeated here.
[0094] In this embodiment, after the state value corresponding to the target hyperparameter combination is updated, the score corresponding to each value space can be recalculated, thereby ensuring the accuracy of the score of each value space and providing accurate data support for the subsequent determination of the target space.
[0095] In a possible embodiment, in step 14, the updated state value corresponding to the target hyperparameter combination in the model is determined according to the parameter, and an exemplary implementation method of determining the candidate space from multiple value spaces is as follows: Figure 3 As shown, this step may include:
[0096] In step 31, in the parameter determination model, the target score of each value space is determined according to the updated state value corresponding to the target hyperparameter combination, wherein the target score is used to characterize the reliability of selecting the value space.
[0097] In a possible embodiment, an exemplary implementation method of determining the target score of each value space according to the updated state value corresponding to the target hyperparameter combination is as follows, and this step may include:
[0098] In the updated state value corresponding to the target hyperparameter combination, for each value space, the state value of the value space is normalized and the result obtained is determined as the value score of the value space.
[0099] For example, the value score S of the i-th value space can be determined by the following formula: i :
[0100]
[0101] Among them, Vi ' is used to represent the latest state value corresponding to the current value space, μ(V') and σ(V') respectively represent the mean and standard deviation of the state value of each value space after the update, that is, the value score of each value space can be normalized by the above formula.
[0102] Afterwards, for each of the value spaces, a target score of the value space is determined according to the value score of the value space and the number of hits in the value space.
[0103] For example, the target score Score of the i-th value space can be determined by the following formula: i :
[0104]
[0105] Among them, c is a preset constant used to adjust the impact of the number of hits on the target score, Mi is the number of hits in value space i, and j is used to represent the subscript of each value space.
[0106] Among them, as described above, in the disclosed embodiment, the state value of the value space can be determined by the iterative update method, and the state value of each value space is initially 0. For each value space, after the value space to be updated is determined according to the sampled value combination of the target hyperparameter combination, the state value of the corresponding value space to be updated will be updated, and the state values of other value spaces except the value space to be updated will remain unchanged. Therefore, in this embodiment, in order to improve the diversity of target space selection in the initial training process, the number of hits of the value space needs to be considered when determining the score of the value space, so as to reduce the influence of the historical hit values on the selection of the target space. From the above, it can be seen that in this process, as the number of interaction samples increases, the state value corresponding to the target hyperparameter combination becomes more accurate, and as the number of hits increases, the influence of the number of hits on the target score gradually decreases, thereby improving the diversity of candidate space selection and exploration space in the initial learning stage, and to a certain extent improving the accuracy of the determined target value combination, avoiding the excessive influence of random sample target space determination in the initial state, and when the state value is accurate, reducing the influence of the number of hits on the target space selection, so as to ensure that the target space selection has a positive optimization adjustment on the optimization feature parameters.
[0107] Transfer back Figure 3 In step 32, a candidate space is determined from a plurality of value spaces according to the target score of each value space.
[0108] In a first possible embodiment, the step of determining a candidate space from a plurality of value spaces according to a target score of each value space may include:
[0109] A preset number of value spaces are selected as the candidate spaces in descending order of the target scores, wherein the preset number can be set according to the actual usage scenario, and the present disclosure does not limit this.
[0110] As an example, if the preset number is 1, the value space with the largest target score can be directly selected as the candidate space; as another example, if the preset number is 2, the candidate space can be determined by sorting the first 2 value spaces in descending order of the target scores. Each parameter model determines the candidate space in the same way. In this way, the validity of the candidate space determined by each parameter model can be effectively guaranteed, providing data support for the subsequent determination of the accurate target space, thereby improving the effective adjustment of the target value combination determined from the target space to the target model optimization, and improving the efficiency of the target model optimization.
[0111] In a second possible embodiment, the step of determining a candidate space from a plurality of value spaces according to a target score of each value space may include:
[0112] Performing softmax processing on the target scores of the multiple value spaces to obtain a probability distribution formed by the probability information of each value space, and sampling the multiple value spaces according to the probability distribution, and determining the value space obtained by the sampling as the candidate space. The number of the samples can be one or more.
[0113] In this embodiment, in order to further improve the diversity of value exploration corresponding to the target hyperparameter combination, the state value of each value space can be mapped based on the softmax function to map it to a numerical value in the range of 0-1 as the probability information of the value space to obtain the probability distribution of the multiple value spaces. When sampling based on the probability distribution, the value space with smaller probability information may also be sampled, so that it can be guaranteed to a certain extent that multiple value spaces have the possibility of being sampled, improve the diversity of candidate spaces, avoid the problem that the target space determined later is the parameter that makes the feature optimization parameter at the local optimal level, avoid the training of the target model reaching the local optimal level and stopping the training, and ensure the accuracy and robustness of the target model training.
[0114] In a possible embodiment, some parameter determination models among the multiple parameter determination models can use the first embodiment described above to determine the candidate space, and the remaining parameter determination models among the multiple parameter determination models can use the second embodiment described above to determine the candidate space, so that the corresponding candidate space can be determined from multiple features, further improving the accuracy of the subsequent target space.
[0115] In a possible embodiment, in step 15, an exemplary implementation of determining the target space according to the candidate space determined by the model according to each parameter is as follows. This step may include:
[0116] For each of the candidate spaces, the number of parameter determination models that determine the candidate space is obtained.
[0117] The candidate space with the largest number is determined as the target space.
[0118] As described above, the value space can be C00-C23, and there are 5 parameter determination models, such as M1-M5. For example, the candidate space determined by M1 is C00 and C01, the candidate space determined by M2 is C00 and C10, the candidate space determined by M3 is C10 and C01, the candidate space determined by M4 is C00 and C01, and the candidate space determined by M5 is C11 and C01. In this embodiment, the number of parameter determination models for determining the candidate space can be obtained respectively. For example, for the candidate space C00, its corresponding parameter determination models are M1, M2 and M4, that is, the number corresponding to the candidate space C00 is 3. For other candidate spaces, sampling is determined in the same way. Afterwards, the candidate space with the largest number of corresponding models can be determined as the target space, that is, the value space determined by the largest number of parameter determination models. As in the above example, the target space is the value space C01.
[0119] Therefore, in the above technical scheme, the target space can be determined based on the candidate space selected by the multiple parameter determination model. On the one hand, the bias of the target space selected by a single model can be avoided. On the other hand, the learning rates of the multiple parameter determination models are different, and the methods of determining the candidate space may be different. Therefore, the diversity of the multiple parameter determination models can be guaranteed, thereby improving the comprehensiveness and diversity of the features considered when determining the target space, ensuring the accuracy of the target space while broadening the exploration space of the values corresponding to the target hyperparameter combination.
[0120] In a possible embodiment, the method may further include:
[0121] When the number of interaction samples reaches a quantity threshold, a new parameter determination model for determining the target hyperparameter combination is obtained. The quantity threshold can be set according to the actual usage scenario, and the present disclosure does not limit this. For example, the new parameter determination model can be a newly initialized parameter determination model, and the model parameters in the new parameter determination model are randomly initialized values.
[0122] Afterwards, the parameter determination model with the longest usage time among the multiple parameter determination models used to determine the target hyperparameter combination is replaced by the new parameter determination model.
[0123] As an example, the initial use time of each parameter determination model can be recorded, and the model with the earliest initial use time can be determined as the parameter determination model with the longest use time. As another example, the identification information of the multiple parameter determination models can be stored in a queue, and the queue can be a FIFO (First Input First Output) queue. When replacing the parameter determination model, the parameter determination model with the identification information at the head of the queue is directly deleted, and the identification information of the new parameter determination model is added to the end of the queue.
[0124] Among them, in this embodiment, when the number of interaction samples reaches the quantity threshold, it means that the multiple parameter determination models have been trained based on the part of the interaction samples, and the parameters of the multiple parameter determination models have been optimized. At this time, when the candidate space is determined based on the multiple parameter determination models, each parameter determination model is greatly affected by the historical interaction samples when determining. Therefore, in the embodiment of the present disclosure, when the historical interaction samples reach a certain number, the model with the longest usage time in the multiple parameter determination models, that is, the parameter determination model that is most affected by the historical interaction samples, can be replaced, thereby reducing the excessive influence of the historical interaction samples to a certain extent and ensuring the exploration diversity of the values of the target hyperparameter combination. At the same time, some models that have been optimized in parameters are retained in the multiple parameter determination models, thereby ensuring the accuracy of the target space finally determined.
[0125] The present disclosure also provides a deep reinforcement learning framework, wherein the values of multiple hyperparameters with associated relationships in the deep reinforcement learning framework are determined based on the above-mentioned hyperparameter determination method. For example, the game artificial intelligence can be trained based on the deep reinforcement learning framework, and the above-mentioned technical solution can ensure the accuracy of the decision-making of the determined game artificial intelligence, improve the decision-making ability of the game artificial intelligence when the game artificial intelligence interacts with the user, and enhance the user interaction experience.
[0126] The present disclosure also provides a hyperparameter determination device, such as Figure 4 As shown, the device 10 comprises:
[0127] The first acquisition module 101 is used to acquire, under a sampling value combination corresponding to a target hyperparameter combination of a target model, a sampling sample corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters;
[0128] A generating module 102 is used to generate an interaction sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interaction sample includes the sampling value combination and the optimized feature parameters corresponding to the target model;
[0129] An updating module 103 is used to update, for each parameter determination model in a plurality of parameter determination models used to determine the target hyperparameter combination, a state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into a plurality of value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into a plurality of value spaces, and the plurality of value spaces corresponding to the plurality of parameter determination models are divided in the same way;
[0130] A first determination module 104 is configured to determine, for each of the parameter determination models, a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model;
[0131] A second determination module 105 is used to determine a target space according to the candidate space determined by each parameter determination model;
[0132] The third determination module 106 is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0133] Optionally, the device further comprises:
[0134] A trigger module is used to use the target value combination as a new sampling value combination corresponding to the target hyperparameter combination, and re-trigger the sampling module to execute the acquisition of the sampling value combination corresponding to the target hyperparameter combination of the target model, and the sampling samples corresponding to the sampling value combination are sent to the third determination module to determine the target value combination corresponding to the target hyperparameter combination according to the target space until the target model training is completed.
[0135] Optionally, the device further comprises:
[0136] A second acquisition module is used to acquire a new parameter determination model for determining the target hyperparameter combination when the number of the interaction samples reaches a quantity threshold;
[0137] A replacement module is used to replace the parameter determination model with the longest usage time among the multiple parameter determination models used to determine the target hyperparameter combination with the new parameter determination model.
[0138] Optionally, the second determining module includes:
[0139] An acquisition submodule, used for acquiring, for each candidate space, the number of parameter determination models for determining the candidate space;
[0140] The first determining submodule is configured to determine the candidate spaces with the largest number as the target space.
[0141] Optionally, the update module includes:
[0142] A second determination submodule is used to determine, in the parameter determination model, according to the sampling value combination, a value space to which the sampling value combination belongs as a value space to be updated;
[0143] The updating submodule is used to update the state value of the value space to be updated according to the optimized characteristic parameters.
[0144] Optionally, the first determining module includes:
[0145] A third determination submodule is used to determine, in the parameter determination model, a target score for each of the value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0146] The fourth determination submodule is used to determine the candidate space from the multiple value spaces according to the target score of each value space.
[0147] Optionally, the third determining submodule includes:
[0148] A fifth determination submodule is used to determine, for each value space, a result obtained by normalizing the state value of the value space in the updated state value corresponding to the target hyperparameter combination as a value score of the value space;
[0149] The sixth determination submodule is used to determine, for each of the value spaces, a target score of the value space according to the value score of the value space and the number of hits in the value space.
[0150] Optionally, the fourth determining submodule includes:
[0151] A seventh determination submodule, configured to select a preset number of value spaces as the candidate spaces in descending order of the target scores;
[0152] or
[0153] The eighth determination submodule is used to perform softmax processing on the target scores of the multiple value spaces, obtain a probability distribution formed by the probability information of each value space, and sample the multiple value spaces according to the probability distribution, and determine the value space obtained by sampling as the candidate space.
[0154] Optionally, the target model is a deep reinforcement learning model, and the sampling samples are interaction sequences obtained by sampling during the interaction between the virtual object and the virtual environment, wherein the virtual object is controlled based on the deep reinforcement learning model, and the interaction sequence includes multiple sampling data under the sampling value combination corresponding to the target hyperparameter combination, each of the sampling data includes the environmental state of the virtual environment, the decision action performed by the virtual object under the environmental state determined by the deep reinforcement learning model, and the reward value corresponding to the decision action, and the optimized feature parameter is the cumulative reward corresponding to the interaction sequence.
[0155] Optionally, the virtual object is a gaming artificial intelligence, the deep reinforcement learning model is used to train the gaming artificial intelligence, the sampling samples are interaction sequences sampled from a game of the gaming artificial intelligence in a target game, and the virtual environment is a training environment in which the gaming artificial intelligence is located in the target game.
[0156] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0157] like Figure 5 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0158] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0159] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0160] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0161] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0162] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0163] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a sampling sample corresponding to the sampling value combination under a sampling value combination corresponding to the target hyperparameter combination of the target model, wherein the target hyperparameter combination includes multiple target hyperparameters with an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters; generates an interaction sample corresponding to the target hyperparameter combination according to the sampling sample, and the interaction sample includes the sampling value combination and the optimization feature parameters corresponding to the target model; for each parameter determination model in the multiple parameter determination models used to determine the target hyperparameter combination, according to the interaction sample, determines the state value corresponding to the target hyperparameter combination in the parameter determination model. The value is updated, wherein the learning rate of each parameter determination model is different, in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into multiple value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into multiple value spaces, and the multiple value spaces corresponding to multiple parameter determination models are divided in the same way; for each parameter determination model, according to the updated state value corresponding to the target hyperparameter combination in the parameter determination model, a candidate space is determined from the multiple value spaces; according to the candidate space determined by each parameter determination model, a target space is determined; according to the target space, a target value combination corresponding to the target hyperparameter combination is determined.
[0164] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0165] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0166] The modules described in the embodiments of the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the first acquisition module may also be described as "a module for acquiring sampling samples corresponding to the sampling value combination under the sampling value combination corresponding to the target hyperparameter combination of the target model".
[0167] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0168] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0169] According to one or more embodiments of the present disclosure, Example 1 provides a method for determining a hyperparameter, the method comprising:
[0170] Obtaining, under a sampling value combination corresponding to a target hyperparameter combination of a target model, a sampling sample corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters;
[0171] Generate an interactive sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interactive sample includes the sampling value combination and the optimized feature parameters corresponding to the target model;
[0172] For each parameter determination model among multiple parameter determination models used to determine the target hyperparameter combination, the state value corresponding to the target hyperparameter combination in the parameter determination model is updated according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into multiple value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into multiple value spaces, and the multiple value spaces corresponding to multiple parameter determination models are divided in the same way;
[0173] For each of the parameter determination models, determining a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model;
[0174] Determine the target space according to the candidate space determined by the model according to each of the parameters;
[0175] The target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0176] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the method further includes:
[0177] The target value combination is used as a new sampling value combination corresponding to the target hyperparameter combination, and the steps of obtaining sampling samples corresponding to the sampling value combination under the sampling value combination corresponding to the target hyperparameter combination of the target model and determining the target value combination corresponding to the target hyperparameter combination according to the target space are re-executed until the training of the target model is completed.
[0178] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the method further includes:
[0179] When the number of the interaction samples reaches a number threshold, obtaining a new parameter determination model for determining the target hyperparameter combination;
[0180] The parameter determination model with the longest usage time among the multiple parameter determination models used to determine the target hyperparameter combination is replaced with the new parameter determination model.
[0181] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein determining the target space according to the candidate space determined by the model according to each of the parameters includes:
[0182] For each of the candidate spaces, obtaining the number of parameter determination models that determine the candidate space;
[0183] The candidate space with the largest number is determined as the target space.
[0184] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein updating the state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample includes:
[0185] In the parameter determination model, according to the sampling value combination, determining the value space to which the sampling value combination belongs as the value space to be updated;
[0186] The state value of the value space to be updated is updated according to the optimized characteristic parameters.
[0187] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 1, wherein determining the updated state value corresponding to the target hyperparameter combination in the model according to the parameter, and determining the candidate space from the multiple value spaces, includes:
[0188] In the parameter determination model, determining a target score for each of the value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0189] The candidate space is determined from the multiple value spaces according to the target score of each value space.
[0190] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein determining the target score of each of the value spaces according to the updated state value corresponding to the target hyperparameter combination includes:
[0191] In the updated state value corresponding to the target hyperparameter combination, for each value space, the state value of the value space is normalized and the result obtained is determined as the value score of the value space;
[0192] For each of the value spaces, a target score of the value space is determined according to the value score of the value space and the number of hits in the value space.
[0193] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 6, wherein determining the candidate space from the multiple value spaces according to the target score of each value space includes:
[0194] Selecting a preset number of value spaces as the candidate spaces in descending order of the target scores;
[0195] or
[0196] Softmax processing is performed on the target scores of the multiple value spaces to obtain a probability distribution formed by the probability information of each value space, and the multiple value spaces are sampled according to the probability distribution, and the value space obtained by sampling is determined as the candidate space.
[0197] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 1, wherein the target model is a deep reinforcement learning model, and the sampling samples are interaction sequences obtained by sampling during the interaction between the virtual object and the virtual environment, wherein the virtual object is controlled based on the deep reinforcement learning model, and the interaction sequence includes a plurality of sampling data under the sampling value combination corresponding to the target hyperparameter combination, each of the sampling data includes the environmental state of the virtual environment, the decision action performed by the virtual object under the environmental state determined by the deep reinforcement learning model, and the reward value corresponding to the decision action, and the optimized feature parameter is the cumulative reward corresponding to the interaction sequence.
[0198] According to one or more embodiments of the present disclosure, Example 10 provides the method of Example 9, wherein the virtual object is a game artificial intelligence, the deep reinforcement learning model is used to train the game artificial intelligence, the sampling samples are interaction sequences obtained by sampling the game artificial intelligence in a game of a target game, and the virtual environment is a training environment in which the game artificial intelligence is located in the target game.
[0199] According to one or more embodiments of the present disclosure, Example 11 provides a hyperparameter determination device, wherein the device includes:
[0200] A first acquisition module is used to acquire, under a sampling value combination corresponding to a target hyperparameter combination of a target model, a sampling sample corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters;
[0201] A generating module, configured to generate an interaction sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interaction sample includes the sampling value combination and the optimized feature parameters corresponding to the target model;
[0202] An updating module, for updating, for each parameter determination model in a plurality of parameter determination models for determining the target hyperparameter combination, a state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into a plurality of value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into a plurality of value spaces, and the plurality of value spaces corresponding to the plurality of parameter determination models are divided in the same way;
[0203] A first determination module is used to determine, for each of the parameter determination models, a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model;
[0204] A second determination module is used to determine the target space according to the candidate space determined by each parameter determination model;
[0205] The third determination module is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0206] According to one or more embodiments of the present disclosure, Example 12 provides a deep reinforcement learning framework, wherein the values of multiple hyperparameters with associated relationships in the deep reinforcement learning framework are determined based on any of the hyperparameter determination methods described in Examples 1-10.
[0207] According to one or more embodiments of the present disclosure, Example 13 provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processing device, the steps of the method described in any one of Examples 1-10 are implemented.
[0208] According to one or more embodiments of the present disclosure, Example 14 provides an electronic device, including:
[0209] a storage device having a computer program stored thereon;
[0210] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-10.
[0211] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0212] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0213] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A method for determining hyperparameters, characterized in that: The method comprises: Obtaining, under a sampling value combination corresponding to a target hyperparameter combination of a target model, sampling samples corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, the sampling value combination includes a sampling value corresponding to each of the target hyperparameters, the sampling samples being an interaction sequence obtained by sampling during the interaction between a virtual object and a virtual environment, wherein the virtual environment is used to represent a virtual scene environment generated by rendering multimedia data for interacting with a user, and the virtual object is controlled based on the target model; Generate an interaction sample corresponding to the target hyperparameter combination according to the sampling sample, wherein the interaction sample includes the sampling value combination and the optimized feature parameters corresponding to the target model; For each parameter determination model among multiple parameter determination models used to determine the target hyperparameter combination, updating the state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one to one, and the parameter space of each target hyperparameter is discretized into multiple value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into multiple value spaces, and the multiple value spaces corresponding to the multiple parameter determination models are divided identically; For each of the parameter determination models, determining a candidate space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination in the parameter determination model; Determine the target space according to the candidate space determined by the model according to each parameter; Determine a target value combination corresponding to the target hyperparameter combination according to the target space.
2. The method according to claim 1, characterized in that The method further comprises: The target value combination is used as a new sampling value combination corresponding to the target hyperparameter combination, and the steps of obtaining sampling samples corresponding to the sampling value combination under the sampling value combination corresponding to the target hyperparameter combination of the target model and determining the target value combination corresponding to the target hyperparameter combination according to the target space are re-executed until the target model training is completed.
3. The method according to claim 1, characterized in that The method further comprises: When the number of the interaction samples reaches a quantity threshold, obtaining a new parameter determination model for determining the target hyperparameter combination; The parameter determination model with the longest usage time among the multiple parameter determination models used to determine the target hyperparameter combination is replaced with the new parameter determination model.
4. The method according to claim 1, wherein Determining the target space according to the candidate space determined by the model according to each parameter includes: For each candidate space, obtaining the number of parameter determination models for determining the candidate space; The candidate space with the largest number is determined as the target space.
5. The method according to claim 1, wherein The updating of the state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample includes: In the parameter determination model, according to the sampling value combination, determining the value space to which the sampling value combination belongs as the value space to be updated; The state value of the value space to be updated is updated according to the optimized characteristic parameters.
6. The method according to claim 1, wherein Determining the updated state value corresponding to the target hyperparameter combination in the model according to the parameter, and determining a candidate space from the multiple value spaces, includes: In the parameter determination model, determining a target score for each of the value spaces according to the updated state value corresponding to the target hyperparameter combination; The candidate space is determined from the multiple value spaces according to the target score of each value space.
7. The method according to claim 6, characterized in that Determining the target score of each value space according to the updated state value corresponding to the target hyperparameter combination includes: In the updated state value corresponding to the target hyperparameter combination, for each value space, the state value of the value space is normalized and the result obtained is determined as the value score of the value space; For each of the value spaces, a target score of the value space is determined according to the value score of the value space and the number of hits in the value space.
8. The method according to claim 6, characterized in that Determining the candidate space from the multiple value spaces according to the target score of each value space includes: Selecting a preset number of value spaces as the candidate spaces in descending order of the target scores; or Softmax processing is performed on the target scores of the multiple value spaces to obtain a probability distribution formed by the probability information of each value space, and the multiple value spaces are sampled according to the probability distribution, and the value space obtained by sampling is determined as the candidate space.
9. The method according to claim 1, characterized in that The target model is a deep reinforcement learning model, and the interaction sequence includes multiple sampling data under the sampling value combination corresponding to the target hyperparameter combination. Each sampling data includes the environmental state of the virtual environment, the decision action performed by the virtual object under the environmental state determined by the deep reinforcement learning model, and the reward value corresponding to the decision action. The optimized feature parameter is the cumulative reward corresponding to the interaction sequence.
10. The method according to claim 9, characterized in that The virtual object is a gaming artificial intelligence, the deep reinforcement learning model is used to train the gaming artificial intelligence, the sampling samples are interaction sequences obtained by sampling the gaming artificial intelligence in a match of a target game, and the virtual environment is the training environment of the gaming artificial intelligence in the target game.
11. A hyperparameter determination device, characterized in that: The device comprises: A first acquisition module is configured to acquire, under a sampling value combination corresponding to a target hyperparameter combination of a target model, sampling samples corresponding to the sampling value combination, wherein the target hyperparameter combination includes a plurality of target hyperparameters having an associated relationship, and the sampling value combination includes a sampling value corresponding to each of the target hyperparameters, and the sampling samples are interaction sequences obtained by sampling during the interaction between a virtual object and a virtual environment, wherein the virtual environment is used to represent a virtual scene environment generated by rendering multimedia data for interacting with a user, and the virtual object is controlled based on the target model; A generation module, configured to generate an interaction sample corresponding to the target hyperparameter combination based on the sampled samples, wherein the interaction sample includes the sampled value combination and the optimized feature parameters corresponding to the target model; an updating module for updating, for each parameter determination model among a plurality of parameter determination models used to determine the target hyperparameter combination, a state value corresponding to the target hyperparameter combination in the parameter determination model according to the interaction sample, wherein the learning rate of each parameter determination model is different, and in each parameter determination model, the target hyperparameter and the dimension in the target hyperspace corresponding to the target hyperparameter combination correspond one-to-one, and the parameter space of each target hyperparameter is discretized into a plurality of value intervals under the dimension corresponding to the target hyperparameter, so that the target hyperspace is discretized into a plurality of value spaces, and the plurality of value spaces corresponding to the plurality of parameter determination models are divided identically; A first determination module is configured to determine, for each parameter determination model, determine a candidate space from the multiple value spaces according to an updated state value corresponding to the target hyperparameter combination in the parameter determination model; A second determination module is configured to determine a target space based on the candidate spaces determined by each parameter determination model; The third determination module is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
12. A deep reinforcement learning method, characterized in that: The values of multiple hyperparameters with associated relationships in the training process based on the deep reinforcement learning method are determined based on the hyperparameter determination method described in any one of claims 1 to 10.
13. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method according to any one of claims 1 to 10 are implemented.
14. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 10.
