TRAINING REINFORCEMENT LEARNING AGENTS USING AUGMENTED TEMPORAL DIFFERENCE LEARNING

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for training a neural network used to select actions performed by an agent interacting with an environment by performing actions that cause the environment to transition states. One of the methods includes training the neural network on one or more transitions selected from a replay memory, including: generating, using the neural network, an action selection output for the current observation; determining, based on the action selection output and the current action performed by the agent in response to the current observation, a state-action target for the current observation; determining a gradient of a temporal difference (TD) loss function with respect to parameters of the neural network, wherein the TD loss function comprises a first term that depends on the state-action target for the current observation; and adjusting current parameter values of the neural network based on the gradient.

BACKGROUND

This specification relates to reinforcement learning.

In a reinforcement learning system, an agent interacts with an environment by performing actions that are selected by the reinforcement learning system in response to receiving observations that characterize the current state of the environment.

Some reinforcement learning systems select the action to be performed by the agent in response to receiving a given observation in accordance with an output of a neural network.

SUMMARY

This specification describes a system implemented as computer programs on one or more computers in one or more locations that controls an agent using a control neural network system to perform one or more tasks.

In general, one innovative aspect of the subject matter described in this specification can be embodied in a method for training a neural network used to select actions performed by a reinforcement learning agent interacting with an environment by performing actions that cause the environment to transition states, the method comprising: maintaining a replay memory, the replay memory storing a plurality of transitions generated as a result of the reinforcement learning agent interacting with the environment, each transition comprising a respective current observation characterizing a respective current state of the environment, a respective current action performed by the agent in response to the current observation, a respective next observation characterizing a respective next state of the environment, and a reward received in response to the agent performing the current action; selecting one or more transitions from the replay memory; and training the neural network on the one or more transitions, comprising, for each transition of the one or more transitions: generating, using the neural network, an action selection output for the current observation that defines a probability distribution over a set of possible actions that can be performed by the agent in response to the current observation; determining, based on the action selection output and the current action performed by the agent in response to the current observation, a state-action target for the current observation included in the transition; determining a gradient of a temporal difference (TD) loss function with respect to parameters of the neural network, wherein the TD loss function comprises a first term that depends on the state-action target for the current observation and a second term that depends on a TD learning target for the transition; and adjusting current parameter values of the neural network based on the gradient.

The neural network may be configured to process the current observation and each action in a set of possible actions to output a respective Q value for the action that is an estimate of a return that would be received if the agent performed the action in response to the current observation. Generating the action selection output may comprise generating, from the respective Q values for the actions in the set of possible actions, the probability distribution that assigns a respective probability to each action.

The state-action target may be based on a probability assigned to the current action according to the probability distribution defined by the action selection output.

The first term of the TD loss function that depends on the state-action target may be of form α log A, where A may be the probability assigned to the current action according to the probability distribution defined by the action selection output generated by the neural network based on processing the current observation and each action in the set of possible actions, and a may be a tunable parameter.

Determining the second term that depends on the TD learning target for the transition may comprise: processing the next observation and each action in a set of possible next actions that can be performed by the agent in response to the next observation using the neural network to generate a respective Q value for the next action that is an estimate of a return that would be received if the agent performed the next action in response to the next observation; and generating, from the respective Q values for the set of possible next actions, an action selection output for the next observation defining a probability distribution that assigns a respective probability to each next action.

Determining the second term that depends on the TD learning target for the transition may comprise computing a sum of (i) the reward included in the transition and (ii) a time-adjusted next expected return if a next action is performed in response to the next observation included in the transition.

The time-adjusted next expected return may comprise a weighted sum of estimated returns that would be received by the agent if the agent performed each next action from the set of possible next actions in response to the next observation included in the transition, where respective weights of the estimated returns are determined according to the respective probabilities assigned to the set of possible next actions.

The next expected return may depend at least on an entropy of the action selection output for the next observation.

The time-adjusted next expected return may comprise a weighted sum of entropy-adjusted estimated returns that would be received by the agent if the agent performed each next action from the set of possible next actions in response to the next observation included in the transition.

The TD loss function may measure a difference between (i) a sum of the first term that depends on the state-action target for the current observation and the second term that depends on the TD learning target for the transition and (ii) a Q value for the current action included in the transition.

The method may further comprise determining whether a norm of the first term of the TD loss function that depends on the state-action target exceeds a particular threshold; and when the norm of the first term of the TD loss function exceeds the particular threshold: clipping the first term of the TD loss function to equal to the particular threshold.

Generating the current action selection output may comprise: processing, using a target instance of the neural network and in accordance with target parameter values of the neural network, the current observation and each action in the set of possible actions to output the respective Q value for the action that is the estimate of the return that would be received if the agent performed the action in response to the current observation.

Another innovative aspect of the subject matter described in this specification can be embodied in a method comprising receiving a new observation characterizing a new state of the environment being interacted with by the agent; processing the new observation and each action in a set of possible actions that can be performed by the agent in response to the new observation using a neural network to generate a respective Q value for the action that is an estimate of a return that would be received if the agent performed the action in response to the new observation, wherein the neural network has been trained using the method of any preceding method; selecting, from the set of possible actions, an action based on the respective Q values; and causing the agent to perform the selected action.

The disclosed technique allows for training data from a replay memory to be utilized in a way that increases the value of the selected data for training a neural network used in selecting actions to be performed by agents. In particular, this technique augments a temporal difference (TD) learning target conventionally used in computing a loss function for training the neural network with an additional component that depends on a quality of a currently selected action, e.g., in terms of currently estimated returns (i.e., estimated returns determined by using the neural network in accordance with current values of the network parameters as of the training) to be received by the agent as a result of performing the currently selected action at the current state of the environment. Training neural network using this technique thus provides the neural network with richer training signals that come from the evaluation of the current action selection policy adopted by the system, i.e., as of the training stage. Compared with conventional TD training schemes, neural networks can perform more useful generalizations from training data to generate higher quality action selection outputs that can improve the returns resulting from the agent performing these selected actions.

This can, in turn, increase the effectiveness, efficiency, or both of training of neural networks used in selecting actions to be performed by agents. Thus, the amount of computing resources necessary for the training of the neural networks to achieve a desired level of performance can be reduced. For example, the amount of time required for training the neural network can be reduced, the amount of processing resources (e.g., memory, computing power, or both) used by the training process can be reduced, or both. The increased effectiveness in training of neural networks can be especially significant for complex neural networks that are harder to train or for training neural networks to select actions to be performed by agents performing complex reinforcement learning tasks.

DETAILED DESCRIPTION

This specification describes a reinforcement learning system that controls an agent interacting with an environment by, at each of multiple time steps, processing data characterizing the current state of the environment at the time step (i.e., an “observation”) to select an action to be performed by the agent.

At each time step, the state of the environment at the time step depends on the state of the environment at the previous time step and the action performed by the agent at the previous time step.

In some implementations, the environment is a real-world environment and the agent is a mechanical agent interacting with the real-world environment, e.g., a robot or an autonomous or semi-autonomous land, air, or sea vehicle navigating through the environment.

In these implementations, the observations may include, e.g., one or more of: images, object position data, and sensor data to capture observations as the agent interacts with the environment, for example sensor data from an image, distance, or position sensor or from an actuator.

For example in the case of a robot, the observations may include data characterizing the current state of the robot, e.g., one or more of: joint position, joint velocity, joint force, torque or acceleration, e.g., gravity-compensated torque feedback, and global or relative pose of an item held by the robot.

In the case of a robot or other mechanical agent or vehicle the observations may similarly include one or more of the position, linear or angular velocity, force, torque or acceleration, and global or relative pose of one or more parts of the agent. The observations may be defined in 1, 2 or 3 dimensions, and may be absolute and/or relative observations.

The observations may also include, for example, sensed electronic signals such as motor current or a temperature signal; and/or image or video data for example from a camera or a LIDAR sensor, e.g., data from sensors of the agent or data from sensors that are located separately from the agent in the environment.

In these implementations, the actions may be control inputs to control the robot, e.g., torques for the joints of the robot or higher-level control commands, or the autonomous or semi-autonomous land, air, sea vehicle, e.g., torques to the control surface or other control elements e.g., steering control elements of the vehicle, or higher-level control commands.

In other words, the actions can include for example, position, velocity, or force/torque/acceleration data for one or more joints of a robot or parts of another mechanical agent. Action data may additionally or alternatively include electronic control data such as motor control data, or more generally data for controlling one or more electronic devices within the environment the control of which has an effect on the observed state of the environment. For example in the case of an autonomous or semi-autonomous land or air or sea vehicle the actions may include actions to control navigation e.g., steering, and movement e.g., braking and/or acceleration of the vehicle.

In the case of an electronic agent the observations may include data from one or more sensors monitoring part of a plant or service facility such as current, voltage, power, temperature and other sensors and/or electronic signals representing the functioning of electronic and/or mechanical items of equipment. For example the real-world environment may be a manufacturing plant or service facility, the observations may relate to operation of the plant or facility, for example to resource usage such as power consumption, and the agent may control actions or operations in the plant/facility, for example to reduce resource usage. In some other implementations the real-world environment may be a renewal energy plant, the observations may relate to operation of the plant, for example to maximize present or future planned electrical power generation, and the agent may control actions or operations in the plant to achieve this.

In some other applications the agent may control actions in a real-world environment including items of equipment, for example in a data center, in a power/water distribution system, or in a manufacturing plant or service facility. The observations may then relate to operation of the plant or facility. For example the observations may include observations of power or water usage by equipment, or observations of power generation or distribution control, or observations of usage of a resource or of waste production. The actions may include actions controlling or imposing operating conditions on items of equipment of the plant/facility, and/or actions that result in changes to settings in the operation of the plant/facility e.g., to adjust or turn on/off components of the plant/facility.

As another example, the environment may be a chemical synthesis or protein folding environment such that each state is a respective state of a protein chain or of one or more intermediates or precursor chemicals and the agent is a computer system for determining how to fold the protein chain or synthesize the chemical. In this example, the actions are possible folding actions for folding the protein chain or actions for assembling precursor chemicals/intermediates and the result to be achieved may include, e.g., folding the protein so that the protein is stable and so that it achieves a particular biological function or providing a valid synthetic route for the chemical. As another example, the agent may be a mechanical agent that performs or controls the protein folding actions or chemical synthesis steps selected by the system automatically without human interaction. The observations may comprise direct or indirect observations of a state of the protein or chemical/intermediates/precursors and/or may be derived from simulation.

In some implementations the environment may be a simulated environment and the agent may be implemented as one or more computers interacting with the simulated environment.

The simulated environment may be a motion simulation environment, e.g., a driving simulation or a flight simulation, and the agent may be a simulated vehicle navigating through the motion simulation. In these implementations, the actions may be control inputs to control the simulated user or simulated vehicle.

In some implementations, the simulated environment may be a simulation of a particular real-world environment. For example, the system may be used to select actions in the simulated environment during training or evaluation of the control neural network and, after training or evaluation or both are complete, may be deployed for controlling a real-world agent in the real-world environment that is simulated by the simulated environment. This can avoid unnecessary wear and tear on and damage to the real-world environment or real-world agent and can allow the control neural network to be trained and evaluated on situations that occur rarely or are difficult to re-create in the real-world environment.

Generally, in the case of a simulated environment, the observations may include simulated versions of one or more of the previously described observations or types of observations and the actions may include simulated versions of one or more of the previously described actions or types of actions.

Optionally, in any of the above implementations, the observation at any given time step may include data from a previous time step that may be beneficial in characterizing the environment, e.g., the action performed at the previous time step, the reward received at the previous time step, and so on.

FIG. 1shows an example reinforcement learning system100. The reinforcement learning system100is an example of a system implemented as computer programs on one or more computers in one or more locations in which the systems, components, and techniques described below are implemented.

The system100controls an agent102interacting with an environment104by selecting actions106to be performed by the agent102and then causing the agent102to perform the selected actions106.

Performance of the selected actions106by the agent102generally causes the environment104to transition into new states. By repeatedly causing the agent102to act in the environment104, the system100can control the agent102to complete a specified task.

The system100includes a control neural network system110which includes an action selection neural network120, a training engine140, and one or more memories storing the parameters of the control neural network system110, including a set of network parameters118of the action selection neural network120.

At each of multiple time steps, the action selection neural network120is configured to process an input that includes the current observation108characterizing the current state of the environment104in accordance with the network parameters118to generate an action selection output122.

The action selection neural network120can be implemented with any appropriate neural network architecture that enables it to perform its described function. In one example, the action selection neural network120may include a sequence of one or more convolutional layers, followed by a sequence of one or more fully connected layers associated with an activation layer (e.g., a ReLU activation layer), and an output layer that generates the action selection output122.

The system100uses the action selection output122to control the agent, i.e., to select the action106to be performed by the agent at the current time step in accordance with an action selection policy and then cause the agent to perform the action106, e.g., by directly transmitting control signals to the agent or by transmitting data identifying the action106to a control system for the agent.

In response to some or all of the actions performed by the agent102, the reinforcement learning system100receives a reward. Each reward is a numeric value received from the environment104as a consequence of the agent performing an action, i.e., the reward will be different depending on the state that the environment104transitions into as a result of the agent102performing the action.

A few examples of using the action selection output122to select the action106to be performed by the agent are described next.

In one example, the action selection output122may include a respective Q value for each action in the set of possible actions a E A that can be performed by the agent.

The Q value for an action is an estimate of a “return” that would result from the agent performing the action in response to the current observation120and thereafter selecting future actions performed by the agent102in accordance with current values of the control neural network parameters.

A return refers to a cumulative measure of reward received by the system100as the agent104interacts with the environment106over multiple time steps. For example, a return may refer to a long-term time-discounted cumulative reward received by the system100.

As described above, the agent can receive a respective reward at each time step, where the reward is specified by a scalar numerical value and characterizes, e.g., a progress of the agent towards completing a specified task.

In another example, the action selection output122may include a respective advantage value for each action in the set of possible actions that can be performed by the agent, which is a measure of how much is a possible action a good or bad decision given a current state—or more simply, what is the advantage of selecting a particular action for the current state over other possible actions. Advantage values may differ from Q values for small time steps in that the differences between advantage values in a given state are larger than the differences between Q values.

In either example, the system100can select the action to be performed by the agent based on the action selection output122using any of a variety of action selection policies, e.g., by selecting the action with the highest Q value or advantage value, or by mapping the Q values or advantage values to probabilities and sampling an action in accordance with the probabilities. In some cases, the system100can select the action to be performed by the agent in accordance with an exploration policy. For example, the exploration policy may be an ϵ-greedy exploration policy, where the system100selects the action to be performed by the agent in accordance with the action selection output122with probability 1-ϵ, and randomly selects the action with probability ϵ. In this example, ϵ is a scalar value between 0 and 1.

In yet another example, the action selection output122may include an estimated quantile value for a probability value (each of which can be a number in the range [0,1]) with respect to a probability distribution over possible returns that would result from the agent performing the action in response to the observation. The quantile value for a probability value with respect to a return distribution refers to a threshold return value below which random draws from the return distribution would fall with probability given by the probability value. Put another way, the quantile value for a probability value with respect to a return distribution can be obtained by evaluating the inverse of the cumulative distribution function (CDF) for the return distribution at the probability value. That is, integrating a probability density function for a return distribution up to the quantile value for a probability value would yield the probability value itself.

In this example, for each given action from the set of possible actions that can be performed by the agent102, the system100randomly samples one or more probability values and, for each probability value, generates an estimated quantile value for the probability value with respect to the return distribution that would result from the agent performing the given action in response to the current observation. For each action, the system100determines a corresponding measure of central tendency (where a “measure of central tendency” is a single value that attempts to describe a set of data by identifying a central position within that set of data, i.e., a central or typical value) of the respective set of one or more quantile values for the action. For example, the measure of central tendency may be a mean, a median, or a mode.

The system100selects an action106to be performed by the agent102at the time step based on the measures of central tendency corresponding to the actions. In some implementations, the system100selects an action having a highest corresponding measure of central tendency from amongst all the actions in the set of actions that can be performed by the agent102. In some implementations, the system100selects an action in accordance with an exploration strategy. For example, the system100may use an ϵ-greedy exploration strategy. In this example, the system100may select an action having a highest corresponding measure of central tendency with probability 1-ϵ, and select an action randomly with probability ϵ, where ϵ is a number between 0 and 1.

The training engine140is configured to train the action selection neural network system120included in the control neural network system110by repeatedly updating the network parameters118of the action selection neural network system120based on the interactions of the agent with the environment. This can allow for the agent106to more effectively interact with the environment104.

To assist in the training of the action selection neural network120, the training engine140maintains a replay memory150that is accessible to the system.

The replay memory150stores pieces of experience data (referred to below as “transitions”) generated as a consequence of the interaction of the agent102or another agent with the environment104or with another instance of the environment for use in training the action selection network120.

The training engine140trains the action selection neural network120by repeatedly selecting the transitions from the replay memory150and training the action selection neural network120on the selected transitions. In particular, the training engine performs the training using an augmented temporal difference learning scheme.

The augmented TD learning training of the system will be described further below with reference toFIGS. 2 and 3, but in short, the system evaluates a TD loss function that includes a first term that depends on the state-action target for the current observation and a second term that depends on a temporal difference learning target for the transition. The incorporation of the state-action target as an additional component in the TD loss function extends the effectiveness of conventional temporal difference learning training scheme which merely considers a standard temporal difference learning target, i.e., which merely involves computing a sum of: (a) a time-discounted next expected return if a next action is performed in response to the next observation in the transition and (b) the reward in the transition.

FIG. 2is a flow diagram of an example process200for training an action selection neural network. For convenience, the process200will be described as being performed by a system of one or more computers located in one or more locations. For example, a system, e.g., the reinforcement learning system100ofFIG. 1, appropriately programmed, can perform the process200.

The system maintains a replay memory (202). As described above, the replay memory stories a plurality of transitions generated as a result of the reinforcement learning agent (or another agent) interacting with the environment (or with another instance of the environment).

In some implementations, each transition is a tuple that includes: (1) a current observation stcharacterizing the current state of the environment at one time; (2) a current action αtperformed by the agent in response to the current observation; (3) a next observation st+1characterizing the next state of the environment after the agent performs the current action, i.e., a state that the environment transitioned into as a result of the agent performing the current action; and (4) a reward rtreceived in response to the agent performing the current action.

The system selects one or more transitions from the replay memory (204). The system can select a transition either randomly or according to a prioritized strategy, e.g., based on the value of an associated temporal difference learning error or some other learning progress measure.

To train the action selection neural network on the one or more transitions, the system can repeatedly perform the followings steps206-212for each transition of the one or more transitions.

The system generates, using the action selection neural network, an action selection output for the current observation (206).

In some implementations, the action selection neural network is configured to process the current observation and each action in a set of possible actions to output a respective Q value for the action that is an estimate of a return that would be received if the agent performed the action in response to the current observation. Alternatively, in some other implementations, the action selection neural network is configured to process the current observation and each action in a set of possible actions to output a respective advantage value for the action that is a measure of an advantage, i.e., in terms of a return, of selecting the action over other possible actions in response to the current observation.

In these implementations, the system can generate the action selection output by mapping the respective Q values or advantage values for the actions in the set of possible actions to the probability distribution that defines a probability distribution over a set of possible actions that can be performed by the agent in response to the current observation, i.e., assigns a respective probability to each possible action.

In some implementations, the action selection neural network is configured to process an input tuple including (i) an action from the set of possible actions that can be performed by the agent, (ii) a current observation, and (iii) a probability value (which can be a number in the range [0,1]). The system can use the action selection neural network to process the input tuple to generate an action selection output that includes an estimated quantile value for the probability value with respect to a probability distribution over possible returns that would result from the agent performing the action in response to the observation.

In some such implementations, rather than processing an action—observation—probability value tuple, the action selection neural network may be configured to process an observation—probability value tuple (i.e., without the action). In these implementations, the system can use the action selection neural network to process the input tuple to generate an action selection output that includes respective estimated quantile values for the probability value with respect to the respective return distributions that would result from the agent performing each action in a set of possible actions in response to the observation.

The system determines, based on the action selection output and the current action performed by the agent in response to the current observation, a state-action target for the current observation included in the transition (208). For example, in cases where the (output layer of the) action selection neural network directly parameterizes a probability distribution, the state-action target can be dependent on a probability assigned to the current action according to the probability distribution defined by the action selection output. Alternatively, the system can map the action selection output to a probability distribution over a set of possible actions and thereafter determine the state-action target. For example, the probability distribution can be determined from the respective Q values or advantage values generated for the actions in the set of possible actions, e.g., by processing the Q values or advantage values using a softmax function. As another example, the probability distribution can be determined from the estimated quantile values for the probability value with respect to the respective return distributions generated for the actions in the set of possible actions.

The system determines a gradient of a temporal difference (TD) loss function with respect to parameters of the action selection neural network (210). That is, the system first evaluates a temporal difference (TD) loss function, and then determines, e.g., through backpropagation, a gradient of the TD loss function with respect to the action selection network parameters.

Evaluating the TD loss function will be further described below with reference toFIG. 3, but in short, the TD loss function includes a first term that depends on the state-action target for the current observation and a second term that depends on a temporal difference learning target for the transition.

The system adjusts current parameter values of the action selection neural network based on the gradient (212). The system can adjust the current parameter values of the action selection neural network by applying an update rule to gradient, e.g., a stochastic gradient descent update rule, an Adam optimizer update rule, an rmsProp update rule, or a learned update rule that is specific to the training of the action selection neural network.

FIG. 3is a flow diagram of an example process300for evaluating a temporal difference (TD) loss function for use in training an action selection neural network. For convenience, the process300will be described as being performed by a system of one or more computers located in one or more locations. For example, a system, e.g., the reinforcement learning system100ofFIG. 1, appropriately programmed, can perform the process300.

The system determines a first term that depends on the state-action target for the current observation (302).

In some implementations, the first term of the TD loss function that depends on the state-action target is of form α log A, where A is the probability assigned to the current action according to the probability distribution defined by the action selection output generated by the action selection neural network based on processing the current observation and each action in the set of possible actions, and α is a tunable parameter which may be computed as a product of a scaling factor α (the value of which can be in the range [0, 1], e.g., 0.9) and a temperature parameter τ (the value of which can be any positive number, e.g., 0.03).

For example, the system can determine the first term as α ln πθ(αt|st), where πθ(αt|st) is the probably assigned to action αtby the probability distribution conditioned on the current observation in the transition, as generated by the system from the Q value outputs of the neural network in accordance with current values of the network parameters θ.

In some implementations, the system can require the value of the first term of the TD loss function that depends on the state-action target to be within a bounded range, so as to alleviate any numerical issues that would otherwise arise in cases where the action selection output becomes too deterministic. For example, the system can determine whether a norm of the first term exceeds a particular threshold l0and, whenever the norm of the first term of the TD loss function exceeds the particular threshold, the system clips the first term of the TD loss function to equal to the particular threshold. For example, the particular threshold can be a positive integer, e.g., one.

The system determines a second term that depends on a TD learning target for the transition (304). The TD learning target for the transition can be a sum of (i) the reward included in the transition and (ii) a time-adjusted next expected return if a next action is performed in response to the next observation included in the transition.

The manner in which the system selects the next action α′ and determines the next expected return is dependent on the reinforcement learning algorithm being used to train the neural network. For example, in a deep Q learning technique, the system selects as the next action the action that, when provided as input to a target neural network in combination with the next observation, results in the target neural network outputting the highest Q value and uses the Q value for the next action that is generated by the target neural network as the next return. As another example, in a double deep Q learning technique, the system selects as the next action the action that, when provided as input to the neural network in combination with the next observation, results in the target neural network outputting the highest Q value and uses the Q value generated by providing the next action and the next observation as input to the target neural network as the next return. The target neural network is another instance of the neural network that has the same architecture as the action selection neural network, but that may have different parameter values.

In either example, the time-adjusted next expected return can be alternatively computed as a weighted sum of estimated returns that would be received by the agent if the agent performed each next action from the set of possible next actions in response to the next observation included in the transition, where respective weights of the estimated returns are determined according to the respective probabilities assigned to the set of possible next actions, which may include a non-zero value (e.g., one) to the selected next action and zero values to the remaining actions from the set of possible next actions.

In other words, to determine the second term that depends on the TD learning target for the transition, the system can process the next observation and each action in a set of possible next actions that can be performed by the agent in response to the next observation using the neural network (or the target instance of the neural network) to generate a respective Q value for the next action that is an estimate of a return that would be received if the agent performed the next action in response to the next observation. The system then generates, from the respective Q values for the set of possible next actions, an action selection output for the next observation defining a probability distribution that assigns a respective probability to each next action.

In some implementations, the time-adjusted next expected return included in the TD learning target depends on an entropy of the action selection output for the next observation, i.e., also includes a weighted sum of entropy-adjusted estimated returns that would be received by the agent if the agent performed each next action from the set of possible next actions in response to the next observation included in the transition. The entropy, which can be computed as πθ(α′|st+1), may be scaled by the temperature parameter τ the value of which can be any positive number, e.g., 0.03.

In the case of Q learning, i.e., in the implementations where the action selection neural network is configured to process the current observation and each action in a set of possible actions to output a respective Q value, the TD loss function can measure a difference between (i) a sum of the first term that depends on the state-action target for the current observation and the second term that depends on the TD learning target for the transition and (ii) a Q value for the current action included in the transition. To determine the Q value for the current action, the system can process an input that includes the current action and the current observation using the action selection neural network in accordance with current values of the action selection network parameters.

In such cases, to determine the sum of the first and second terms of the TD loss function, the system can compute:

where the first term is evaluated as ατ ln πθ(αt|st), with α and τ being the scaling factor and temperature parameter, respectively, and the second term is evaluated as the reward rtincluded in the transition plus the term in the summation operator that is weighted by a time-discounting parameter γ the value of which can be in the range [0, 1], e.g., 0.99.

The first term which is evaluated as a scaled logarithm of the action selection output computed by using the neural network can result in performance improvement of the agent when controlled using the system. This is also very unlike the traditional temporal difference learning training scheme, which may evaluate the TD target for the loss function as:

where sm refer to the softmax operator, and θ andθrefer to current parameter values of the action selection neural network and the target instance of the action selection neural network, respectively, i.e., without evaluating the state-action target for the current observation.

Correspondingly, the system can evaluate the TD loss function as:

where h the Huber loss function, with a parameter xh, h(x)=x2if x<xhelse |x|.

In the case of advantage learning (as a special case of Q learning where τ=0), i.e., in the implementations where the action selection neural network is configured to process the current observation and each action in a set of possible actions to output a respective advantage value for the action that is a measure of an advantage, the system can evaluate the TD loss function as:

where the first term that depends on the state-action target for the current observation is computed as

In the case of quantile function approximation learning, i.e., in the implementations where the action selection neural network is configured to process an input tuple including (i) an action from the set of possible actions that can be performed by the agent, (ii) a current observation, and (iii) a probability value to output an estimated quantile values for the probability value with respect to the respective return distributions that would result from the agent performing the action in response to the current observation, the system can evaluate the TD loss function by computing an expectation of a Huber loss function applied to a TD error. The TD error can be evaluated as:

where σ, σ′∈[0,1], and where the return distributions are approximated by using the z-function:

from which the Q values may be estimated by computing qπ(s,α)=[zπ(s,α)], e.g., by using Monte Carlo methods. In this case, the first term that depends on the state-action target for the current observation is computed as

In any of these cases, the system can additionally incorporate n-step bootstrapping methods into the training when evaluating the temporal difference (TD) loss function. In n-step bootstrapping, the system evaluates the TD learning target for a transition over multiple next times steps subsequent to the current time step:

which is a sum of (i) the current reward rtincluded in the transition and (ii) a time-adjusted next expected return if n next steps are performed, and where n can be any positive integer greater than one, e.g., three. N-step returns can be considered approximations of a full return for an entire episode, truncated after n steps and then corrected for the remaining steps by Vt+n−2(rt+n−1), i.e., a n-th expected return if a n-th action is performed in response to the n-th observation following the current observation Stincluded in the transition. In various cases, N-step returns may lead to faster training.