Learning method, learning apparatus, program, and method of generating trained model

By using a subtask-based learning method with test models to determine optimal states and actions, the method addresses the inefficiencies in reinforcement learning for robots, optimizing model size and computational resources.

JP2024134040AInactive Publication Date: 2024-10-03DENSO TEN LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023044124
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2024-10-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Reinforcement learning for robots is hindered by the unrealistically long time required due to the enormous number of states and actions, leading to either insufficient task execution or excessive computational load, depending on the sampling size.

Method used

A learning method that includes performing reinforcement learning using a subtask with fewer states and actions, employing multiple test models to determine optimal numbers through test learning, and optimizing the model size based on the achievement status of these subtasks.

Benefits of technology

The method allows for an appropriate model size to be determined, reducing computational load and learning time while ensuring effective task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024134040000001_ABST
    Figure 2024134040000001_ABST
Patent Text Reader

Abstract

To provide a technique for adjusting the size of a model for use in reinforcement learning, appropriately.SOLUTION: A learning method for a device to perform learning to achieve a target task using a model is configured to: set sub tasks having lower difficulty of achievement than the target task and a plurality of test models different in at least one of the number of states and the number of actions; and determine at least one of the number of states and the number of actions of a model which is to be trained for achieving the target task, on the basis of the achievement in which learning for achieving the sub tasks is executed using the test models.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a technique for performing reinforcement learning. [Background technology]

[0002] Conventionally, it is known to use reinforcement learning to control control targets such as autonomous systems and robots (see, for example, Patent Literature 1). Behavior control using reinforcement learning can adapt to complex environments and environments that change over time, compared to conventional rule-based control.

[0003] In reinforcement learning, learning proceeds by repeating a cycle in which the agent takes action in the environment, the environment updates the state and evaluates the action, and the agent is informed of the state and reward. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] Patent Publication No. 2022-046402 Summary of the Invention [Problem to be solved by the invention]

[0005] For example, in reinforcement learning for robots, the state of the robot itself and the surrounding environment are sensed as the state. The output of the engine or motor is used as the action. To move the robot smoothly, the number of states to be input to the model used in reinforcement learning (for example, DQN: Deep Q-Network) and the number of actions for which the model indicates action value become enormous. In other words, problems arise such as the time required for reinforcement learning becoming unrealistic.

[0006] Taking this into consideration, it is conceivable to sample some of the values ​​obtainable by sensing and input them to the model, rather than all of them. This makes it possible to reduce the number of states (number of states) input to the model. It is also conceivable to sample some of the values ​​that can be output by a motor, etc., rather than all of them, so that the model shows the action value. This makes it possible to reduce the number of actions (number of actions) for which the model shows the action value.

[0007] However, if the number of state and action samples is too small, the robot will roughly recognize the state and act roughly, which may result in the robot being unable to execute the target task. Also, if the number of state and action samples is increased, once it exceeds a certain value, the increased number of samples may have little effect on the execution of the task.

[0008] In other words, if the number of states and actions sampled is too small, it may cause problems in executing the task. On the other hand, if the number of states and actions is too large, the computational load may become unnecessarily large. For this reason, a technology is desired that allows the number of states and actions of a model used for learning to be appropriate.

[0009] In view of the above, an object of the present invention is to provide a technique that can make the size of a model used in reinforcement learning appropriate. [Means for solving the problem]

[0010] An exemplary learning method of the present invention is a learning method in which an apparatus uses a model to learn to achieve a target task, in which subtasks that are less difficult to achieve than the target task and multiple test models that differ from each other in at least one of the number of states and the number of actions are set, and at least one of the number of states and the number of actions of the model learning to achieve the target task is determined based on the progress achieved when learning to achieve the subtasks is performed using the test models. Effect of the Invention

[0011] According to an exemplary embodiment of the present invention, the size of the model used for reinforcement learning can be appropriate. [Brief description of the drawings]

[0012] [Figure 1] A flowchart outlining how a trained model is generated. [Diagram 2] A conceptual diagram of the DQN model structure. [Diagram 3] A diagram showing an example of behavioral information sampling [Figure 4] Block diagram showing the configuration of a learning device [Diagram 5] FIG. 1 is a diagram conceptually illustrating the functions of a learning unit included in a learning device. [Figure 6] A graph showing the relationship between the number of samples and the number of episodes of subtask completion. [Figure 7] 1 is a flowchart showing the flow of a learning method executed by a learning device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0013] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings.

[0014] <1. Overview of how to generate trained models> 1 is a flowchart showing an overview of a trained model generation method according to an embodiment of the present invention. The trained model generation method may be rephrased as a trained model manufacturing method. A trained model is a model obtained as a result of performing machine learning on a model.

[0015] As shown in Fig. 1, in this embodiment, a pre-processing is performed to determine at least one of the number of states and the number of actions of a model (step S1). Then, reinforcement learning is performed using a model having the number of states and the number of actions obtained from the result of the pre-processing (step S2). In this embodiment, the trained model is a model obtained as a result of performing reinforcement learning on a model having the number of states and the number of actions obtained from the result of the pre-processing.

[0016] Below, the reason why pre-processing (processing for determining the number of states, etc.) is performed will be explained, but before that, an overview of reinforcement learning in this embodiment will be explained. As an example of reinforcement learning in this embodiment, DQN, which is a representative method of deep reinforcement learning, is used. However, the reinforcement learning in the present invention may use deep reinforcement learning other than DQN, or reinforcement learning other than deep reinforcement learning such as Q-learning.

[0017] 2 is a diagram conceptually illustrating a model structure of DQN. As shown in FIG. 2, the DQN model has an input layer 101, an intermediate layer 102, and an output layer 103.

[0018] The input layer 101 has a plurality of nodes 104 to which different state information is input. For example, in the case of controlling a robot using reinforcement learning, the state information is information obtained by sensing the state of the robot itself and the surrounding environment of the robot. The state information is, for example, the current position, current speed, and traveling direction of the robot, the distance to obstacles in the vicinity, and the distance to a target point. In the example shown in FIG. 2, the number of nodes in the input layer 101 is four. In this example, four states are input to the input layer 101, so the number of states is "4". The number of states is appropriately changed depending on the control content, etc. The input layer 101 passes the input information to the intermediate layer 102.

[0019] The intermediate layer 102 compresses the information input to the input layer 101 and extracts features of the state information. The intermediate layer 102 is made up of a plurality of layers. Each of the layers constituting the intermediate layer 102 has a plurality of nodes 104.

[0020] The output layer 103 has a plurality of nodes 104, and outputs value information of each action. The value information is a value when a certain action is taken in a certain state, that is, a state-action value (Q value). For example, in the case of controlling a robot using reinforcement learning, value information of actions such as the robot's moving direction and speed is output by the output layer 103. The output layer 103 has a plurality of nodes 104 corresponding to the moving direction of the robot, for example, and each node 104 outputs value information of the corresponding moving direction (for example, leftward or rightward). In the example shown in FIG. 2, the output layer 103 has two nodes. In this example, the Q values ​​of two actions are output, so the number of actions is "2". The number of actions is appropriately changed depending on the control content, etc.

[0021] In learning using DQN, a reward for an action is calculated. Then, machine learning of the model is performed using the state-action value Q calculated before the action and the TD error calculated from the reward for the action. The update formula for the state-action value is given by the following formula (1). Q(s t ,a t )←Q(s t ,a t ) + α(R + γmaxQ(s t+1 ,a t+1 )-Q(s t ,a t )) ···(1) s t : State at time t at: action at time t Q(st,at): State-action value α: learning coefficient R: Immediate reward γ: Time discount rate maxQ(s t+1 ,a t+1 ): State action value when selecting the action with the maximum value for the next step

[0022] The TD error is given by the second term on the right-hand side of equation (1). In learning using DQN, the model weight coefficients are optimized by backpropagation, error gradient, etc., so that the TD error approaches zero. The actions described above and the optimization of the model weight coefficients based on the rewards obtained as a result are repeated until the end of the episode. An episode refers to a series of trials from the initial state to the end state due to the completion or failure of the task. If the episode ends due to the completion of the task, learning is completed. If the episode ends due to failure of the task, learning does not end and the next episode begins. Upon completion of learning, a trained model is generated (manufactured).

[0023] In a model in which reinforcement learning as described above is performed, as the number of states and the number of actions increase, the computational load for calculating weight coefficients and the like used in learning increases accordingly. For example, in a model used to control a robot or the like operating in a real environment, since fine control is required, the number of states and the number of actions becomes enormous, and when computational resources are scarce, the computation may be virtually impossible or the learning time may be unrealistic. Therefore, in this embodiment, as a means for suppressing the number of states and the number of actions from becoming enormous, sampling is performed in advance on at least one of the state information and the action information.

[0024] Sampling of state information and behavior information will be described using the case of sampling of behavior information as an example. Figure 3 is a diagram showing an example of sampling of behavior information. In the example shown in Figure 3, the robot can control its speed in the speed range of -0.200 m / s to +0.200 m / s. The resolution of the speed control is 0.025 m / s (see the table on the left side of Figure 3).

[0025] In the example shown in FIG. 3, when the resolution is used to the maximum (100%), the number of actions is "17" (see the table on the left side of FIG. 3). As an example of sampling to reduce the number of actions, the resolution used is not the maximum (100%) but a resolution lower than the maximum. In the case of the table on the right side of FIG. 3, the number of actions is reduced by lowering the resolution to 25% of the maximum resolution. In detail, the number of actions is set to "5" by performing sampling with a resolution of 0.100 m / s. As with the case of action information, sampling can also be performed for state information to reduce the number of states by, for example, lowering the resolution of the sensor. Specifically, the angular resolution of LiDAR, which uses calculation of the distance to obstacles in the vicinity, can be set to a resolution lower than the maximum (100%). In detail, instead of the number of states "360" with the angular resolution at the maximum resolution (1 degree), sampling with a resolution of 15 degrees can be performed to reduce the number of states to "24".

[0026] As described above, there are considered to be appropriate values ​​for the number of states and the number of actions. For example, if the number of states and the number of actions are reduced too much, the robot will roughly recognize the state and roughly act, making it difficult to execute the task. On the other hand, controlling the actions with a resolution of several millimeters is redundant when patrolling a facility with a floor area of ​​several hundred square meters, and it may be preferable to control with a lower resolution. In consideration of this point, in the learning method of this embodiment, a pre-processing of step S1 shown in FIG. 1 is provided to determine appropriate values ​​for the number of states and the number of actions, and then reinforcement learning is performed. Details regarding the determination of the number of states and the number of actions will be described later.

[0027] <2. Learning device> Next, a learning device that generates a trained model will be described. Fig. 4 is a block diagram showing the configuration of the learning device 1 according to an embodiment of the present invention. The learning device 1 of this embodiment not only performs reinforcement learning, but also performs the above-mentioned pre-processing (processing for determining the number of states, etc.). The learning device 1 widely executes a learning method related to the generation (production) of a trained model trained by reinforcement learning.

[0028] Although the configuration in which the learning device 1 is one device is shown here, the learning device that executes the learning method of the present invention and generates a trained model may be composed of multiple devices. For example, the learning device 1 may be composed of two devices, a reinforcement learning device that performs reinforcement learning and a pre-learning device that performs the above-mentioned pre-processing. In addition, in a certain aspect, the learning device of the present invention may be configured to refer only to the above-mentioned pre-learning device. In another aspect, the learning device of the present invention may be a device separate from the pre-learning device, and may be a trained model generation device that performs reinforcement learning using the results obtained by the pre-learning device.

[0029] The learning device 1 is configured by a computer device. As shown in Fig. 4, the learning device 1 includes a controller 11. The learning device 1 further includes a memory unit 12. The learning device 1 may be configured to include an input device such as a keyboard and an output device such as a display. The learning device 1 may be a device mounted on, for example, a robot.

[0030] The controller 11 includes an arithmetic circuit that performs arithmetic processing. More specifically, the controller 11 includes a processor that performs arithmetic processing and the like. The processor includes, for example, a CPU (Central Processing Unit) and a GPU (Graphics Processing Unit). The controller 11 may be configured with one processor or multiple processors. When configured with multiple processors, the processors only need to be connected to each other so that they can communicate with each other.

[0031] The memory unit 12 includes a volatile memory and a non-volatile memory. The volatile memory may include, for example, a random access memory (RAM). The non-volatile memory may include, for example, a read only memory (ROM), a flash memory, or a hard disk drive. The non-volatile memory stores computer-readable programs and data. In this embodiment, the memory unit 12 includes a model 121 that is trained by machine learning (specifically, reinforcement learning). In detail, the model 121 has a DQN structure. The model 121 that is trained by reinforcement learning may be an initial model that has not been trained at all, or a model that has been trained (e.g., simple learning).

[0032] The controller 11 includes, as its functions, a setting unit 111, a learning unit 112, an achievement status acquisition unit 113, and a number of states / number of actions determination unit 114. In this embodiment, the functions of the controller 11 are realized by a processor executing arithmetic processing in accordance with a program stored in the memory unit 12. The number of programs that realize the functions of the controller 11 may be one or more.

[0033] The scope of this embodiment may include a computer program that causes a computer to realize at least a part of the functions of the learning device 1. The scope of this embodiment may also include a computer-readable non-volatile recording medium that records such a computer program. The non-volatile recording medium may be, for example, an optical recording medium (e.g., an optical disk), a magneto-optical recording medium (e.g., a magneto-optical disk), a USB memory, or an SD card, in addition to the non-volatile memory described above.

[0034] Further, each of the functional units 111 to 114 may be realized by one program, but may be configured to be realized by separate programs for each functional unit. Further, each of the functional units 111 to 114 may be realized as separate devices. Further, each of the functional units 111 to 114 may be realized by having a processor execute a program, that is, by software, as described above, but may be realized by other methods. Each of the functional units 111 to 114 may be realized by using, for example, an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array). That is, each of the functional units 111 to 114 may be realized by hardware using a dedicated IC or the like. Further, each of the functional units 111 to 114 may be realized by using both software and hardware. Further, each of the functional units 111 to 114 is a conceptual component. A function executed by one component may be distributed to multiple components. Further, functions possessed by multiple components may be integrated into one component.

[0035] The setting unit 111 sets a goal task, which is a goal of reinforcement learning. That is, the controller 11 sets the goal task. The program stored in the memory unit 12 causes the computer to function as a means for setting a goal task. The goal task is input from the outside using, for example, an input device. The setting unit 11 sets the goal task in response to an instruction from the outside. The goal task may be generated by the controller 11 itself, for example, based on information on the applied product of the trained model (required performance related information, etc.). In this case, the design developer, etc. inputs the required performance related information, the design developer, etc. inputs the applied product type information and acquires the required performance related information from an external server, etc. based on the applied product type information.

[0036] Furthermore, the setting unit 111 sets a subtask separately from the goal task. The subtask is a task that is less difficult to achieve than the goal task. That is, the controller 11 sets a subtask that is less difficult than the goal task. The program causes the computer to function as a means for setting a subtask that is less difficult than the goal task. The subtask is input from the outside using, for example, an input device. The setting unit 11 sets the subtask in response to an instruction from the outside. Note that the subtask may be generated by the controller 11 itself, for example, a part of the goal task may be set as a subtask (such as by extracting a part of a predetermined percentage), or the performance of the goal task may be deteriorated by a predetermined percentage (such as by lengthening the task achievement time limit by a predetermined percentage).

[0037] The subtasks may be determined based on experience as long as the environment is not extremely different from the goal task. For example, in an example where reinforcement learning is used to control a robot arm, the goal task may be "grab an object and move it within X seconds (X is set arbitrarily)". In this case, the subtasks may be, for example, "grab an object and move it within 10 times X seconds" or "grab an object and move it without a time limit". As another example, in an example where reinforcement learning is used to control an autonomous mobile robot, the goal task may be "arrive from start point A to goal point B within X seconds". In this case, the subtasks may be, for example, "arrive from start point A to goal point B within 10 times X seconds" or "arrive from start point A to intermediate point C within X seconds".

[0038] The learning unit 112 causes the model 121 to perform reinforcement learning. In this embodiment, the reinforcement learning performed by the learning unit 112 includes learning performed to achieve a target task and learning performed to achieve a subtask. The former learning is learning for generating a model (trained model) that is originally desired to be obtained by performing reinforcement learning. The former learning can be said to be original reinforcement learning. The latter learning is learning performed on a trial basis to determine at least one of the number of states and the number of actions. In order to distinguish it from the former original reinforcement learning, the latter learning may be referred to as trial learning below. However, the learning flow is the same for both original learning and trial learning, except that the tasks to be achieved are different.

[0039] 5 is a diagram conceptually showing the functions of the learning unit 112 included in the learning device 1. The state observation unit 1121 acquires state information from a sensor (not shown) or the like provided outside the learning device 1. The number of sensors may be one or more. The state observation unit 1121 acquires, for example, information about the surrounding environment of the robot. Specifically, the state observation unit 1121 acquires state information such as the current position of the robot and the distance to a target point. The state observation unit 1121 provides the acquired state information to the model 121 and the reward calculation unit 1122.

[0040] The model 121 outputs a state action value, which is value information of an action, by inputting state information provided from the state observation unit 1121. For example, the model 121 outputs a Q value for the direction in which the robot moves. The Q value output from the model 121 is provided to the action decision unit 1123.

[0041] The behavior decision unit 1123 decides the behavior based on the value information output from the model 121. The behavior decision unit 1123 transmits the decided behavior information to a control device that controls the behavior. For example, in the case of a configuration in which a moving direction is decided as the behavior of the robot, the behavior decision unit 1123 decides the direction corresponding to the output node with the maximum Q value as the moving direction. The behavior decision unit 1123 transmits the decided moving direction, which is the behavior information, to a behavior control device that controls the behavior of the robot. The behavior control device moves the robot in the moving direction decided as the next behavior. The behavior control device may be the controller 11 itself, or may be a device other than the controller 11, such as a controller of a robot drive motor.

[0042] The reward calculation unit 1122 calculates a reward based on the state information provided by the state observation unit 1121. For example, when the task is to arrive at a goal point, the reward calculation unit 1122 adds a reward when the robot's position approaches the goal point, and subtracts a reward when the robot's position moves away from the goal point. The reward calculation unit 1122 provides the calculated reward to the reinforcement learning unit 1124.

[0043] The reinforcement learning unit 1124 performs machine learning of the model 121 based on the reward output from the reward calculation unit 1122. Specifically, the TD error (E[R+γmaxQ(s t+1 ,a t+1 )-Q(s t ,a t The weight coefficients of the model 121 are optimized by backpropagation or the like so that the weight coefficients of the model 121 approach zero.

[0044] Returning to Fig. 4, the achievement status acquisition unit 113 acquires the achievement status of the subtasks when the test learning is performed by each of the multiple test models. The test model refers to a model used in the test learning to determine at least one of the number of states and the number of actions. Each of the multiple test models is different from the other test models in at least one of the number of states and the number of actions.

[0045] That is, the controller 11 acquires the achievement status when a plurality of test models, each of which differs from each other in at least one of the number of states and the number of actions, is made to execute learning to accomplish a subtask. The program causes the computer to function as a means for acquiring the achievement status when a plurality of test models, each of which differs from each other in at least one of the number of states and the number of actions, is made to execute learning to accomplish a subtask.

[0046] A plurality of test models having different numbers of states and / or actions may be obtained by changing the number of samples of at least one of the state information and the action information. The number of samples of the state information can be changed, for example, by changing the resolution of the sensor information. The number of samples of the action information can be changed, for example, by changing the resolution of the output information of a motor or the like. The number of samples may be changed according to a command input from an input device, or may be changed automatically by the learning device 1.

[0047] The multiple test models may be realized using one model 121 stored in the memory unit 12. Test learning using each test model may be performed in sequence by changing the setting conditions of the model 121 at the start of each test learning. In another embodiment, each of the multiple test models may be prepared as a separate model. In this case, the multiple test models may be configured to be stored in the memory unit 12, or the models stored in the memory unit 12 may be replaced. The test model may be prepared separately from the model 121 that performs learning to achieve the target task.

[0048] Moreover, the test learning using each test model may be configured to execute at least one of a simulation and a test using the real thing. In other words, the achievement status when the test model executes learning to accomplish the subtask may be obtained by executing at least one of a simulation and a test using the real thing. If only a simulation is executed, the time required for test preparation can be reduced compared to when a test using the real thing is executed, so that the test learning can be completed in a short time. If a test using the real thing is executed, the reliability of the test results can be improved. If a combination of a simulation and a test using the real thing is executed, it can be expected that both a reduction in test time and an improvement in the reliability of the test results can be achieved.

[0049] In a configuration in which a test is performed using an actual object, for example, a memory in which a test model is stored may be mounted on a robot, and the robot may be made to perform actual actions and perform test learning. Test learning may be performed for each test model in turn while the robot is actually moving, and the achievement status of each subtask of the multiple test models may be obtained.

[0050] It is also possible to prepare a plurality of robots each equipped with a memory for storing different test models, and perform test learning of the plurality of test models in parallel. In such a configuration, the device constituting the learning unit 112 and the device constituting the achievement status acquisition unit 113 may be separate devices. This corresponds to an example in which the learning device 1 is composed of a plurality of devices. In this configuration, the achievement status acquisition unit 113 acquires the achievement status (result of learning) obtained for each device having the learning unit 112 from each device. It is also possible to use a configuration in which one robot is used, where the device constituting the learning unit 112 and the device constituting the achievement status acquisition unit 113 are separate devices.

[0051] In this embodiment, the achievement status acquired by the achievement status acquisition unit 113 is given by the number of episodes required for each of the multiple test models to accomplish the subtask (reach the goal of the test learning). That is, the achievement status acquisition unit 113 acquires the number of episodes executed until the subtask is accomplished when the multiple test models are made to execute the test learning. With this configuration, it is possible to easily compare the learning status using each test model.

[0052] The number of states / number of actions determining unit 114 determines at least one of the number of states and the number of actions of the model 121 that performs the above-mentioned original reinforcement learning, based on the achievement status acquired by the achievement status acquiring unit 113. That is, the controller 11 determines at least one of the number of states and the number of actions of the model 121 that performs learning to achieve the target task, according to the above-mentioned achievement status. The program causes the computer to function as a means for determining at least one of the number of states and the number of actions of the model 121 that performs learning to achieve the target task, according to the above-mentioned achievement status.

[0053] According to this embodiment, the number of states and the number of actions of the model that performs learning to achieve the target task can be made appropriate. That is, according to this embodiment, the size of the model 121 that performs learning can be made appropriate, and the calculation load for learning and the time required for learning can be made appropriate. Also, this embodiment is configured to determine the number of states and the number of actions by performing trial learning using a subtask whose environment is not extremely different from that of the target task. For this reason, according to this embodiment, the size of the model 121 can be easily made appropriate according to the content of the task and the operating environment.

[0054] As described above, in this embodiment, the achievement status is given by the number of episodes. At least one of the number of states and the number of actions of the model 121 is determined by comparing the number of episodes obtained for each of a plurality of test models. The number of episodes tends to vary depending on the number of states and the number of actions of the model, and this makes it easier to optimize the number of states and the number of actions of the model.

[0055] FIG. 6 is a graph showing a schematic relationship between the number of samplings and the number of episodes of subtask accomplishment. The number of samplings shown in FIG. 6 is the number of samplings of state information or behavior information. As described above, the number of samplings can be changed by changing the resolution of sensor information or motor output information, for example. The number of episodes of subtask accomplishment is the number of episodes required to accomplish a subtask when test learning is performed using a test model.

[0056] As shown in Figure 6, as the number of samplings of state information and behavior information increases, the number of episodes of subtask completion tends to decrease. And when the number of samplings increases to a certain extent, the number of episodes until the subtask is completed does not change much. In other words, the effect of the number of samplings on the number of episodes until the subtask is completed becomes smaller.

[0057] Considering the above points, in the present embodiment, as a preferred embodiment, at least one of the number of states and the number of actions of the model 121 is determined by detecting the start of convergence of the number of episodes until the achievement of the subtask obtained for each of the multiple test models. In detail, one of the number of states and the number of actions of the model 121 that starts to converge is determined as the number of states and the number of actions suitable for the model 121. More specifically, the state in which the number of episodes has converged refers to a state in which the number of episodes does not fluctuate with an increase in the number of samplings and becomes a constant value. The start of convergence can be detected by extracting a point where the number of episodes that fluctuated with an increase in the number of samplings begins to stop fluctuating. In the example shown in FIG. 6, the smallest sampling number α among the sampling numbers at which the number of episodes converges and becomes constant is extracted as the sampling number at the start of convergence of the number of episodes. The extracted sampling number is determined as the number of states and the number of actions suitable for the model 121. If the number of episodes for the achievement of the subtask can be reduced while reducing the number of samplings as much as possible, the calculation load can be reduced and the learning time can be shortened.

[0058] The method of determining the number of states and actions of a model using only one two-dimensional graph as in Figure 6 is suitable for cases where one of the number of states and actions of a model is determined without the need for testing, and only the other needs to be determined. When it is desired to determine appropriate numbers for both the number of states and the number of actions of a model, multiple test models are prepared in which both numbers are changed, and test learning is performed using each test model. In such cases, convergence may be assessed using a three-dimensional graph in which one of the X and Y axes represents the number of states and the other axis represents the number of actions, and the Z axis represents the number of episodes.

[0059] Note that as a result of performing multiple test learnings using multiple test models, it may not be possible to obtain a convergence state as shown in Fig. 6. In such a case, for example, the number of states or the number of actions of the test model that has the smallest number of episodes may be determined to be the appropriate number of states or the appropriate number of actions.

[0060] <3. Details of learning method> Next, a learning method using the learning device 1 will be described with reference to Fig. 7. Fig. 7 is a flowchart showing the flow of the learning method executed by the controller 11 of the learning device 1 according to an embodiment of the present invention. In detail, the flowchart shown in Fig. 7 corresponds to a flowchart showing a detailed flow of the process (step S1) of determining the number of states and the number of actions shown in Fig. 1. Note that the controller 11 executes these processes when triggered by, for example, a model manufacturing worker performing an operation to instruct the start of preliminary processing.

[0061] In step S11, the setting unit 111 sets a subtask. That is, the learning method of this embodiment includes setting a subtask having a lower level of difficulty than the target task. The setting unit 111 sets the subtask in response to an external command using an input device, for example. Once the subtask is set, the process proceeds to the next step S12.

[0062] In step S12, the learning unit 112 selects a combination of the number of states and the number of actions. The combination of the number of states and the number of actions is, for example, a combination of the number of samples of state information and the number of actions. The combination of the number of states and the number of actions may be selected in response to an external instruction using an input device. As another example, the memory unit 12 may be configured to store a plurality of combinations of the number of states and the number of actions in advance, and the combination of the number of states and the number of actions to be used for test learning may be automatically selected from the stored combinations. When the combination of the number of states and the number of actions is selected, the process proceeds to the next step S13. In this embodiment, the learning unit 112 (controller 11) sets a test model in response to the selection of the combination of the number of states and the number of actions.

[0063] In step S13, the learning unit 112 sets the number of episodes N to zero. When N=0, the process proceeds to the next step S14.

[0064] In step S14, the learning unit 112 starts trial learning using a test model having the number of states and the number of actions selected in step S12. In other words, the learning unit 112 starts trial learning using a test model with the selected number of samples. The start of trial learning here corresponds to the start of an episode. More specifically, trial learning is reinforcement learning whose goal is to accomplish the subtask set in step S11. Once trial learning has started, the process proceeds to the next step S15.

[0065] In step S15, the learning unit 112 monitors the end of the episode. The end of the episode includes the accomplishment of a subtask and the failure of the subtask. The failure of the subtask includes, for example, the robot ceasing to act or the subtask not being accomplished within a set time. If it is determined that the episode has not ended (No in step S15), the process of step S15 is repeated. If it is determined that the episode has ended (Yes in step S15), the process proceeds to the next step S16.

[0066] In step S16, the learning unit 112 adds 1 to the current episode number N. When the process of setting N=N+1 is executed, the process proceeds to the next step S17.

[0067] In step S17, the learning unit 112 determines whether the end of the episode is the accomplishment of the subtask. If the end of the episode is the accomplishment of the subtask (Yes in step S17), the process proceeds to the next step S18. If the end of the episode is the failure of the subtask (No in step S17), the process returns to step S14, and test learning of the next episode is started.

[0068] In step S18, the learning unit 112 stores the current episode number N in the memory unit 12 in association with the number of states and the number of actions of the currently used test model. In other words, the memory unit 12 stores the number of episodes N required to accomplish the subtask when test learning is performed with the currently used test model in the memory unit 12. When the storage process of the episode number N is completed, the process proceeds to the next step S19.

[0069] In step S19, the learning unit 112 judges whether or not the trial learning using all planned types of test models (all types of combinations of the planned number of states and number of actions) has been completed. If it is judged that the trial learning using all types of test models has been completed (Yes in step S19), the process proceeds to the next step S20. If it is judged that the trial learning using all types of test models has not been completed (No in step S19), the process returns to step S12, and the processes from step S12 onwards are carried out. In this case, in step S12, a combination of the number of states and the number of actions different from the combination of the number of states and the number of actions already selected is selected.

[0070] In step S20, the achievement status acquisition unit 113 acquires the achievement status stored in the memory unit 12 in the test learning using each test model. That is, the learning method of this embodiment includes acquiring the achievement status when learning for accomplishing the subtask is executed for each of a plurality of test models that differ from each other in at least one of the number of states and the number of actions. In detail, the achievement status acquisition unit 113 acquires the number of episodes required to accomplish the subtask in the test learning using each test model. The number of episodes is acquired by reading out information stored in the memory unit 12. When the acquisition of the achievement status (number of episodes) is completed, the process proceeds to the next step S21.

[0071] In step S21, the state number / action number determination unit 114 determines at least one of the state number and the action number of a model that performs reinforcement learning to achieve a target task, based on the achievement status (number of episodes) of the test learning for each test model acquired in step S20. As described above, the state number and action number can be determined based on the relationship between the state number or action number (sampling number) and the episode number. For example, when the number of episodes required to achieve a subtask converges with an increase in the sampling number, the convergence start point can be detected to determine the sampling number (number of states or number of actions).

[0072] As can be seen from the above, the learning method of this embodiment includes determining at least one of the number of states and the number of actions of a model that learns to achieve a target task according to the achievement status of subtasks. With such a configuration, the size of the model that learns can be made appropriate, and the computational load for learning and the time required for learning can be made appropriate. Conventionally, the number of states and the number of actions were determined by the empirical rules of engineers, and the size of the model that learns to achieve a target task was not necessarily appropriate, but with the configuration of this embodiment, the size of the model can be optimized without relying on the empirical rules of engineers.

[0073] Upon completion of the process of step S21, the process shown in FIG. 7 ends. Upon completion of the process shown in FIG. 7, the number of states and the number of actions of the model 121 that performs learning to achieve the target task are determined. Once the number of states and the number of actions of the model 121 are determined, reinforcement learning to achieve the target task is performed using the same model (with initialized parameters) as that used as the test model, or a newly prepared model (a model with the determined number of states and number of actions). This results in a trained model that achieves the target task. Note that the generation process of this trained model may be incorporated as a processing step following step S21 (integrated with the process of the flowchart in FIG. 7), and pre-processing and reinforcement learning may be performed as a series of processes.

[0074] That is, the method for generating (manufacturing) a trained model according to this embodiment is configured as follows: A trained model is generated by having a model having a number of states and a number of actions determined according to the achievement status when a plurality of test models, each of which differs from the other in at least one of the number of states and the number of actions, perform learning to achieve the target task.

[0075] According to such a configuration, when generating a trained model, the size of the model to be trained can be adjusted appropriately before starting the training. For this reason, the computational load and the training time in training (reinforcement learning) for achieving a target task can be optimized, and the trained model can be efficiently generated. The generated trained model may be stored in a computer-readable non-volatile recording medium and distributed. The generated trained model may be distributed from a server device to a terminal device, for example.

[0076] In the learning method described above, the number of subtasks for determining the number of states and the number of actions is one type. However, this is an example. The number of subtasks for determining the number of states and the like may be multiple types. For example, assume that the target task is the movement of an autonomous robot from point A to point B. In such a case, as described above, the subtask may be the movement from point A to intermediate point C. However, if the difficulty of the movement from point A to intermediate point C and the movement from intermediate point C to point B are extremely different, the number of states and the like determined may differ greatly between the case where the movement from point A to intermediate point C is the subtask and the case where the movement from intermediate point C to point B is the subtask. In such a case, the process of determining the number of states and the like may be performed using each of the above two subtasks. Then, the final number of states and the like may be determined by averaging the results obtained when using each subtask.

[0077] <4. Things to keep in mind> Various technical features disclosed in the description of the invention may be modified in various ways without departing from the spirit of the technical creation. Furthermore, the embodiments and modifications disclosed in the description of the invention may be combined to the extent possible. [Explanation of symbols]

[0078] 1. Learning device 11. Controller 121···Model

Claims

1. 1. A method of learning in which an apparatus uses a model to learn to accomplish a goal task, comprising: A subtask having a lower degree of difficulty than the target task and a plurality of test models having different numbers of states and / or different numbers of actions are set; A learning method for determining at least one of the number of states and the number of actions of a model that will learn to achieve the target task based on the progress achieved when learning to achieve the subtask is performed using the test model.

2. The learning method according to claim 1 , wherein the achievement status is given by a number of episodes required for each of the plurality of test models to accomplish the subtask.

3. The learning method according to claim 2 , wherein at least one of the number of states and the number of actions of the model is determined by comparing the number of episodes obtained for each of the plurality of test models.

4. The learning method according to claim 2 , wherein at least one of the number of states and the number of actions of the model is determined by detecting a start of convergence of the number of episodes obtained for each of the plurality of test models.

5. 5. The method according to claim 1, wherein the achievement status is obtained by carrying out at least one of a simulation and a test using an actual object.

6. A learning device including a controller and configured to learn to achieve a target task using a model, The controller: A subtask having a lower degree of difficulty than the target task and a plurality of test models having different numbers of states and / or different numbers of actions are set; A learning device that determines at least one of the number of states and the number of actions of a model that will learn to achieve the target task, based on the achievement status when learning to achieve the subtask is performed using the test model.

7. A program for causing a computer to execute a learning method for performing learning to achieve a target task using a model, The computer, Setting a subtask having a lower degree of difficulty than the target task and a plurality of test models having different numbers of states and / or actions; determining at least one of the number of states and the number of actions of a model to be subjected to learning for achieving the target task based on a progress status when learning for achieving the subtask is performed using the test model; and A program that serves as a means to

8. A method for generating a trained model, in which an apparatus performs learning to achieve a target task using a model to generate a trained model, A subtask having a lower degree of difficulty than the target task and a plurality of test models having different numbers of states and / or different numbers of actions are set; determining at least one of a number of states and a number of actions of a model that will learn to achieve the target task based on a progress status when learning to achieve the subtask is performed using the test model; A method for generating a trained model, comprising: performing learning for achieving the target task on a model having the determined number of states and number of actions to generate a trained model.

Citation Information

Patent Citations

  • Task execution agent system and method

    JP2022046402A