Hyperparameter determination method, device, deep reinforcement learning framework, medium and equipment
By obtaining and updating the sampling value combination of the target hyperparameter combination, interactive samples are generated, the hyperspace is discretized, and the hyperparameter value combination is determined. This solves the problem of hyperparameter settings relying on human experience and improves the training efficiency and convergence of the model. .
Patent Information
- Application Number
- CN202110349555.7
- 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 it is easy to fall into a saddle point when optimizing multiple hyperparameters, affecting model training efficiency.
By obtaining the sampling value combination of the target hyperparameter combination, generate interaction samples, update the state value, discretize the hyperspace, determine the target value combination, and ensure the accuracy of the hyperparameter value and model matching.
It improves the training efficiency of the model, reduces the number of iterations, avoids convergence problems caused by inappropriate hyperparameter settings, and ensures the accuracy of hyperparameter values and the overall matching degree of the model.
Smart Images

Figure CN113052248B
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] According to the interaction sample, the state value corresponding to the target hyperparameter combination is updated, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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;
[0008] Determining a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0009] The target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0010] In a second aspect, the present disclosure provides a hyperparameter determination device, the device comprising:
[0011] An acquisition module, 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;
[0012] 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;
[0013] An updating module, configured to update the state value corresponding to the target hyperparameter combination according to the interaction sample, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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;
[0014] A first determination module, configured to determine a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0015] The second determination module is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0016] 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.
[0017] 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.
[0018] In a fifth aspect, an electronic device is provided, including:
[0019] a storage device having a computer program stored thereon;
[0020] 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.
[0021] Thus, in the above technical scheme, for multiple target hyperparameters with associated relationships, the parameter space of each target hyperparameter can be represented by the target hyperspace at the same time, so that the parameter space of the target hyperparameter under the dimension can be discretized in each dimension, so that the target hyperspace is discretized into multiple value spaces, so that the value of the target hyperparameter combination can be determined based on the sampled samples corresponding to the target model using the target hyperparameter combination and the optimized characteristic parameters of the target model. Thus, through the above technical scheme, on the one hand, the value of the hyperparameter of the model can be accurately set, avoiding the phenomenon that the target model cannot converge or the convergence speed is too slow due to the inappropriate setting value of the hyperparameter due to the limitations of human experience. On the other hand, by uniformly determining the values of multiple hyperparameters with associated relationships, the accuracy of the value of each target hyperparameter can be guaranteed, and the matching degree of the multiple hyperparameter values and the target model as a whole can be guaranteed, 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 feature parameters of the target model. When determining the target value combination, the target space is determined based on the conditions that make the optimized feature parameters more optimal, thereby effectively improving the training efficiency of the target model, reducing the number of iterations of the target model training to a certain extent, and improving the convergence efficiency of the target model.
[0022] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] 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:
[0024] Figure 1 is a flowchart of a method for determining hyperparameters provided in an embodiment of the present disclosure;
[0025] Figure 2 is a schematic diagram of a target hyperspace provided according to an embodiment of the present disclosure;
[0026] Figure 3 is a schematic diagram of a target hyperspace and its corresponding reference hyperspace provided according to an embodiment of the present disclosure;
[0027] Figure 4A flowchart of an exemplary implementation method of determining a target space from the multiple value spaces according to the state value corresponding to the updated target hyperparameter combination provided in an embodiment of the present disclosure;
[0028] Figure 5 is a block diagram of a hyperparameter determination device provided according to an embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] 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.
[0031] 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.
[0032] 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.
[0033] 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.
[0034] 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".
[0035] 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.
[0036] Figure 1As 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:
[0037] 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.
[0038] 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.
[0039] 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.
[0040] Therefore, in this application scenario, 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.
[0041] 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.
[0042] The application scenario may be a scenario where a virtual object perceives its environment and performs actions according to the perceived environmental state. The application scenario may include a virtual object and multiple environmental objects contained in the environment where the virtual object is located. In this scenario, the virtual object may fuse the environmental state of the environment where the virtual object is located, and input the fused environmental state into the target model to obtain the target action to be performed by the virtual object. The virtual object may be any intelligent agent that can interact with the environment and perform actions according to the environmental state of the environment where the virtual object is located.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] As an example, the virtual object can perform a decision action in the first state of the virtual environment. After the virtual object 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 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. Among them, when sampling, the image of the virtual environment corresponding to the sampling moment can be obtained, so that the image can be feature extracted to obtain the first state. After the virtual object performs the decision action, the image of the virtual environment is sampled and feature extracted to obtain the second state. The reward value can be the change in the score value corresponding to the virtual object after the decision action is executed, or it can be the 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.
[0047] 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.
[0048] 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:
[0049] G t =R t+1 +γR t+2 +γ 2 R t+3 +…+γ n-1 R t+n
[0050] =R t+1 +γ(R t+2 +γR t+3 +…+γ n-2 R t+n )
[0051] =R t+1 +γG t+1
[0052] 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.
[0053] 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.
[0054] In step 13, the state value corresponding to the target hyperparameter combination is updated according to the interaction sample, wherein the target hyperparameter corresponds one-to-one to the dimension in the target hyperspace corresponding to the target hyperparameter combination, 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.
[0055] 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.
[0056] 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.
[0057] 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):
[0058] V π (s) = E π [G t |S t =s]
[0059] 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 intervals of state s. The method for determining the cumulative reward has been described in detail above and will not be repeated here.
[0060] 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.
[0061] As an example, the parameter space of each target hyperparameter in the 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.
[0062] 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 corresponding to the dimension can be evenly divided to obtain multiple value intervals under the dimension. 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.
[0063] In step 14, a target space is determined from multiple value spaces according to the state value corresponding to the updated target hyperparameter combination.
[0064] In this step, the state value corresponding to the target hyperparameter combination determined according to the sampling samples of the target model can be used to accurately evaluate the cumulative return of the target hyperparameter combination from each value space, so that the target space for determining the values corresponding to the target hyperparameter combination can be selected according to the evaluation results to ensure the accuracy of the values corresponding to the target hyperparameter combination and the consistency of the values corresponding to the target hyperparameter combination with the actual application process of the target model.
[0065] In step 15, the target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0066] 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.
[0067] Thus, in the above technical scheme, for multiple target hyperparameters with associated relationships, the parameter space of each target hyperparameter can be represented by the target hyperspace at the same time, so that the parameter space of the target hyperparameter under the dimension can be discretized in each dimension, so that the target hyperspace is discretized into multiple value spaces, so that the value of the target hyperparameter combination can be determined based on the sampled samples corresponding to the target model using the target hyperparameter combination and the optimized characteristic parameters of the target model. Thus, through the above technical scheme, on the one hand, the value of the hyperparameter of the model can be accurately set, avoiding the phenomenon that the target model cannot converge or the convergence speed is too slow due to the inappropriate setting value of the hyperparameter due to the limitations of human experience. On the other hand, by uniformly determining the values of multiple hyperparameters with associated relationships, the accuracy of the value of each target hyperparameter can be guaranteed, and the matching degree of the multiple hyperparameter values and the target model as a whole can be guaranteed, 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 feature parameters of the target model. When determining the target value combination, the target space is determined based on the conditions that make the optimized feature parameters more optimal, thereby effectively improving the training efficiency of the target model, reducing the number of iterations of the target model training to a certain extent, and improving the convergence efficiency of the target model.
[0068] 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 the hyperparameters 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 character, and at the same time reduce the amount of data and manpower required in the training process.
[0069] In a possible embodiment, the method may further include:
[0070] 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.
[0071] Among them, the sampling value combination corresponding to the target hyperparameter combination can be initially obtained based on the randomly initialized model sampling. In this embodiment, 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 15 can be re-executed to further determine whether the target value combination is accurate for the interactive samples of the target hyperparameter combination of the target model under the target value combination, so that the dynamic adjustment of the value 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 value corresponding to the target hyperparameter combination, the convergence and accuracy of the target model are guaranteed, and the training efficiency of the target model is improved.
[0072] In a possible embodiment, in step 13, an exemplary implementation method of updating the state value corresponding to the target hyperparameter combination according to the interaction sample is as follows, and this step may include:
[0073] According to the sampling value combination, a value space to which the sampling value combination belongs is determined as a value space to be updated.
[0074] For example, the identifier of each sampled value in the sampled value combination under 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:
[0075] i=(min(max(x,l),r)-l) / / acc
[0076] 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.
[0077] 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.
[0078] Afterwards, the state value of the value space to be updated is updated according to the optimized characteristic parameters.
[0079] 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.
[0080] In this 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:
[0081]
[0082] 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.
[0083] 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:
[0084] V'(s)=V(s)+lr*(TV(s))
[0085] Among them, lr is used to represent the learning rate for updating the state value.
[0086] 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.
[0087] In a possible embodiment, the target hyperspace corresponds to a plurality of reference hyperspaces, a discrete interval corresponding to a value space in each of the reference hyperspaces is larger than a discrete interval corresponding to a value space in the target hyperspace, and each of the reference hyperspaces corresponds to a different origin.
[0088] like Figure 3As shown, the A space is Figure 2 The target hyperspace, B1 space and B2 space shown are related to the Figure 2 The target hyperspace shown corresponds to the reference hyperspace. For the convenience of representation, the B1 space and B2 space are represented by Figure 3 As shown in , the origin positions of B1 space and B2 space are offset relative to the origin of the target hyperspace, but there are positions corresponding to A space in both B1 space and B2 space.
[0089] like Figure 3 As shown, the discrete interval corresponding to the reference hyperspace B1 and the discrete interval corresponding to the reference hyperspace B2 are both larger than the discrete interval corresponding to the target hyperspace. For example, the discrete interval corresponding to the corresponding reference hyperspace can be set according to the corresponding discrete interval in each dimension of the target hyperspace. The discrete intervals can be the same or different and can be set according to actual usage requirements.
[0090] Accordingly, the exemplary implementation of updating the state value corresponding to the target hyperparameter combination according to the interaction sample is as follows, and this step may include:
[0091] According to the sampling value combination, a reference value space to which the sampling value combination belongs in each of the reference hyperspaces and a to-be-updated value space to which the sampling value combination belongs in the target hyperspace are determined.
[0092] According to the optimized characteristic parameters, the state value of each reference value space is updated.
[0093] The method of determining the value space to which the sampled value combination belongs in each hyperspace and updating the state value of the value space has been described in detail above and will not be repeated here.
[0094] Afterwards, the state value of the to-be-updated value space may be updated according to the updated state value corresponding to each of the reference hyperspaces.
[0095] Through the above technical scheme, the state value corresponding to the target hyperspace can be updated based on multiple reference hyperspaces, and since the discrete interval corresponding to the value space in each reference hyperspace is larger than the discrete interval corresponding to the value space in the target hyperspace, the calculation efficiency of determining the state value corresponding to the reference value space in the reference hyperspace is higher. On the one hand, the updating efficiency of the state value corresponding to the target hyperspace can be improved to a certain extent. On the other hand, based on the fusion representation of the target hyperspace corresponding to the multiple reference hyperspaces, the accuracy of the state value corresponding to the determined target hyperparameter combination can also be improved to a certain extent, providing accurate data support for the subsequent determination of the target value combination.
[0096] In a possible embodiment, the exemplary implementation method of updating the state value of the to-be-updated value space according to the updated state value corresponding to each of the reference hyperspaces is as follows. This step may include:
[0097] Determine a mapping value space corresponding to the to-be-updated value space in each of the reference hyperspaces.
[0098] The mapping value space can be determined based on the offset between the origin of each reference hyperspace and the origin of the target hyperspace. The mapping value space can be determined by transforming the coordinate systems corresponding to the target hyperspace and the reference hyperspace. The mapping method of the coordinate system transformation can adopt any transformation method in the art, which will not be described in detail here.
[0099] For example, Figure 3 As shown, the value space to be updated in the target hyperspace A is C01, and its corresponding reference value space in the reference hyperspace B1 is M1, and its corresponding reference value space in the reference hyperspace B2 is M2 and M3.
[0100] According to the state value of each of the mapped value spaces, the state value of the value space to be updated is determined.
[0101] For example, the state value of the to-be-updated value space may be determined by the average value of the state value of each mapped value space.
[0102] Therefore, through the above technical solution, there is no need to directly update the state value corresponding to the target hyperparameter combination based on the interaction sample, but the state value corresponding to multiple reference hyperspaces is updated based on the interaction sample, so that based on the mapping relationship between the target hyperspace and the reference hyperspace, the target hyperspace can be fused and represented through multiple reference hyperspaces, thereby improving the accuracy of the state value corresponding to the determined target hyperparameter combination, and further improving the accuracy of the subsequently determined hyperparameter values.
[0103] Among them, in order to improve the efficiency of determining the hyperparameter value, when the number of the interaction samples reaches a preset threshold, for each interaction sample, a step of updating the state value corresponding to the target hyperparameter combination according to the interaction sample is performed, wherein the target hyperparameter combination corresponding to each interaction sample has values 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 update method based on each interaction sample is the same as described above, which will not be repeated here.
[0104] 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 determining the target space.
[0105] In a possible embodiment, the exemplary implementation method of determining the target space from the multiple value spaces according to the state value corresponding to the updated target hyperparameter combination is as follows: Figure 4 As shown, this step may include:
[0106] In step 41, a target score for each value space is determined according to the state value corresponding to the updated target hyperparameter combination, wherein the target score is used to characterize the reliability of selecting the value space.
[0107] As an example, an exemplary implementation method of determining the target score of each value space according to the state value corresponding to the updated target hyperparameter combination is as follows. This step may include:
[0108] In the state value corresponding to the updated 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.
[0109] For example, the value score S of the i-th value space can be determined by the following formula: i :
[0110]
[0111] Among them, V i ' 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.
[0112] Then, for each of the value spaces, the 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. For example, the target score Score of the i-th value space is determined as i The formula is:
[0113]
[0114] 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.
[0115] 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 target 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 samples 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.
[0116] Transfer back Figure 4 In step 42, a target space is determined from the multiple value spaces according to the target score of each value space.
[0117] In a possible embodiment, the step of determining a target space from the multiple value spaces according to the target score of each value space may include:
[0118] The value space with the largest target score is determined as the target space.
[0119] In the disclosed embodiment, the value space with the largest target score can be directly selected as the target space, thereby effectively ensuring that the target value combination determined from the target space is effectively adjusted for the target model optimization, thereby improving the efficiency of the target model optimization.
[0120] In another possible embodiment, the step of determining a target space from the multiple value spaces according to the target score of each value space may include:
[0121] Softmax processing is performed on the target scores corresponding to the multiple value spaces to obtain a probability distribution formed by the probability information of the multiple value spaces, and the multiple value spaces are sampled according to the probability distribution, and the value space obtained by sampling is determined as the target space.
[0122] In this embodiment, in order to further improve the diversity of the exploration of target hyperparameter combination values, 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 intervals have the possibility of being sampled, avoiding the problem that the determined target space is the parameter that makes the feature optimization parameter at the local optimal level, avoiding the training of the target model from reaching the local optimal level and stopping the training, and ensuring the accuracy and robustness of the target model training.
[0123] The present disclosure also provides a deep reinforcement learning framework, in which the values of hyperparameters 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.
[0124] The present disclosure also provides a hyperparameter determination device, such as Figure 5 As shown, the device 10 comprises:
[0125] The acquisition module 100 is used to acquire a sampling sample corresponding to a sampling value combination under a sampling value combination corresponding to a target hyperparameter combination of a target model, 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;
[0126] A generating module 200 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;
[0127] An updating module 300 is used to update the state value corresponding to the target hyperparameter combination according to the interaction sample, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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;
[0128] A first determination module 400 is used to determine a target space from the multiple value spaces according to the state value corresponding to the updated target hyperparameter combination;
[0129] The second determination module 500 is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0130] Optionally, the device further comprises:
[0131] The third determination module is used to take the target value combination as a new sampling value combination corresponding to the target hyperparameter combination, and trigger the acquisition 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 second 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.
[0132] Optionally, the update module includes:
[0133] A first determination submodule, configured to determine, according to the sampling value combination, a value space to which the sampling value combination belongs as a value space to be updated;
[0134] The first updating submodule is used to update the state value of the value space to be updated according to the optimized characteristic parameters.
[0135] Optionally, the target hyperspace corresponds to a plurality of reference hyperspaces, a discrete interval corresponding to a value space in each of the reference hyperspaces is larger than a discrete interval corresponding to a value space in the target hyperspace, and each of the reference hyperspaces corresponds to a different origin;
[0136] The update module includes:
[0137] A second determination submodule is used to determine, according to the sampled value combination, a reference value space to which the sampled value combination belongs in each of the reference hyperspaces, and a to-be-updated value space to which the sampled value combination belongs in the target hyperspace;
[0138] A second updating submodule, used for updating the state value of each reference value space according to the optimized characteristic parameter;
[0139] The third updating submodule is used to update the state value of the to-be-updated value space according to the updated state value corresponding to each of the reference hyperspaces.
[0140] Optionally, the third updating submodule includes:
[0141] A third determination submodule is used to determine a mapping value space corresponding to the to-be-updated value space in each of the reference hyperspaces;
[0142] The fourth determining submodule is used to determine the state value of the to-be-updated value space according to the state value of each of the mapped value spaces.
[0143] Optionally, the first determining module includes:
[0144] A fifth determination submodule, configured to determine a target score for each of the value spaces according to the state value corresponding to the updated target hyperparameter combination;
[0145] The sixth determination submodule is used to determine a target space from the multiple value spaces according to the target score of each value space.
[0146] Optionally, the fifth determining submodule includes:
[0147] A seventh determination submodule is used to determine, for each value space, a result obtained by normalizing the state value of the value space in the state value corresponding to the updated target hyperparameter combination as a value score of the value space;
[0148] An eighth 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.
[0149] Optionally, the sixth determining submodule includes:
[0150] A ninth determination submodule, configured to determine a value space with a maximum target score as the target space; or
[0151] The tenth 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 target space.
[0152] 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.
[0153] 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.
[0154] Reference below Figure 6 , 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 6 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.
[0155] like Figure 6 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.
[0156] 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 6 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.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0161] 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 the 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 parameter corresponding to the target model; updates the state value corresponding to the target hyperparameter combination according to the interaction sample, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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; determines the target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination; determines the target value combination corresponding to the target hyperparameter combination according to the target space.
[0162] 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).
[0163] 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.
[0164] The modules involved in the embodiments described in 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 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".
[0165] 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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0166] 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.
[0167] According to one or more embodiments of the present disclosure, Example 1 provides a method for determining a hyperparameter, wherein the method includes:
[0168] 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;
[0169] 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;
[0170] According to the interaction sample, the state value corresponding to the target hyperparameter combination is updated, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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;
[0171] Determining a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0172] The target value combination corresponding to the target hyperparameter combination is determined according to the target space.
[0173] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the method further includes:
[0174] 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.
[0175] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein updating the state value corresponding to the target hyperparameter combination according to the interaction sample includes:
[0176] According to the sampling value combination, determining the value space to which the sampling value combination belongs as the value space to be updated;
[0177] The state value of the value space to be updated is updated according to the optimized characteristic parameters.
[0178] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein the target hyperspace corresponds to a plurality of reference hyperspaces, the discrete interval corresponding to the value space in each of the reference hyperspaces is larger than the discrete interval corresponding to the value space in the target hyperspace, and the origin corresponding to each of the reference hyperspaces is different;
[0179] The updating of the state value corresponding to the target hyperparameter combination according to the interaction sample includes:
[0180] According to the sampled value combination, determining a reference value space to which the sampled value combination belongs in each of the reference hyperspaces, and a to-be-updated value space to which the sampled value combination belongs in the target hyperspace;
[0181] According to the optimized characteristic parameters, the state value of each reference value space is updated;
[0182] The state value of the to-be-updated value space is updated according to the updated state value corresponding to each of the reference hyperspaces.
[0183] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the updating of the state value of the to-be-updated value space according to the updated state value corresponding to each of the reference hyperspaces comprises:
[0184] Determine a mapping value space corresponding to the to-be-updated value space in each of the reference hyperspaces;
[0185] According to the state value of each of the mapped value spaces, the state value of the value space to be updated is determined.
[0186] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 1, wherein determining the target space from the multiple value spaces according to the state value corresponding to the updated target hyperparameter combination includes:
[0187] Determining a target score for each of the value spaces according to the state value corresponding to the updated target hyperparameter combination;
[0188] According to the target score of each of the value spaces, a target space is determined from the multiple value spaces.
[0189] 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 value space according to the state value corresponding to the updated target hyperparameter combination includes:
[0190] In the state value corresponding to the updated target hyperparameter combination, for each value space, a result obtained by normalizing the state value of the value space is determined as the value score of the value space;
[0191] 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.
[0192] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 6, wherein determining the target space from the multiple value spaces according to the target score of each value space includes:
[0193] Determine the value space with the maximum target score as the target space;
[0194] or
[0195] The target scores of the multiple value spaces are subjected to softmax processing 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 target space.
[0196] 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.
[0197] 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 sampled from 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.
[0198] According to one or more embodiments of the present disclosure, Example 11 provides a hyperparameter determination device, the device comprising:
[0199] An acquisition module, 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;
[0200] 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;
[0201] An updating module, configured to update the state value corresponding to the target hyperparameter combination according to the interaction sample, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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;
[0202] A first determination module, configured to determine a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination;
[0203] The second determination module is used to determine the target value combination corresponding to the target hyperparameter combination according to the target space.
[0204] According to one or more embodiments of the present disclosure, Example 12 provides a deep reinforcement learning framework, in which 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.
[0205] According to one or more embodiments of the present disclosure, Example 13 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-10 when executed by a processing device.
[0206] According to one or more embodiments of the present disclosure, Example 14 provides an electronic device, including:
[0207] a storage device having a computer program stored thereon;
[0208] 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.
[0209] 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.
[0210] 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.
[0211] 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 a hyperparameter, characterized in that: The method comprises: 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, the sampling value combination includes a sampling value corresponding to each of the target hyperparameters, the sampling sample is an interaction sequence obtained by sampling during the process of interaction between a virtual object and a virtual environment, the virtual environment is used to represent a virtual scene environment generated by rendering multimedia data used to interact with a user, and the virtual object is controlled based on the target model; 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; According to the interaction sample, the state value corresponding to the target hyperparameter combination is updated, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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; Determining a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination; The target value combination corresponding to the target hyperparameter combination is determined 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 training of the target model is completed.
3. The method according to claim 1, characterized in that: The updating of the state value corresponding to the target hyperparameter combination according to the interaction sample includes: 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.
4. The method according to claim 1, characterized in that: The target hyperspace corresponds to a plurality of reference hyperspaces, the discrete interval corresponding to the value space in each of the reference hyperspaces is larger than the discrete interval corresponding to the value space in the target hyperspace, and the origin corresponding to each of the reference hyperspaces is different; The updating of the state value corresponding to the target hyperparameter combination according to the interaction sample includes: According to the sampled value combination, determining a reference value space to which the sampled value combination belongs in each of the reference hyperspaces, and a to-be-updated value space to which the sampled value combination belongs in the target hyperspace; According to the optimized characteristic parameters, the state value of each reference value space is updated; The state value of the to-be-updated value space is updated according to the updated state value corresponding to each of the reference hyperspaces.
5. The method according to claim 4, characterized in that The updating of the state value of the to-be-updated value space according to the updated state value corresponding to each of the reference hyperspaces comprises: Determine a mapping value space corresponding to the to-be-updated value space in each of the reference hyperspaces; According to the state value of each of the mapped value spaces, the state value of the value space to be updated is determined.
6. The method according to claim 1, characterized in that Determining the target space from the multiple value spaces according to the state value corresponding to the updated target hyperparameter combination includes: Determining a target score for each of the value spaces according to the state value corresponding to the updated target hyperparameter combination; According to the target score of each of the value spaces, a target space is determined from the multiple value spaces.
7. The method according to claim 6, characterized in that Determining the target score of each value space according to the state value corresponding to the updated target hyperparameter combination includes: In the state value corresponding to the updated target hyperparameter combination, for each value space, a result obtained by normalizing the state value of the value space 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 a target space from the multiple value spaces according to the target score of each value space includes: Determine the value space with the maximum target score as the target space; 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 target space.
9. The method according to claim 1, characterized in that: The target model is a deep reinforcement learning model, 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, and 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 sampled from the gaming artificial intelligence in a match of a target game, and the virtual environment is a training environment for the gaming artificial intelligence in the target game.
11. A hyperparameter determination device, characterized in that: The device comprises: An acquisition module, used for acquiring, 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, the sampling value combination includes a sampling value corresponding to each of the target hyperparameters, the sampling sample is an interaction sequence obtained by sampling during the interaction between a virtual object and a virtual environment, 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 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; An updating module, configured to update the state value corresponding to the target hyperparameter combination according to the interaction sample, wherein the target hyperparameter corresponds to the dimension in the target hyperspace corresponding to the target hyperparameter combination one by 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; A first determination module, configured to determine a target space from the multiple value spaces according to the updated state value corresponding to the target hyperparameter combination; The second 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 process of training based on the deep reinforcement learning method are determined based on the hyperparameter determination method described in any one of claims 1-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 described in 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.
