Reinforcement learning (RL) is an artificial intelligence approach that solves for automatic control policies, , that map the state space inputs to the control command outputs
. The training of the RL policies is through the interaction of the agent and the environment, which is often modeled using a Markov Decision Process (MDP). The RL has been successful in solving many robotics and automation problems in simulations as well as real-world scenarios (Levine (2016))(Hessel et al. (2018))(Kahn et al. (2018)). However, the wide application of the RL in automation is slowed down by several challenges, and one of the main challenges is the difficulty of RL policy training. The RL policy generally takes a great amount of computation power to train for complicated control tasks, and what makes it worse is that the RL policies are optimized based on certain fixed MDPs, and the knowledge encoded inside an optimized control policy are hard to transfer to other similar tasks. That is, new RL policies have to be trained from scratch even for those control tasks that are very similar to the pretrained task, which leads to a great amount of computation power waste.
Unlike the existing transfer learning approaches (Rusu et al. (2016a)) (Daftry et al. (2016)) that are lack of interpretable transferable features, we propose to decompose the complicated control problems in terms of its consisting requirement constraints, which we call attributes. The conception attributes refer especially to global characteristics or requirements that take effect throughout the task. For example, to solve an autonomous driving problem, we can first decompose the requirements of the task into a base target reaching attribute, an add-on obstacle avoidance and a speed limit attribute. Our methodology includes training an attribute module for each of the attributes and then assembling the attribute modules together to produce the overall policy. To deal with tasks under different attributes, we propose an RL framework called the cascade attribute network (CAN). In CAN, the attribute modules are connected in the cascade series. Our method has two main intriguing advantages:
The decomposed attribute modules are much easier and faster to train compared with the overall control policy.
The attribute related knowledge is encoded in interpretable modules, which can be built up to create versatile policies that can adjust to changes in the control tasks.
2 Related Work and Background
2.1 Related Work
There have been lots of attempts to create versatile intelligence that can adjust to changes in the tasks as well. Transfer learning (Taylor and Stone (2009)) is a key tool that makes the use of previously learned knowledge for the better or faster learning of new knowledge. Rusu et al (Rusu et al. (2016a))(Rusu et al. (2016b)) establish a progressive network, in which newly added columns are laterally connected to previously learned columns for knowledge transfer. Drafty et al (Daftry et al. (2016)) and Braylan et al (Braylan et al. (2016)) also design network architectures for knowledge transfer in MAV control and video game playing. Barreto et al (Barreto et al. (2017))(Barreto et al. (2019)
) propose a scheme based on successor features, a value function describing the dynamics of the environment and a generalized policy improvement over multiple policies. In this way, the method can provide an efficient transferring among different tasks where the reward function is changed but the dynamics of the system remains the same. As for the combinations of transfer learning and imitation learning, Ammar et al (Ammar et al. (2015)
) use unsupervised learning to map states for transfer, assuming the existence of distance function between different state spaces. Gupta et al (Gupta et al. (2017)) learn an invariant feature between different dimensional states and use demonstrations to increase the density of the rewards. Our recent works (Xu et al. (2018))(Tang et al. (2019)) on transfer learning utilizes interpretable trajectory as transferrable feature, but the human engineered features lack the versatility to be applied in various robotic control areas.
There are other methods seeking to learn a globally general policy: Curriculum learning (CL)(Bengio et al. (2009)) trains a model on a sequence of cognate tasks that get more and more challenging gradually, so as to solve hard tasks that could not be learned from scratch. Florensa et al (Florensa et al. (2017)) apply reverse curriculum generation (RCL) in RL. In the early stage of the training process, the RCL initializes the agent state to be very close to the target state, making the policy very easy to train. They then gradually increase the random level of the initial state as the RL model performs better and better. Sanmit et al (Narvekar and Stone (2019)) formulate the curriculum learning sequence as an MDP process, which can also be learned from experience. These results show that with a good consideration of the nature of the problem, CL can help reinforcement learning have a better convergence speed. Our policy training strategy is inspired by the idea of CL and achieved satisfying robustness for the policies. There are also researches in training modular neural networks, (Devin et al. (2017)) investigates the combinations of multiple robots and tasks, while (Andreas et al. (2017)) investigates the combinations of multiple sequential subtasks. Our work, along with our parallel work (Xu et al. (2019)) different from those works, looks into modularization in a different dimension. We investigate the modularization of attributes, the characteristics or requirements that take effect throughout the whole task.
3 The Cascade Attribute Networks
3.1 Problem Formulation
We consider an agent with a state-space performing a class of tasks built up with one base attribute and a series of add-on attributes. We model the control tasks and the attribute in a unified form using MDPs. We denote the attributes using their index , where the attribute is the base attribute, which usually corresponds to the most fundamental goal of the task, such as the target reaching attribute in the autonomous driving task. We define the state space of each attribute to be the minimum state space that fully characterizes the attribute, denoted . For example, let the base attribute be the target reaching attribute, and the attribute be the obstacle avoidance attribute. Then consists of the states of the agent and the target, while consists of the states of the agent and the obstacle, but does not include the states of the target. Using the attribute as elements, one can build various control tasks, such as pure target reaching, target reaching while avoiding an obstacle, target reaching under external force influence, and so on.
Each attribute has an unique reward function as well, denoted . Each is a function mapping a state action pair to a real number reward, i.e. .
3.2 Network Architecture
The architecture of the CAN is shown in Fig. 1. The training for a task with more than one attribute is divided into two parts: the training of the base attribute module and the add-on attribute module. In the training phase, first, an RL policy is trained to accomplish the goal of the base attribute. The base attribute network takes in and outputs , the reward function of the MDP is given by . This process is a default RL training process.
Consider the control task with more than one attribute, without loss of generality, the add-on attribute module is trained next, in a series of the base attribute module. The attribute module consists of a compensation network and a weighted sum operator. The compensation network is fed with state , and action chosen by . The output of the compensation network is the compensation action , which is used to compensate to produce the overall action . The reward for the MDP is given by so that the requirements for both constraints of attributes are satisfied. Since the parameters of the base attribute network are pretrained and fixed, the cascading attribute network would extract the features of the attribute by exploring the new MDP under the guidance of the base policy. It is noted that in the add-on attribute module, the weight of the compensation action is initiated to be small and increased over the training time. That is, at the early stage of the training process, mainly takes effect, while gradually gets to influence the overall as the training goes on. For the other attributes, the training of their attribute networks is the same.
Empirical results also show that for cases, where the number of the add-on attributes is small, and different add-on attributes do not entangle with each other, with carefully designed training schemes, the CAN shown in Fig. 2 can be used to provide an ideal control policy. In the CAN shown in Fig. 2, the attribute module takes in and , and outputs that satisfies all the attribute before the module. The final output is the overall output that satisfies all the constraints in the constraint array.
4.1 Environmental Setup
The experiments are powered by the MuJoCo physics simulator (Todorov et al. (2012)
). The attribute modules in our experiments are all three-layer fully connected networks which output Gaussian distributed stochastic actions, built using TensorFlow. The baseline RL algorithm we use is the PPO (Schulman et al. (2017)) method with GAE (Schulman (2015)
) as the advantage estimator.
We evaluate the capability of the CAN on two types of robot scenarios in our experiments. One is a point robot with a 2-dimensional action space, and the other is an articulated robot with a 5-dimensional action space. For the point robot, the state space includes the position and velocity of the robot, and the action vector is the driving force applied to it. For the articulated robot the state spaces are the angle and angular velocity at all the joints, and the x-position and speed of the base of the robot, while the action vector includes the torques at all the joints, and the force applied to the base of the robot. For each robot agent, we implement one base attribute and four different add-on attributes. For each different attribute, we designed a reward function. The attribute settings and reward functions are described as follow:
4.1.1 Reaching (base attribute)
Target reaching task, a common robot task, is defined to be the base attribute for both robot scenarios in our experiment. Given initial configuration and location of the target, the robots aim to to reach the target zone using their end effector. The reward function is shown below:
4.1.2 Obstacle (position phase)
In our obstacle avoidance attribute, a moving circular obstacle is placed in the work area. In our implementation, one obstacle avoidance attribute correspond to one circular obstacle. Nevertheless, many obstacle attributes are allowed to be assembled together to create a more complicated environment. The reward function is represented as following:
4.1.3 Automated door (time phase)
The automated door attribute is a time controlled obstacle. This door is closed in the first and will open at some specific time slots. This attribute is challenging to train using RL since it punishes the agent even if it goes to the right direction at a wrong time. The reward function is designed as following:
4.1.4 Speed limit (velocity phase)
Practical robots always have dynamic constraints on their joints which limit their speeds. The speed limit at time t, L(t), is designed to be a time-variant function as shown in Fig 6. Denote the maximum joint velocity as . Reward function can be written as:
4.1.5 Force disturbance (acceleration phase)
In working scenarios, a robot can be influenced by force disturbance or repulsion force on their joints. The force disturbance attribute in our experiment corresponds to a time-invariant force disturbance added to a certain joint of both point robot and articulated robot.
The force disturbance only affects the dynamics function of the robot system, with no additional reward function added.
4.2 Training Schemes
To guarantee the capacity of the CAN, the attribute modules need to meet two requirements:
The base attribute policies should be robust over the state space, rather than being effective only at the states that are close to the optimal trajectory. This enables the base attribute policies to be instructive when a compensation action is added on the top of it.
The compensation action for a certain attribute should be close to zero if the agent is in a state where this attribute is not active. This property increases the capability of multi-attribute structures.
For the sake of the robustness of the attribute policies, we apply CL to learn a general policy that can accomplish the task starting from any initial state. The CL algorithm first trains a policy with a fixed initial state. As the training goes on, the random level of the initial state is smoothly increased, until the initial state is randomly sampled from the whole state space. The random level is increased only if the policy is capable enough for the current random level, which is reflected by the increase of the episodic reward. The pseudocode for this process is shown in Algorithm 1.
To guarantee the second requirement, an extra loss term that punishes the magnitude of the compensative action, , is added to the reward function so as to reduce when attribute is not active.
4.3 CAN Performance
The first set of experiments test the capability of the CAN to learn attributes and assemble learned attributes. We first train the base attribute module using the baseline RL algorithm with CL and then use the cascading modules to decompose the different add-on attributes based on the pretrained base module. In the actor-critic RL training using PPO, the maximum episodes is 10000. Both the actor network and critic network are trained using the Adam optimizer, with a batch number of 256, an initial learning rate of 0.0001, and are updated for 20 times in each training iteration. After training the two robot scenarios and all the four add-on attributes for each scenario, tasks. Therefore, the results show that the add-on attributes can be successfully added to the base attribute using the CAN. Fig. 4. shows the random level training log for the four add-on attribute modules in the point mass scenario, we ran 10 test episodes for the 8 combination tasks and received 10/10 success rate for all the tasks and Fig. 5 and Fig. 6 show the example episodes of the performing different attributes combinations.
We also show cases where the CAN can assemble more than one add-on attribute modules. Concretely, we first train the obstacle attribute module based on the point mass robot. Then we connect two identically parameterized obstacle attribute modules in series following the base attribute module, each handling one obstacle ball. The CAN structure is the same as the one shown in Fig. 2.. Fig. 7. shows two examples of the CAN zero shooting the task where the moving point robot reaches the target while avoiding two obstacles simultaneously. Our perspective is not learning a universally effective policy for any control task, but utilizing the decomposition of the policy to reuse pre-learned knowledge, so as to achieve easier and faster training compared to training a new policy from scratch for new control task (as shown in Section IV-C).
4.4 Comparison with Baseline RL Methods
We compare the capability and efficiency of the CAN and the baseline RL on an obstacle task for the point mass robot. The CAN is trained with CL, with the base attribute pretrained and fixed. For the baseline RL, the task is trained from scratch. For baseline RL trained with RCL, we let the initial state be very close to the target in the early stage of the training phase. Using RCL, the baseline RL could gain positive reward in the early stage. The challenge would be whether the RL algorithm can maintain a high reward level as the random level increases.
The resulting comparison of the reward and random level are shown in Fig. 8, with the maximum training iterations exceeding 120000. It is shown that the baseline RL using CL barely learns anything. This is because the reward is too sparse and the agent is consistently receiving punishment from the obstacle and falls into a local minimum of purely avoiding the obstacle and ignoring the target. For the baseline RL using RCL, in the early stage, the average discounted reward in an episode is high as expected. But as the random level rises, the performance of the baseline RL with RCL drops. Therefore, the random level increases slowly as the training goes on. The CAN, on the other hand, is able to overcome the misleading punishments from the obstacle. As a result, the random level of the CAN rises rapidly, and the CAN achieves terminal random level more than 10 times faster than the baseline.
5 Conclusions and Future Work
In this paper, we propose the attribute learning and present the advantages of using this novel method to decompose the control policies of complicated control tasks. The RL framework we propose, the CAN, uses cascading attribute modules structure to model the characteristics of the attributes. The attribute modules are trained with the guidance of the pretrained base attribute module. We validate the effectiveness of the CAN of decomposing and assembling attributes and show the advantages of the CAN in solving complicated tasks compared to the baseline RL. Our ongoing future work includes applying the CAN method on more advanced simulation scenarios such as autonomous driving and using a real 2D articulated robot similar to the one in the simulation experiment to verify the capability of the CAN in more general and complicated settings.
- Unsupervised cross-domain transfer in policy gradient reinforcement learning via manifold alignment. In Twenty-Ninth AAAI Conference on Artificial Intelligence, Cited by: §2.1.
Modular multitask reinforcement learning with policy sketches.
Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 166–175. Cited by: §2.1.
- Transfer in deep reinforcement learning using successor features and generalised policy improvement. arXiv preprint arXiv:1901.10964. Cited by: §2.1.
- Successor features for transfer in reinforcement learning. In Advances in neural information processing systems, pp. 4055–4065. Cited by: §2.1.
- Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41–48. Cited by: §2.1.
- Reuse of neural modules for general video game playing. In Thirtieth AAAI Conference on Artificial Intelligence, Cited by: §2.1.
- Learning transferable policies for monocular reactive mav control. In International Symposium on Experimental Robotics, pp. 3–11. Cited by: §1, §2.1.
- Learning modular neural network policies for multi-task and multi-robot transfer. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 2169–2176. Cited by: §2.1.
- Reverse curriculum generation for reinforcement learning. arXiv preprint arXiv:1707.05300. Cited by: §2.1.
- Learning invariant feature spaces to transfer skills with reinforcement learning. arXiv preprint arXiv:1703.02949. Cited by: §2.1.
- Rainbow: combining improvements in deep reinforcement learning. In Thirty-Second AAAI Conference on Artificial Intelligence, Cited by: §1.
- Self-supervised deep reinforcement learning with generalized computation graphs for robot navigation. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1–8. Cited by: §1.
- End-to-end training of deep visuomotor policies.. Journal of Machine Learning Research. 17.39, pp. 1–40. Cited by: §1.
- Learning curriculum policies for reinforcement learning. In Proceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, pp. 25–33. Cited by: §2.1.
- Progressive neural networks. arXiv preprint arXiv:1606.04671. Cited by: §1, §2.1.
- Sim-to-real robot learning from pixels with progressive nets. arXiv preprint arXiv:1610.04286. Cited by: §2.1.
- Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347. Cited by: §4.1.
- High-dimensional continuous control using generalized advantage estimation.. arXiv preprint arXiv:1506.02438.. Cited by: §4.1.
- Disturbance-observer-based tracking controller for neural network driving policy transfer. IEEE Transactions on Intelligent Transportation Systems. Cited by: §2.1.
- Transfer learning for reinforcement learning domains: a survey. Journal of Machine Learning Research 10 (Jul), pp. 1633–1685. Cited by: §2.1.
- Mujoco: a physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. Cited by: §4.1.
- Toward modularization of neural network autonomous driving policy using parallel attribute networks. In 2019 IEEE Intelligent Vehicles Symposium (IV), pp. 1400–1407. Cited by: §2.1.
- Zero-shot deep reinforcement learning driving policy transfer for autonomous vehicles based on robust control. In 2018 21st International Conference on Intelligent Transportation Systems (ITSC), pp. 2865–2871. Cited by: §2.1.