This application claims priority from U.S. patent application No. 62/773,932, filed on 30/11/2018, the entire contents of which are incorporated herein by reference.
Detailed Description
FIG. 1 illustrates an example control system 100. The control system 100 is an example of a system implemented as a computer program on one or more computers located at one or more locations in which the systems, components, and techniques described below are implemented.
The system 100 includes a strategic neural network 110, a training engine 150, and one or more memories storing a set of strategic parameters 118 and temperature parameters 152 of the strategic neural network 110.
The system 100 controls the robot 102 to interact with the environment 104 by selecting an action 106 to be performed by the robot 102 and then causing the robot 102 to perform the selected action 106.
The robot 102 executing the selected action 106 typically transitions the environment 104 to a new state. By repeatedly causing the robot 102 to perform actions in the environment 104, the system 100 may control the robot 102 to complete a specified task. For example, the task may be an industrial robot task involving navigating in an environment, moving an object in an environment, or both.
In particular, the control system 100 controls the robot 102 by using the strategic neural network 110 to cause the robot 102 to perform specified tasks in the environment 104.
The policy neural network 110 is a neural network having parameters (referred to herein as "policy parameters") that receives a state representation 120 characterizing the state of the environment 104 with which the robot 102 interacts, and generates a policy output 122, the policy output 122 defining a probability distribution over a set of possible actions that may be performed by the robot 102.
Each action in the set of possible actions is typically a multi-dimensional action, such as a multi-dimensional vector. For example, each dimension may correspond to a different joint or motor of the robot 102 and may be a control input for the joint or motor, such as a torque to be applied to the joint or a position or setting of the motor. As an example, if a robot is controlled by eight actuator motors positioned at different points along the frame of the robot, each action will typically be an eight-dimensional vector, where each dimension corresponds to one of the eight motors, and the value in that dimension corresponds to the expected motor position for that motor.
When the set of actions is discrete, the policy output 122 may include a respective probability for each action in the set. When the set of actions is continuous, the policy output 122 may include, for each dimension, parameters of the distribution over possible values of the dimension, such as mean and covariance of a gaussian distribution.
Generally, the state representation 120 is generated from sensor data captured by sensors of the robot 102. For example, the state representation 120 may include observations comprising one or more sensor readings that characterize the current state of the robot 102, such as sensors for measuring the angles of certain joints or motors of the robot 102, an IMU for measuring the orientation and angular velocity of the robot 102, and so forth.
In some cases, the observations may also include images captured by a camera sensor, laser data captured by a laser sensor, or both.
In some cases, the state representation 120 includes additional data, such as one or more recently received observations in addition to the current observations, data specifying the most recent action performed by the robot, or data 100 specifying the most recent reward 124 received by the system 100.
The policy neural network 110 may have any suitable neural network architecture that allows the policy neural network 110 to map the received state representation 120 to the policy output 122. For example, when the state representation 120 includes high-dimensional image or laser data, the strategic neural network 110 may be a convolutional neural network. As another example, the policy neural network 110 may be a multi-layered perceptron when the state representation 120 includes only relatively low-dimensional inputs (e.g., sensor readings used to characterize the current state of the robot).
The system 100 uses the policy output 122 to control the robot, i.e. to select an action 106 to be performed by the robot at the current time step according to an action selection policy, and then to cause the robot to perform the action 106, e.g. by transmitting a control signal directly to the robot, or by transmitting data identifying the action 106 to the control system of the robot 102.
The system 100 may select an action to be performed by the robot 102 based on the action selection output 122 by using any of a variety of action selection strategies, such as by sampling the actions according to their probability values, or by selecting the action with the highest probability value.
The system 100 may receive a respective reward 124 at each time step, where the reward 124 is specified by a scalar value and characterizes, for example, the progress of the robot 102 toward completing a specified task.
To improve control of the robot 102, the training engine 150 repeatedly updates the strategy parameters 118 of the strategic neural network 110 to cause the strategic neural network 110 to generate more accurate strategy outputs, i.e., strategy outputs that result in the system 100 receiving a higher reward 124, and thus, improve the performance of the robot 102 on the intended task. In other words, the training engine 150 trains the strategic neural network 110 by repeatedly updating the strategic parameters 118.
Specifically, the training engine 150 updates the policy parameters 118 by using a maximum entropy reinforcement learning technique. In this technique, the training engine 150 updates the policy parameters 118 to maximize both (i) reward terms that measure the total reward in the tuples in the trace data used for the update and (ii) entropy terms that measure the entropy of the probability distribution defined by the policy output generated by processing the state representation in the tuples in the trace data according to the current values of the policy parameters. While the "entropy" term refers throughout to measuring the 'entropy' of a probability distribution, it is to be understood that the "entropy" term typically measures the differential entropy of a probability distribution when the action space is continuous (and the output of the policy network is a parameter of a continuous probability distribution).
Each trajectory in the trajectory data is a sequence of tuples, wherein each tuple includes a state representation, an action performed in response to the state representation, and a reward earned in response to the robot performing the action.
The relative weight between the entropy and bonus items in the maximization is determined by a parameter referred to as the temperature parameter 152. For example, the entropy term may be multiplied by a temperature parameter optimized in the overall target. That is, the objective function may include an overall term that is the difference between the reward term and the product of the temperature parameter 152 and the entropy term.
Specifically, the objective function J (pi) may satisfy:
where E is the desired operator and τ is the trajectory sampled from the trajectory distribution resulting from the strategic neural network π, i.e., the trajectory generated by selecting an action from the strategic output 122 generated by the strategic neural network 110, the trajectory comprising time steps 0 through T, r(s)t,at) As the robot 102 responds to the status representation stPerforming action atThe reward received by the system 100 as a result of(s), pi(s)t,at) Is assigned to action a in a probability distribution generated by processing the state representation st using a strategic neural networktAnd α is a temperature parameter.
Unlike conventional maximum entropy reinforcement learning techniques, which treat the temperature parameter 152 as a hyperparameter that must be set prior to training, the training engine 152 also repeatedly updates the temperature parameter 152 as the strategy parameters 118 are updated, i.e., in conjunction with training the strategy neural network 110. In particular, the training engine 150 repeatedly updates the temperature parameter 152 to adjust the desired entropy of the probability distribution defined by the output of the strategic neural network 110 to be at least equal to (i.e., greater than or equal to) the minimum desired entropy value.
Training the neural network 110 and updating the temperature parameter 152 is described in more detail below with reference to fig. 2 and 3.
FIG. 2 is a flow diagram of an example process 200 for training a policy neural network. For convenience, process 200 will be described as being performed by a system of one or more computers located at one or more locations. For example, a suitably programmed control system (e.g., control system 100 of FIG. 1) may perform process 200.
The system may repeatedly perform process 200 on trajectory data (e.g., trajectory data sampled from a replay buffer or other memory used to store trajectory data generated as a result of the robot interacting with the environment while being controlled by a strategic neural network or some other control strategy) to train the strategic neural network and adjust the temperature parameter in conjunction with the training.
The system obtains trajectory data (step 202). The trajectory data includes one or more tuples, wherein each tuple identifies a state representation for characterizing a state of the environment, an action performed by the robot while the environment is in the state characterized by the state representation, a reward received in response to the robot performing the action, and a next state representation for characterizing a next state of the environment after the robot performs the action.
Using the trajectory data, the system updates the current value of the policy parameter by using a maximum entropy reinforcement learning technique that maximizes both (i) an incentive item that measures the total reward in a tuple in the trajectory data and (ii) an entropy item that measures the entropy of a probability distribution defined by policy outputs generated by processing state representations in the tuple in the trajectory data according to the current value of the policy parameter, wherein a relative weight between the entropy item and the incentive item in the maximization is determined by the current temperature parameter (step 204).
Typically, as part of such updating, the system processes each state representation in each tuple in the trajectory data by using a policy neural network to generate a policy output for the state representation in accordance with the current values of the policy parameters.
More specifically, the system may determine the update by using the current temperature parameter and any suitable maximum entropy reinforcement learning technique. As a specific example, the system may use the Soft actuator-Critic (Flexible actuation-evaluation, SAC) algorithm to determine updates to the current values of the policy parameters. In the SAC algorithm, the entropy term is scaled by, i.e. multiplied by, the current temperature parameter value before calculating the error and gradient. The SAC algorithm is described in more detail in "Soft Actor-Critic: Off-Policy Maximum Entropy estimation Learning with a Stochastic Actor" (available in arXiv: 1801.01290) published by Haarnoja et al in 2018.
The system updates the temperature parameters by using a probability distribution defined by the policy output generated from the current values of the policy parameters for the tuples in the trajectory data (step 206). In particular, the system updates the temperature parameter to adjust the desired entropy of the probability distribution defined by the policy output to be at least equal to a minimum desired entropy value.
The minimum desired entropy value is a fixed value that adjusts the desired minimum entropy of the probability distribution defined by the strategy output generated by the strategic neural network during the training.
In some embodiments, the minimum desired entropy is a constant provided as an input to the system.
In some other embodiments, the system determines a minimum desired entropy value prior to performing the training. For example, when the action space is continuous, the minimum desired entropy value may be determined based on the number of action dimensions of the actions in the set of possible actions. As a particular example, the minimum desired entropy value may be the negative of the number of action dimensions, i.e., such that when there are eight action dimensions, the minimum desired entropy value will be-8.
Typically, the system determines the update by using an objective function that depends on the temperature parameter, the entropy of the probability distribution, and the minimum desired entropy value for each of the probability distributions.
As a particular example, the objective function J (α) may satisfy
Where α is the temperature parameter, E is the desired operator, a
tIs for the t-th tuple by processing the state representation s in the tuple according to the current values of the policy parameters
tAnd from the strategic neural network pi
tThe generated probability distribution is sampled, and
is the minimum desired entropy value.
As can be seen from the above formula for the objective function J (α), the optimizer for the objective function J (α) is always plus or minus infinity, since the function ignores the dependence of the probability distribution generated by the strategic neural network on the temperature parameter. Thus, instead of minimizing J (α), the system takes only one (or a few) gradient steps for the minimization at each iteration, and then updates πtTo better match the updated alpha, i.e., jointly update the reinforcement learning objective and J (alpha) by dual gradient descent.
Updating the current temperature parameter is described in more detail below with reference to fig. 3.
FIG. 3 is a flow diagram of an example process 300 for updating a current temperature parameter. For convenience, process 300 will be described as being performed by a system of one or more computers located at one or more locations. For example, a suitably programmed control system (e.g., control system 100 of FIG. 1) may perform process 300.
For each tuple, the system samples an action from a probability distribution generated by the policy neural network for the tuple (step 302). In other words, the system selects an action from a set of possible actions, where each action has a probability of being selected that depends on (e.g., is equal to) the probability of that action in the probability distribution.
For each tuple, the system determines the gradient of the objective function with respect to the temperature parameter, i.e., the difference between (i) the negative of the logarithm of the probability assigned to the sampled action by the probability distribution and (ii) the minimum desired entropy value (step 304).
The system combines the gradients of the tuples (step 306), i.e. by summing or averaging the gradients of the tuples, and determines an update to the temperature parameter from the combined gradients (step 308). The system may determine the update by applying an update rule (e.g., an ADAM update rule or a random gradient descent update rule) to the combined gradient used to determine the update.
The system then applies the update to the current temperature parameter, i.e., subtracts the update from the current temperature parameter, to determine an updated temperature parameter (step 310).
The illustration of process 300 describes taking one gradient step for each tuple to update the temperature parameter. In some cases, the system performs multiple gradient steps (i.e., two, five, or ten gradient steps) to iterate before determining a final update to the current temperature parameter.
The term "configured" is used herein in connection with system and computer program components. For a system of one or more computers, to be configured to perform a particular operation or action means that software, firmware, hardware, or a combination thereof, which in operation causes the system to perform the operation or action, has been installed on the system. For one or more computer programs, to be configured to perform certain operations or actions means that the one or more programs comprise instructions which, when executed by data processing apparatus, cause the apparatus to perform the operations or actions.
Embodiments of the subject matter described in this specification and their functional operations may be implemented in digital electronic circuitry, in tangibly embodied computer software or firmware, in computer hardware (including the structures disclosed in this specification and their structural equivalents), or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on a tangible, non-transitory storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. Alternatively or additionally, the program instructions may be encoded on an artificially generated propagated signal, such as a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by the data processing apparatus.
The term "data processing apparatus" refers to data processing hardware and encompasses all kinds of apparatus, devices and machines for processing data, including, for example: a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further comprise, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for the computer program, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them.
A computer program (which may also be referred to or described as a program, software application, app, module, software module, script, or code) can be written in any form of programming language, including compiled or interpreted languages or declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data (e.g., one or more scripts stored in a markup language document), in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code). A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a data communication network.
In this specification, the term "database" is used broadly to refer to any collection of data classes: the data need not be structured in any particular way, or at all, and it may be stored in one or more storage devices in one or more locations. Thus, for example, the index database may include multiple data class sets, each of which may be organized and accessed differently.
Similarly, in this specification, the term "engine" is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more particular functions. Typically, the engine will be implemented as one or more software modules or components installed on one or more computers located at one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines may be installed and run on the same computer or computers.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by, and in combination with, special purpose logic circuitry, e.g., an FPGA or an ASIC, or a combination of special purpose logic circuitry and one or more programmed computers.
A computer suitable for executing a computer program may be based on a general-purpose or special-purpose microprocessor or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. Elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, the computer need not have such devices. Moreover, a computer may be embedded in another device, e.g., a mobile telephone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game player, a Global Positioning System (GPS) receiver, or a portable storage device (e.g., a Universal Serial Bus (USB) flash drive), to name a few.
Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including: for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., an internal hard disk or a removable disk), magneto-optical disks, CD-ROM disks, and DVD-ROM disks.
To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having: a display device for displaying information to a user, such as a CRT (cathode ray tube) or LCD (liquid crystal display) monitor; and a keyboard and a pointing device, such as a mouse or a trackball, by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback, such as visual feedback, auditory feedback, or tactile feedback; and input from the user may be received in any form, including acoustic, speech, or tactile input. Additionally, the computer may interact with the user by sending documents to and receiving documents from a device used by the user (e.g., by sending web pages to a web browser on the user's device in response to requests received from the web browser). Moreover, the computer may interact with the user by sending a text message or other form of message to a personal device (e.g., a smart phone running a messaging application) and receiving a response message back from the user.
The data processing apparatus for implementing a machine learning model may further comprise: for example, dedicated hardware accelerator units for handling machine learning training or production (i.e., reasoning), common parts of workloads, and compute intensive parts.
The machine learning model may be implemented and deployed using a machine learning framework (e.g., a TensorFlow framework, a Microsoft Cognitive Toolkit framework, an Apache Singa framework, or an Apache MXNet framework).
Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification), or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network ("LAN") and a wide area network ("WAN"), such as the Internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, the server transmits data (e.g., HTML pages) to the user device, for example, for displaying data to and receiving user input from a user interacting with the device (which acts as a client). Data generated at the user device (e.g., the result of the user interaction) may be received at the server from the device.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any inventions or of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination. And claimed combinations may be directed to subcombinations or variations of subcombinations.
Similarly, while operations are depicted in the drawings and described in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions set forth in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.