Patent Publication Number: US-2020276704-A1

Title: Determining control policies for robots with noise-tolerant structured exploration

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     In the United States, this application claims the benefit under 35 U.S.C. § 119(e) of the filing date of U.S. Patent Application No. 62/562,286, which was filed on Sep. 22, 2017, and the filing date of U.S. Patent Application No. 62/599,552, which was filed on Dec. 15, 2017, both of which are incorporated here by reference. 
    
    
     BACKGROUND 
     This specification relates to technologies for optimizing the determination of control policy parameters for robot motor skills and control policies through the performance of simulations of robots and real-world context to determine control policy parameters. 
     SUMMARY 
     This specification describes technologies that efficiently determine control parameters for a physical or simulated robot or for an object in a physics simulation or rendering process. 
     One novel aspect of the subject matter of this specification is a system, method, or a program of computer instructions for determining a control policy for a robot. The method, for example, comprises receiving a specification in the form of an objective function ƒ of a task to be performed by a robot, wherein ƒ is a scalar-valued objective function of a control policy, and the control policy determines, for each state s of the robot, an action u to be performed by the robot, and wherein the objective function ƒ represents how well the robot performs the task; and determining the control policy for the robot to perform the task by simulating operation of the robot to determine the control policy x* by solving an optimization problem of the form 
     
       
         
           
             
               
                 x 
                 * 
               
               = 
               
                 
                   argmin 
                   
                     x 
                     ∈ 
                     
                       ℝ 
                       n 
                     
                   
                 
                  
                 
                   f 
                    
                   
                     ( 
                     x 
                     ) 
                   
                 
               
             
             , 
           
         
       
     
     wherein x∈   n  is a state of the control policy encountered during the simulating of the operation of the robot, and wherein the solving the optimization problem comprises estimating gradients of the objective function ƒ using a finite difference procedure to estimate the gradients in perturbation directions defined by rows of a balanced spinner, balanced spinners being structured matrices that define a rotation or a linear transformation that is close to a rotation of a coordinate system of x. 
     Another novel aspect of the subject matter of this specification is a system, method, or a program of computer instructions for determining a control policy for a robot. The method, for example, comprises determining a control policy for a robot that has dynamics defined by a dynamics function ƒ, wherein x t+1 =ƒ(x t ,u t ) is a state x t+1  at time t+1 after the robot receives control input u t  when the robot is in state x t , the determining of the control policy comprising simulating operation of the robot to determine the control policy, including solving a trajectory optimization problem having a cost function that represents the task of the form 
     
       
         
           
             
               
                 argmin 
                 
                   
                     u 
                     0 
                   
                    
                   
                       
                   
                    
                   … 
                    
                   
                       
                   
                    
                   
                     u 
                     
                       T 
                       - 
                       1 
                     
                   
                 
               
                
               
                 
                   ∑ 
                   
                     t 
                     = 
                     0 
                   
                   
                     T 
                     - 
                     1 
                   
                 
                  
                 
                   
                     c 
                     t 
                   
                    
                   
                     ( 
                     
                       
                         x 
                         t 
                       
                       , 
                       
                         u 
                         t 
                       
                     
                     ) 
                   
                 
               
             
             + 
             
               
                 c 
                 T 
               
                
               
                 ( 
                 
                   x 
                   T 
                 
                 ) 
               
             
           
         
       
     
     wherein time T is an optimization horizon, c t  and C T  are stage-wise and terminal cost functions, respectively, and the control policy comprises the sequence of actions u 0  . . . u T−1 , and wherein the solving the trajectory optimization problem comprises linearizing ƒ locally using a finite difference procedure to estimate Jacobians of ƒ at times t, comprising estimating ƒ at times t in perturbation directions defined by rows of a balanced spinner, balanced spinners being structured matrices that define a rotation or a linear transformation that is close to a rotation of a coordinate system of ƒ at times t. 
     The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages. The technologies can easily be plugged into mature optimization routines, including solvers for general purpose nonlinear programming that can handle complex constraints, that are difficult to explicitly incorporate in existing model-free reinforcement learning approaches. Using parameter perturbation directions defined by a family of structured orthogonal matrices, the structured finite differences described in this specification consistently gives high quality approximations of gradients and Jacobians in comparison to approaches that use coordinate directions or random Gaussian perturbations in estimating gradients by finite differences. Trajectory optimizers like Iterative LQR (linear-quadratic regulator) and Differential Dynamic Programming require fewer iterations to solve several classic continuous control tasks when the techniques described in this specification are used to linearize noisy, blackbox dynamics instead of standard finite differences. With structured exploration as described in this specification embedded in a quasi-Newton optimizer, Limited-memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS), a simulation is able to learn agile walking and turning policies for quadruped locomotion that successfully transfer from simulation to actual hardware. 
     The use of structured orthogonal matrices to define parameter variation directions can result in an optimization processes exhibiting robustness to the noise that is typically present in many continuous control tasks. As a result, optimization processes using the structured orthogonal matrices, such as the balanced spinners described herein, can result in a faster convergence when compared with other finite difference approaches. This can result in a reduction in the time taken to optimize (and a reduction in the computational expense of optimizing) a control policy for a robot. This can, in turn, enable a wider range of potential designs to be virtually tested and examined for suitability before real world testing of said robot is performed. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  is a block diagram illustrating elements of a simulation system for simulation of a robot. 
         FIG. 2  is a flowchart illustrating an example method for determining a control policy for a robot. 
         FIG. 3  is a block diagram illustrating elements of another simulation system for simulation of a robot. 
         FIG. 4  is a flowchart illustrating another example method for determining a control policy for a robot. 
     
    
    
     DETAILED DESCRIPTION 
       FIG. 1  is a block diagram illustrating elements of a simulation system  100  for simulation of a robot. 
     A simulation system  102  for simulation of a robot includes a physics engine  104  and a 3D renderer  106 . A simulation of a robot learns a control policy and, generally, motor skills  108 , which can be transferred to a real-world, hardware robot  110 . The simulation system receives, for any simulation, description data  112  describing simulated robot and objects in the simulated world and parameters  114  specifying a virtual world. 
     A simulation is specified ( 120 ) by simulation optimization variables x∈   n , possibly constrained to live in a subset Ω, specifying, e.g., bound constraints. The objective function, ƒ, is a scalar-valued function of the internal states x encountered during the simulation. Every time ƒ is evaluated at x, the evaluation returns ƒ(x)+ε(x) where ε(x) is a noise term. 
       FIG. 2  is a flowchart illustrating an example method for determining a control policy for a robot using a simulation system of the kind illustrated in  FIG. 1 . The method receives a specification in the form of an objective function ƒ of a task to be performed by a robot ( 202 ). The objective function ƒ is a scalar-valued objective function of a control policy, and the control policy determines, for each state s of the robot, an action u to be performed by the robot. The objective function ƒ represents how well the robot performs the task. The method determines ( 204 ) the control policy for the robot to perform the task by simulating operation of the robot to determine the control policy x* by solving an optimization problem of the form 
     
       
         
           
             
               x 
               * 
             
             = 
             
               
                 
                   arg 
                    
                   min 
                 
                 
                   x 
                   ∈ 
                   
                     ℝ 
                     n 
                   
                 
               
                
               
                 
                   f 
                    
                   
                     ( 
                     x 
                     ) 
                   
                 
                 . 
               
             
           
         
       
     
     The term x∈   n  is a state of the control policy encountered during the simulating of the operation of the robot. Solving the optimization problem includes estimating gradients of the objective function ƒ using a finite difference procedure to estimate the gradients in perturbation directions defined by rows of a balanced spinner ( 206 ). Balanced spinners are structured matrices that define a rotation or a linear transformation that is close to a rotation of a coordinate system of x. When the control policy has been determined by the simulation, it is transferred to the robot ( 208 ). 
     Balanced spinners can be characterized as (α,β)-balanced spinners. An (α,β)-balanced spinner for 0&lt;α≤1 and 0&lt;β≤1 is a matrix M={M i,j } i,j=1 . . . n ∈   n  that is invertible and for which the following are true:
         (1) ∥m i ∥ 2 ≥α√{square root over (n)} and sup i,j∈{1, . . . , n} |M i,j |≤1; and   (2) |m i   τ m j |≤(1−β)min i=1, . . . n ∥m i ∥ 2  for 1≤i&lt;j≤n, where m i   τ  stands for the i-th row of M.       

     For defining gradients, better balanced spinners are characterized by β≈1, which have rows that are nearly orthogonal. An advantageous balanced spinner is an (α,β)-balanced spinner wherein α and β each differ from 1 by a respective amount that is not more than about k/√n, wherein k≈1 is a constant and n is the dimensionality of x, in which case the rows of the structured matrix are nearly orthogonal and the structured matrix defines a linear transformation that is close to a rotation of the coordinate system of x. Another advantageous example is an (α,β)-balanced spinner where α=1 and β=1 and the structured matrix defines a rotation of the coordinate system of x. 
     Particular families of (1,1)-balanced spinners that can be used in the method include Hadamard matrices and quadratic residue matrices. Other forms of (1,1)-balanced spinners that can be used are of the form MD, wherein M is a (1,1)-balanced spinner and D is a diagonal matrix D∈   n  with diagonal entries that are either −1 or +1. Other forms also include a Hadamard matrix right multiplied by a diagonal matrix D with diagonal entries that are either −1 or +1. In some implementations, in either diagonal matrix X the diagonal entries of the diagonal matrix are taken independently at random from the set {−1, +1}. 
     Hadamard matrices are matrices that have the form M=B 1 ⊗ . . . ⊗B l , where B 1 = . . . =B l ∈{−1,+1} 2×2 , B 1 [i][j] if i≠1 or j≠1, B 1 [1][1]=−1, and ⊗ stands for the Kronecker product. 
     A quadratic residue matrix is obtained by the following construction, in which p is a prime number of the form p=4t+3, where t is a natural number. A tournament T is defined to as a complete directed graph without multi-edges. A quadratic residue tournament T p  is a tournament on p vertices {0, 1, . . . , p−1}, where an edge exists from i to j for 0≤i,j≤p−1, if and only if i−j is a quadratic residue modulo p. Then, an adjacency matrix Q p ∈{−1,1} p×p  of the quadratic residue tournament T p  is a matrix such that for i≠j, Q p [i][j]=1 if there is an edge from i to j in T p  and −1 otherwise, and Q p [i][i]=1. Q* p ∈   (p+1)×(p+1)  denotes a matrix defined as Q* p [i][j]=−1 if i=0 or j=0 and Q* p [i][j]=Q p   τ [i−1][j−1] otherwise. The matrix (Q* p ) τ  is a quadratic residue matrix. 
     The control policy  108  for the robot is, in some implementations, a parameterized control policy and the x is a vectorized version of the parameters of the control policy. 
     In some implementations, the control policy for the robot is represented by weights and biases of a neural network model, and determining the control policy includes training the neural network to minimize the objective function ƒ to learn the control policy. 
     In some implementations, determining the control policy for the robot includes performing reinforcement learning policy optimization; and wherein ƒ is a negative of an expected return over the simulation. 
     Advantageously, in some implementations, estimating gradients of the objective function ƒ ( 206 ) includes estimating the gradients of the object function ƒ by fast matrix-vector multiplication of the structured matrix using an Fast Walsh-Hadamard Transform or a Fast Fourier Transform. 
     After the control policy is transferred to the robot, one can cause the robot to operate under control of the control policy ( 210 ). 
       FIG. 3  is a block diagram illustrating elements of a simulation system  300  for simulation of a robot. 
     A simulation system  302  for simulation of a robot includes a physics engine  304  and a 3D renderer  306 . A simulation of a robot learns a control policy  308 , which can be transferred to a real-world, hardware robot  310 . The simulation system receives, for any simulation, description data  312  describing simulated robot and objects in the simulated world and parameters  314  specifying a virtual world. 
     A simulation is specified ( 320 ) by a dynamics function ƒ that defines the dynamics of the robot, which determines x t+1 =ƒ(x t ,u t ) as a next state x t+1  at time t+1 after the robot receives control input u t  when the robot is in state x t . And by a stage-wise cost function c t  and a terminal cost function c T . 
       FIG. 4  is a flowchart illustrating an example method for determining a control policy for a robot using a simulation system of the kind illustrated in  FIG. 3 . The method receives a specification of a dynamics function of the robot and cost functions that specify a task to be performed by the robot ( 402 ). Determining the control policy includes simulating operation of the robot to determine the control policy ( 404 ), including solving a trajectory optimization problem having a cost function of the following form that represents the task: 
     
       
         
           
             
               
                 argmin 
                 
                   
                     u 
                     0 
                   
                    
                   
                       
                   
                    
                   … 
                    
                   
                       
                   
                    
                   
                     u 
                     
                       T 
                       - 
                       1 
                     
                   
                 
               
                
               
                 
                   ∑ 
                   
                     t 
                     = 
                     0 
                   
                   
                     T 
                     - 
                     1 
                   
                 
                  
                 
                   
                     c 
                     t 
                   
                    
                   
                     ( 
                     
                       
                         x 
                         t 
                       
                       , 
                       
                         u 
                         t 
                       
                     
                     ) 
                   
                 
               
             
             + 
             
               
                 
                   c 
                   T 
                 
                  
                 
                   ( 
                   
                     x 
                     T 
                   
                   ) 
                 
               
               . 
             
           
         
       
     
     Here, time T is an optimization horizon, c t  and c T  are stage-wise and terminal cost functions, respectively, and the control policy is or includes the sequence of actions u 0  . . . u T−1 . Solving the trajectory optimization problem includes linearizing the dynamics function ƒ locally using a finite difference procedure to estimate Jacobians of ƒ at times t. The gradients are estimated in perturbation directions defined by rows of a balanced spinner ( 406 ). Balanced spinners are structured matrices that define a define a rotation or a linear transformation that is close to a rotation of a coordinate system of ƒ at times t. 
     When the control policy has been determined by the simulation, it is transfer to the robot ( 408 ). 
     The robot can then be caused to operate under control of the control policy ( 410 ). 
     In some implementations, the control policy  308  for the robot is represented by weights and biases of a neural network model, and determining the control policy includes training the neural network to minimize the cost function of learning the control policy. 
     In some implementations, evaluations of ƒ at a state x and an action u return ƒ(x,u)+ε(x), where ε(x) is a noise term. 
     Advantageously, in some implementations, estimating gradients of the objective function ƒ ( 406 ) includes estimating the gradients of the object function ƒ by fast matrix-vector multiplication of the structured matrix using an Fast Walsh-Hadamard Transform or a Fast Fourier Transform. 
     Each of the systems and methods described above can be used to develop control policies for a variety of real-world robots, including an autonomous vehicle operating on legs or wheels or a flying autonomous vehicle. For robots with legs and that perform walking and turning actions, the control policy can define a walking and turning action. In particular, for robots that can perform autonomous quadruped locomotion, the control policy can define quadruped locomotion. Likewise, for a robot that is a vehicle operating on wheels, the control policy can define a maneuver performed by the vehicle, which can be, for example, a parking maneuver. In other scenarios, the robot is a robot arm with multiple degrees of freedom, e.g., five or more degrees of freedom, and the control policy defines a motion for the robot arm. In some cases, the robot arm has an end effector and the control policy defines a motion to a target goal position. 
     Embodiments of the subject matter and the functional operations described in this specification can 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 program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or in addition, the program instructions can be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus. The computer storage medium can 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. The computer storage medium is not, however, a propagated signal. 
     The term “data processing apparatus” encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can include special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). The apparatus can also include, in addition to hardware, code that creates an execution environment for the computer program in question, 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, a software application, a module, a software module, a 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 computer 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 that are located at one site or distributed across multiple sites and interconnected by a communication network. 
     As used in this specification, the term “engine” refers to a software implemented input/output system that provides an output that is different from the input. An engine can be an encoded block of functionality, such as a library, a platform, a software development kit (“SDK”), or an object. Each engine can be implemented on any appropriate type of computing device, e.g., servers, mobile phones, tablet computers, notebook computers, music players, e-book readers, laptop or desktop computers, PDAs, smart phones, or other stationary or portable devices, that includes one or more processors and computer readable media. Additionally, two or more of the engines may be implemented on the same computing device, or on different computing devices. 
     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 apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application specific integrated circuit). For example, the processes and logic flows can be performed by and apparatus can also be implemented as a graphics processing unit (GPU). 
     Computers suitable for the execution of a computer program include, by way of example, can be based on general or special purpose microprocessors 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. The essential 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. 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, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just 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 by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto optical disks; and CD ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. 
     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, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user&#39;s client device in response to requests received from the web browser. 
     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 client computer having a graphical user interface or a Web browser 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”), e.g., the Internet. 
     The computing system can 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. 
     While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention 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 the claimed combination may be directed to a subcombination or variation of a subcombination. 
     Similarly, while operations are depicted in the drawings 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 certain circumstances, 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. 
     Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited 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 certain implementations, multitasking and parallel processing may be advantageous.