Year: 2021

Abstract:
Equivariant neural networks enforce symmetry within the structure of their convolutional layers, resulting in a substantial improvement in sample efficiency when learning an equivariant or invariant function. Such models are applicable to robotic manipulation learning which can often be formulated as a rotationally symmetric problem. This paper studies equivariant model architectures in the context ofQ-learning and actor-critic reinforcement learning. We identify equivariant and invariant characteristics of the optimal Q-function and the optimal policy and propose equivariant DQN and SAC algorithms that leverage this structure. We present experiments that demonstrate that our equivariant versions of DQN and SAC can be significantly more sample efficient than competing algorithms on an important class of robotic manipulation problems.

heading: 1 INTRODUCTION
text: A key challenge in reinforcement learning is to improve sample efficiency – that is to reduce the amount of environmental interactions that an agent must take in order to learn a good policy. This is particularly important in robotics applications where gaining experience potentially means interacting with a physical environment. One way of improving sample efficiency is to create “artificial” experiences through data augmentation. This is typically done in visual state spaces where an affine transformation (e.g., translation or rotation of the image) is applied to the states experienced during a transition (Laskin et al., 2020a; Kostrikov et al., 2020). These approaches implicitly assume that the transition and reward dynamics of the environment are invariant to affine transformations of the visual state. In fact, some approaches explicitly use a contrastive loss term to induce the agent to learn translation-invariant feature representations (Laskin et al., 2020b; Zhan et al., 2020).
Recent work in geometric deep learning suggests that it may be possible to learn transformationinvariant policies and value functions in a different way, using equivariant neural networks (Cohen & Welling, 2016a;b). The key idea is to structure the model architecture such that it is constrained only to represent functions with the desired invariance properties. In principle, this approach aim at exactly the same thing as the data augmentation approaches described above – both methods seek to improve sample efficiency by introducing an inductive bias. However, the equivariance approach achieves this more directly by modifying the model architecture rather than by modifying the training data. Since with data augmentation, the model must learn equivariance in addition to the task itself, more training time and greater model capacity are often required. Even then, data augmentation results only in approximate equivariance whereas equivariant neural networks guarantee it and often have stronger generalization as well (Wang et al., 2020b). While equivariant architectures have recently been applied to reinforcement learning (van der Pol et al., 2020a;b; Mondal et al., 2020), this has been done only in toy settings (grid worlds, etc.) where the model is equivariant over small finite groups, and the advantages of this approach over standard methods is less clear.
This paper explores the application of equivariant methods to more realistic problems in robotics such as object manipulation. We make several contributions. First, we define and analyze an important class of MDPs that we call group equivariant MDPs. Second, we introduce a new variation of the Equivariant DQN (Mondal et al., 2020), and we further introduce equivariant variations of SAC (Haarnoja et al., 2018), and learning from demonstration (LfD). Finally, we show that our methods convincingly outperform recent competitive data augmentation approaches (Laskin et al., 2020a; Kostrikov et al., 2020; Laskin et al., 2020b; Zhan et al., 2020). Our Equivariant SAC method, in particular, outperforms these baselines so dramatically (Figure 7) that it could make reinforcement learning feasible for a much larger class of robotics problems than is currently the case.

heading: 2 RELATED WORK
text: Equivariant Learning: Encoding symmetries in the structure of neural networks can improve both generalization and sample efficiency. The idea of equivariant learning is first introduced in GConvolution (Cohen & Welling, 2016a). The extension work proposes an alternative architecture, Steerable CNN (Cohen & Welling, 2016b). Weiler & Cesa (2019) proposes a general framework for implementing E(2)-Steerable CNNs. In the context of reinforcement learning, Mondal et al. (2020) investigates the use of Steerable CNNs in the context of two game environments. van der Pol et al. (2020b) proposes MDP homomorphic networks to encode rotational and reflectional equivariance of an MDP but only evaluates their method in a small set of tasks. In robotic manipulation, Wang et al. (2021) learns equivariant Q-functions but is limited in the spatial action space. In contrast to prior work, this paper proposes an Equivariant SAC algorithm, an equivariant LfD algorithm, and a novel variation of Equivariant DQN (Mondal et al., 2020) focusing on visual motor control problems.
Data Augmentation: Another popular method for improving sample efficiency is data augmentation. Recent works demonstrate that the use of simple data augmentation methods like random crop or random translate can significantly improve the performance of reinforcement learning (Laskin et al., 2020a; Kostrikov et al., 2020). Data augmentation is often used for generating additional samples (Kalashnikov et al., 2018; Lin et al., 2020; Zeng et al., 2020) in robotic manipulation. However, data augmentation methods are often less sample efficient than equivariant networks because the latter injects an inductive bias to the network architecture.
Contrastive Learning: Data augmentation is also applied with contrastive learning (Oord et al., 2018) to improve feature extraction. Laskin et al. (2020b) show significant sample-efficiency improvement by adding an auxiliary contrastive learning term using random crop augmentation. Zhan et al. (2020) use a similar method in the context of robotic manipulation. However, contrastive learning is limited to learning an invariant feature encoder and is not capable of learning equivariant functions.
Close-Loop Robotic Control: There are two typical action space definitions when learning policies that control the end-effector of a robot arm: the spatial action space that controls the target pose of the end-effector (Zeng et al., 2018b;a; Satish et al., 2019; Wang et al., 2020a), or the closeloop action space that controls the displacement of the end-effector. The close-loop action space is widely used for learning grasping policies (Kalashnikov et al., 2018; Quillen et al., 2018; Breyer et al., 2019; James et al., 2019). Recently, some works also attempt to learn more complex policies than grasping (Viereck et al., 2020; Kilinc et al., 2019; Cabi et al., 2020; Zhan et al., 2020). This work extends prior works in the close-loop action space by using equivariant learning to improve the sample efficiency.

heading: 3 BACKGROUND
text: SO(2) and Cn: We will reason about rotation in terms of the group SO(2) and its cyclic subgroup Cn ≤ SO(2). SO(2) is the group of continuous planar rotations {Rotθ : 0 ≤ θ < 2π}. Cn is the discrete subgroup Cn = {Rotθ : θ ∈ { 2πin |0 ≤ i < n}} of rotations by multiples 2π n .
Cn actions: A groupGmay be equipped with an action on a setX by specifying a map · : G×X → X satisfying g1 · (g2 · x) = (g1g2) · x and 1 · x = x for all g1, g2 ∈ G, x ∈ X . Note that closure, gx ∈ X , and invertibility, g−1gx = x, follow immediately from the definition. We are interested in actions of Cn which formalize how vectors or feature maps transform under rotation. The group Cn acts in three ways that concern us (for a more comprehensive background, see Bronstein et al. (2021)):
1. R through the trivial representation ρ0. Let g ∈ Cn and x ∈ R. Then ρ0(g)x = x. For example, the trivial representation describes how pixel color/depth values change when an image is rotated, i.e. they do not change (Figure 1 left). 2. R2 through the standard representation ρ1. Let g ∈ Cn and v ∈ R2. Then ρ1(g)v =( cos g − sin g sin g cos g ) v. This describes how elements of a vector field change when rotated (Figure 1 middle).
3. Rn through the regular representation ρreg. Let g ∈ Cn and (x1, x2, . . . , xn) ∈ Rn. Then ρreg(g)(x1, x2, . . . , xn) = (xn, x1, x2, . . . , xn−1) cyclically permutes the coordinates of Rn (Figure 1 right).
Feature maps as functions: In deep learning, images and feature maps are typically expressed as tensors. However, it will be convenient here to sometimes express these as functions. Specifically, we may write an h× w one-channel image F ∈ R1×h×w as a function F : R2 → R where F(x, y) describes the intensity at pixel x, y. Similarly, an m-channel tensor F ∈ Rm×h×w may be written as F : R2 → Rm. We refer to the domain of this function as its “spatial dimensions”. Cn actions on vectors and feature maps: Cn acts on vectors and feature maps differently depending upon their semantics. We formalize these different ways of acting as follows. Let F : R2 → Rm be an m-channel feature map and let V ∈ Rm×1×1 = Rm be a vector represented as a special case of a feature map with 1× 1 spatial dimensions. Then g is defined to act on F by
(gF)(x, y) = ρj(g)F(ρ1(g)−1(x, y)). (1) For a vector V (considered to be at (x, y) = (0, 0)), this becomes:
gV = ρj(g)V. (2) In the above, ρ1(g) rotates pixel location and ρj(g) transforms the pixel feature vector using the trivial representation (ρj = ρ0), the standard representation (ρj = ρ1), the regular representation (ρj = ρreg), or some combination thereof.
Equivariant convolutional layer: A Cn-equivariant layer is a function h whose output is constrained to transform in a defined way when the input feature map is transformed by a group action. Consider an equivariant layer h with an input Fin : R2 → R|ρin| and an output Fout : R2 → R|ρout| , where ρin and ρout denote the group representations associated with Fin and Fout, respectively. When the input is transformed, this layer is constrained to output a transformed version of the same output feature map: h(gFin) = g(h(Fin)) = gFout. (3) where g ∈ Cn acts on Fin or Fout through Equation 1 or Equation 2, i.e., this constraint equation can be applied to arbitrary feature maps F or vectors V . A linear convolutional layer h satisfies Equation 3 with respect to the group Cn if the convolutional kernel K : R2 → R|ρout|×|ρin| has the following form (Cohen et al., 2018):
K(ρ1(g)v) = ρ −1 out(g)K(v)ρin(g). (4)
Since the composition of equivariant maps is equivariant, a fully convolutional equivariant network can be constructed by stacking equivariant convolutional layers that satisfy the constraint of Equation 3 and together with equivariant non-linearities (Weiler & Cesa, 2019).

heading: 4 PROBLEM STATEMENT

heading: 4.1 GROUP-INVARIANT MDPS
text: In a group-invariant MDP, the transition and reward functions are invariant to group elements g ∈ G acting on the state and action space. For state s ∈ S, action a ∈ A, and g ∈ G, let gs ∈ S denote the action of g on s and ga ∈ A denote the action of g on a.
Definition 4.1 (G-invariant MDP). A G-invariant MDPMG = (S,A, T,R,G) is an MDPM = (S,A, T,R) that satisfies the following conditions:
1. Reward Invariance: The reward function is invariant to the action of the group element g ∈ G, R(s, a) = R(gs, ga).
2. Transition Invariance: The transition function is invariant to the action of the group element g ∈ G, T (s, a, s′) = T (gs, ga, gs′).
A key feature of a G-invariant MDP is that its optimal solution is also G-invariant (proof in Appendix A):
Proposition 4.1. LetMG be a group-invariant MDP. Then its optimal Q-function is group invariant, Q∗(s, a) = Q∗(gs, ga), and its optimal policy is group-equivariant, π∗(gs) = gπ∗(s), for any g ∈ G.
It should be noted that the G-invariant MDP of Definition 4.1 is in fact a special case of an MDP homomorphism (Ravindran & Barto, 2001; 2004), a broad class of MDP abstractions. MDP homomorphisms are important because optimal solutions to the abstract problem can be “lifted” to produce optimal solutions to the original MDP (Ravindran & Barto, 2004). As such, Proposition 4.1 follows directly from those results.
4.2 SO(2)-INVARIANT MDPS IN VISUAL STATE SPACES
In the remainder of this paper, we focus exclusively on an important class of SO(2)-invariant MDPs where the state is encoded as an image. We approximate SO(2) by its subgroup Cn.
State space: State is expressed as an m-channel image, Fs : R2 → Rm. The group operator g ∈ Cn acts on this image as defined in Equation 1 where we set ρj = ρ0: gFs(x, y) = ρ0(g)Fs(ρ1(g)−1(x, y)), i.e., by rotating the pixels but leaving the pixel feature vector unchanged. Action space: We assume we are given a factored action space Ainv ×Aequiv = A ⊆ Rk embedded in a k-dimensional Euclidean space where Ainv ⊆ Rkinv and Aequiv ⊆ Rk−kinv . We require the variables in Ainv to be invariant with the rotation operator and the variables in Aequiv to rotate with the representation ρequiv = ρ1. Therefore, the rotation operator g ∈ Cn acts on a ∈ A via ga = (ρequiv(g)aequiv, ainv) where ainv ∈ Ainv and aequiv ∈ Aequiv.
Application to robotic manipulation: We express the state as a depth image centered on the gripper position where depth is defined relative to the gripper. The orientation of this image is relative to the base reference frame – not the gripper frame. We require the fingers of the gripper and objects grasped by the gripper to be visible in the image. Figure 2 shows an illustration. The action is a tuple, a = (aλ, axy, az, aθ) ∈ A ⊂ R5, where aλ ∈ Aλ denotes the commanded gripper aperture, axy ∈ Axy denotes the commanded change in gripper xy position, az ∈ Az denotes the commanded change in gripper height, and
aθ ∈ Aθ denotes the commanded change in gripper orientation. Here, the xy action is equivariant with g ∈ Cn,Aequiv = Axy , and the rest of the action variables are invariant,Ainv = Aλ×Az×Aθ. Notice that the transition dynamics are Cn-invariant (i.e. T (s, a, s′) = T (gs, ga, gs′)) because the Newtonian physics of the interaction are invariant to the choice of reference frame. If we constrain the reward function to be Cn-invariant as well, then the resulting MDP is Cn-invariant.

heading: 5 APPROACH

heading: 5.1 EQUIVARIANT DQN
text: In DQN, we assume we have a discrete action space, and we learn the parameters of a Q-network that maps from the state onto action values. Given a G-invariant MDP, Proposition 4.1 tells us that the optimal Q-function is G-invariant. Therefore, we encode the Q-function using an equivariant
neural network that is constrained to represent only G-invariant Qfunctions. First, in order to use DQN, we need to discretize the action space. Let Aequiv ⊂ Aequiv and Ainv ⊂ Ainv be discrete subsets of the full equivariant and invariant action spaces, respectively. Next, we define a function Fa : Aequiv → RAinv from the equivariant action variables in Aequiv to the Q values of the invariant action variables in Ainv. For example, in the robotic manipulation domain described Section 4.2, we have Aequiv = Axy and Ainv = Aλ × Az × Aθ and ρequiv = ρ1, and we define Aequiv and Ainv accordingly. We now encode the Q network q as a stack of equivariant layers that each encode the equivariant constraint of Equation 3. Since the composition of equivariant layers is equivariant, q satisfies:
q(gFs) = g(q(Fs)) = gFa, (5)
where we have substituted Fin = Fs and Fout = Fa. In the above, the rotation operator g ∈ Cn is applied using Equation 1
as gFa(axy) = ρ0(g)Fa(ρ1(g)−1(axy)). Figure 3 illustrates this equivariance constraint for the robotic manipulation example with |Aequiv| = |Axy| = 9. When the state (represented as an image on the left) is rotated by 90 degrees, the values associated with the action variables in Axy are also rotated similarly. The detailed network architecture is shown in Appendix D.1. Our architecture is different from that in Mondal et al. (2020) in that we associate the action of g on Aequiv and Ainv with the group action on the spatial dimension and the channel dimension of a feature map Fa, which is more efficient than learning such mapping using FC layers.
5.2 EQUIVARIANT SAC
In SAC, we assume the action space is continuous. We learn the parameters for two networks: a policy network Π (the actor) and an action-value network Q (the critic) (Haarnoja et al., 2018). The critic Q : S ×A→ R approximates Q values in the typical way. However, the actor Π : S → A×Aσ estimates both the mean and standard deviation of action for a given state. Here, we define Aσ = Rk to be the domain of the standard deviation variables over the k-dimensional action space defined in Section 4.2. Since Proposition 4.1 tells us that the optimal Q is invariant and the optimal policy is equivariant, we must model Q as an invariant network and Π as an equivariant network.
Policy network: First, consider the equivariant constraint of the policy network. As before, the state is encoded by the function Fs. However, we must now express the action as a vector over Ā = A×Aσ . Factoring A into its
equivariant and invariant components, we have Ā = Aequiv × Ainv × Aσ . In order to identify the equivariance relation for Ā, we must define how the group operator g ∈ G acts on aσ ∈ Aσ . Here, we make the simplifying assumption that aσ is invariant to the group operator. This choice makes sense in robotics domains where we would expect the variance of our policy to be invariant to the choice of reference frame. As a result, we have that the group element g ∈ G acts on ā ∈ Ā via:
gā = g(aequiv, ainv, aσ) = (ρequiv(g)aequiv, ainv, aσ). (6)
We can now define the actor network π to be a mapping Fs 7→ ā (Figure 4 top) that satisfies the following equivariance constraint (Equation 3):
π(gFs) = g(π(Fs)) = gā. (7)
Critic network: The critic network takes both state and action as input and maps onto a real value. We define two equivariant networks: a state encoder e and aQ network q. The equivariant state encoder,
e, maps the input state Fs onto a regular representation s̄ ∈ (Rn)α where each of n group elements is associated with an α-vector. Since s̄ has a regular representation, we have gs̄ = ρreg(g)s̄. Writing the equivariance constraint of Equation 3 for e, we have that e must satisfy e(gFs) = ge(Fs) = gs̄. The output state representation s̄ is concatenated with the action a ∈ A, producing w = (s̄, a). The action of the group operator is now gw = (gs̄, ga) where ga = (ρequiv(g)aequiv, ainv). Finally, the q network maps from w onto R, a real-valued estimate of theQ value for w. Based on proposition 4.1, this network must be invariant to the group action: q(gw) = q(w). All together, the critic satisfies the following invariance equation:
q(e(gFs), ga) = q(e(Fs), a). (8) This network is illustrated at the bottom of Figure 4. For a robotic manipulation domain in Section 4.2, we have Aequiv = Axy and Ainv = Aλ ×Az ×Aθ and ρequiv = ρ1. The detailed network architecture is in Appendix D.2.
Preventing the critic from becoming overconstrained: In the model architecture above, the hidden layer of q is represented using a vector in the regular representation and the output of q is encoded using the trivial representation. However, Schur’s Lemma (see e.g. Dummit & Foote (1991)) implies there only exists a one-dimensional space of linear mappings from a regular representation to a trivial representation (i.e., x = a ∑ i vi where x is a trivial representation, a is a constant, and v is a regular representation). This implies that a linear mapping f : Rn × Rn → R from two regular representations to a trivial representation that satisfies f(gv, gw) = f(v, w) for all g ∈ G will also satisfy f(g1v, w) = f(v, w) and f(v, g2w) = f(v, w) for all g1, g2 ∈ G. (See details in Appendix B.) In principle, this could overconstrain the last layer of q to encode additional undesired symmetries. To avoid this problem we use a non-linear equivariant mapping, maxpool, over the group space to transform the regular representation to the trivial representation.

heading: 5.3 EQUIVARIANT SACFD
text: Many of the problems we want to address cannot be solved without guiding the agent’s exploration somehow. In order to evaluate our algorithms in this context, we introduce the following simple strategy for learning from demonstration with SAC. First, prior to training, we pre-populate the replay buffer with a set of expert demonstrations generated using a hand-coded planner. Second, we introduce the following L2 term into the SAC actor’s loss function:
Lactor = LSAC + 1e [ 1
2 ((a ∼ π(s))− ae)2
] , (9)
where LSAC is the actor’s loss term in standard SAC, 1e = 1 if the sampled transition is an expert demonstration and 0 otherwise, a ∼ π(s) is an action sampled from the output Gaussian distribution of π(s), and ae is the expert action. Since both the sampled action a ∼ π(s) and the expert action ae transform equivalently, Lactor is compatible with the equivariance we introduce in Section 5.2. We refer to this method as SACfD (SAC from Demonstration).

heading: 6 EXPERIMENTS
text: We evaluate Equivariant DQN and Equivariant SAC in the manipulation tasks shown in Figure 5. These tasks can be formulated as SO(2)-invariant MDPs. All environments have sparse rewards (+1 when reaching the goal and 0 otherwise). See environment details in Appendix C.

heading: 6.1 EQUIVARIANT DQN
text: We evaluate Equivariant DQN in the Block Pulling, Object Picking, and Drawer Opening tasks for the group C4. The discrete action space is Aλ = {OPEN, CLOSE}; Axy = {(x, y)|x, y ∈ {−0.02m, 0m, 0.02m}}; Az = {−0.02m, 0m, 0.02m}; Aθ = {− π16 , 0, π 16}. Note that the definition of Axy and g ∈ C4 satisfies the closure requirement of the action space in a way that ∀axy ∈ Axy,∀g ∈ C4, ρ1(g)axy ∈ Axy . We compare Equivariant DQN (Equi DQN) against the following baselines: 1) CNN DQN: DQN with conventional CNN instead of equivariant network, where the conventional CNN has a similar amount of trainable parameters (3.9M) as the equivariant network (2.6M). 2) RAD Crop
DQN (Laskin et al., 2020a): same network architecture as CNN DQN. At each training step, each transition in the minibatch is applied with a random-crop data augmentation. 3) DrQ Shift DQN (Kostrikov et al., 2020): same network architecture as CNN DQN. At each training step, both the Q-targets and the TD losses are calculated by averaging over two random-shift augmented transitions. 4): CURL DQN (Laskin et al., 2020b): similar architecture as CNN DQN with an extra contrastive loss term that learns an invariant encoder from random crop augmentations. See the baselines detail in Appendix E. At the beginning of each training process, we pre-populate the replay buffer with 100 episodes of expert demonstrations.
Figure 6 compares the learning curves of the various methods. Equivariant DQN learns faster and converges at a higher discounted reward in all three environments.

heading: 6.2 EQUIVARIANT SAC
text: In this experiment, we evaluate the performance of Equivariant SAC (Equi SAC) for the group C8. The continuous action space is:Aλ = [0, 1]; Axy = {(x, y)|x, y ∈ [−0.05m, 0.05m]}; Az = [−0.05m, 0.05m]; Aθ = [−π8 , π 8 ]. We compare against the following baselines: 1) CNN SAC: SAC with conventional CNN rather than equivariant networks, where the conventional CNN has a similar amount of trainable parameters (2.6M) as the equivariant network (2.3M). 2) RAD Crop SAC (Laskin et al., 2020a): same model architecture as CNN SAC with random crop data augmentation when sampling transitions. 3) DrQ (Kostrikov et al., 2020): same model architecture as CNN SAC with random shift data augmentation when calculating the Q-target and the loss. 4) FERM (Zhan et al., 2020): a combination of SAC, contrastive learning, and random crop augmentation (baseline details in Appendix E). All methods use a SO(2) data augmentation buffer, where every time a new transition is added, we generate 4 more augmented transitions by applying random continuous SO(2) rotations to both the image and the action (this data augmentation in the buffer is
in addition to the data augmentation that is performed in the RAD DrQ, and FERM baselines). Prior to each training run, we pre-load the replay buffer with 20 episodes of expert demonstration.
Figure 7 shows the comparison among the various methods. Notice that Equivariant SAC outperforms the other methods significantly. Without the equivariant approach, Object Picking and Drawer Opening appear to be infeasible for the baseline methods. In Block Pulling, FERM is the only other method able to solve the task.

heading: 6.3 EQUIVARIANT SACFD
text: We want to explore our equivariant methods in the context of more challenging tasks such as those in the bottom row of Figure 5. However, since these tasks are too difficult to solve without some kind of guided exploration, we augment the Equivariant SAC as well as all the baselines in two ways: 1) we use SACfD as described in Section 5.3; 2) we use Prioritized Experience Replay (Schaul et al., 2015) rather than standard replay buffer. As in Section 6.2, we use the continuous SO(2) data augmentation in the buffer that generates 4 extra SO(2)-augmented transitions whenever a new transition is added.
Figure 8 shows the results. First, note that our Equivariant SACfD does best on all four tasks, followed by FERM, and other baselines. Second, notice that only the equivariant method can solve the last three (most challenging tasks). This suggests that equivariant models are important not only for unstructured reinforcement learning, but also for learning from demonstration. Additional results for Block Pulling and Object Picking environments are shown in Appendix G.

heading: 6.4 COMPARING WITH LEARNING EQUIVARIANCE USING AUGMENTATION
text: In the previous experiments, we compare against the data augmentation baselines using the same data augmentation operators that the authors proposed (random crop in RAD (Laskin et al., 2020a) and random shift in DrQ (Kostrikov et al., 2020)). However, those two methods can also be modified to learn SO(2) equivariance using SO(2) data augmentation. Here, we explore this idea as an alternative to our equivariant model. Specifically, instead of augmenting on the state as in Laskin
et al. (2020a) and Kostrikov et al. (2020) using only translation, we apply the SO(2) augmentation in both the state and the action.
Since the RAD and DrQ baselines in this section are already running SO(2) augmentations themselves, we disable the SO(2) buffer augmentation for the online transitions in those baselines. (See the result of RAD and DrQ with the SO(2) data augmentation buffer in Appendix H.4). We compare the resulting version of RAD (RAD SO(2) SACfD) and DrQ (DrQ SO(2) SACfD) with our Equivariant SACfD in Figure 9. Our method outperforms both RAD and DrQ equipped with SO(2) data augmentation. Additional results for Block Pulling and Object Picking environments are shown in Appendix G.
6.5 GENERALIZATION EXPERIMENT
This experiment evaluates the ability for the equivariant model to generalize over the equivariance group. We use a similar experimental setting as in Section 6.3. However, now the training environment is always initialized with a fixed orientation rather than a random orientation. For example, in Block Pulling, the two blocks in the training environment are initialized with a fixed relative orientation; in Drawer Opening, the drawer is initialized with a fixed orientation. In the evaluation environment, however, these objects are initialized
with random orientations. To succeed, the agent needs to generalize over varied orientations while being trained with a fixed orientation. To prevent the agent from generalizing via augmentation, we disable the SO(2) augmentation in the buffer. As shown in Figure 10, Equivariant SACfD generalizes better than the baselines. Even though the equivariant network is presented with only one orientation during training, it successfully generalizes over random orientation whereas none of the baselines can.

heading: 7 DISCUSSION
text: This paper defines a class of group-invariant MDPs and identifies the invariance and equivariance characteristics of their optimal solutions. This paper further proposes Equivariant SAC and a new variation of Equivariant DQN for continuous action space and discrete action space, respectively. We show experimentally in the robotic manipulation domains that our proposal substantially surpasses the performance of competitive baselines. A key limitation of this work is that our definition of G-invariant MDPs requires the MDP to have an invariant reward function and invariant transition function. Though such restrictions are often applicable in robotics, they limit the potential of the proposed methods in other domains like some ATARI games. Furthermore, if the observation is from a non-top-down perspective, or there are non-equivariant structures in the observation (e.g., the robot arm), the invariant assumptions of a G-invariant MDP will not be directly satisfied.

heading: 8 REPRODUCIBILITY STATEMENT
text: For the review propose, our code is anonymously available at https://anonymous.4open. science/r/equi_close_loop_ICLR22/README.md. In the final submission, we will include a link to a public-available repository.

heading: A PROOF OF PROPOSITION 4.1
text: The proof in this section follows Wang et al. (2021). Note that the definition of group action · : G× X → X implies that elements g ∈ G act by bijections on X since the action of g−1 gives a twosided inverse for the action of g. That is, g permutes the elements of X .
Proof of Proposition 4.1. For g ∈ G, we will first show that the optimal Q-function is G-invariant, i.e., Q∗(s, a) = Q∗(gs, ga), then show that the optimal policy is G-equivariant, i.e., π∗(gs) = gπ∗(s).
(1) Q∗(s, a) = Q∗(gs, ga): The Bellman optimality equations for Q∗(s, a) and Q∗(gs, ga) are, respectively:
Q∗(s, a) = R(s, a) + γ sup a′∈A ∫ s′∈S T (s, a, s′)Q∗(s′, a′), (10)
and
Q∗(gs, ga) = R(gs, ga) + γ sup a′∈A ∫ s′∈S T (gs, ga, s′)Q∗(s′, a′). (11)
Since g ∈ G merely permutes the elements of S, we can re-index the integral using s̄′ = gs′:
Q∗(gs, ga) = R(gs, ga) + γ sup ā′∈gA ∫ s̄′∈gS T (gs, ga, s̄′)Q∗(s̄′, ā′) (12)
= R(gs, ga) + γ sup a′∈A ∫ s′∈S T (gs, ga, gs′)Q∗(gs′, ga′). (13)
Using the Reward Invariance and the Transition Invariance in Definition 4.1, this can be written:
Q∗(gs, ga) = R(s, a) + γ sup a′∈A ∫ s′∈S T (s, a, s′)Q∗(gs′, ga′). (14)
Now, define a new function Q̄ such that ∀s, a ∈ S × A, Q̄(s, a) = Q(gs, ga) and substitute into Eq. 14, resulting in:
Q̄∗(s, a) = R(s, a) + γ sup a′∈A ∫ s′∈S T (s, a, s′)Q̄∗(s′, a′). (15)
Notice that Eq. 15 and Eq. 10 are the same Bellman equation. Since solutions to the Bellman equation are unique, we have that ∀s, a ∈ S ×A, Q∗(s, a) = Q̄∗(s, a) = Q∗(gs, ga). (2) π∗(gs) = gπ∗(s): The optimal policy for π∗(s) and π∗(gs) can be written in terms of the optimal Q-function, Q∗, as:
π∗(s) = arg max a∈A Q∗(s, a) (16)
and π∗(gs) = arg max
ā∈A Q∗(gs, ā) (17)
Using the invariant property of Q∗ we can substitute Q∗(gs, ā) with Q∗(s, g−1ā) in Equation 17:
π∗(gs) = arg max ā∈A Q∗(s, g−1ā) (18)
Let ā = ga, Equation 18 can be written as:
π∗(gs) = g[arg max a∈A Q∗(s, g−1ga)] (19)
Cancelling g−1 and g and substituting Equation 16 we have,
π∗(gs) = gπ∗(s). (20)

heading: B EQUIVARIANCE OVERCONSTRAIN
text: Proposition B.1. Let f : Vreg⊕Vreg → Vtriv be a linear Cn-equivariant function. Then f(v, w) = a ∑ i vi + b ∑ i wi.
Proof. By Weyl decomposibility (Hall, 2003), Vreg decomposes into irreducible representations for Cn each with multiplicity determined by its dimension. Among these is the trivial representation with multiplicity 1. By Schur’s lemma (Dummit & Foote, 1991), the mapping Vreg ⊕ Vreg → Vtriv must factor through the trivial representation embedded in Vreg . The projection onto the trivial representation is given v 7→ a ∑ i vi. The result follows by linearity.
As a corollary, we find that Cn-equivariant maps Vreg ⊕ Vreg → Vtriv are actually Cn × Cnequivariant. Let (g1, g2) ∈ Cn × Cn, then applying the Proposition f(g1v, g2w) = a ∑ i(gv)i +
b ∑ i(gw)i = a ∑ i vi + b ∑ i wi = f(v, w).
C ENVIRONMENT DETAILS
In all environments, the environment reset is conduced by randomly initializing the objects with random positions and orientations inside the workspace. The arm is always initialized at the same configuration. The workspace has a size of 0.4m × 0.4m × 0.24m. All environments have a sparse reward, i.e., the agent acquires a +1 reward when reaching the goal state, and 0 otherwise. In the PyBullet simulator, the robot joints have enough compliance to allow the gripper to apply force on the block in the Corner Picking task.
We augment the state image with an additional binary channel (i.e., either all pixels are 1 or all pixels are 0) indicating if the gripper is holding an object. Note that this additional channel is invariant to rotations (because all pixels have the same value) so it won’t break the proposed equivariant properties.
The Block Pulling requires the robot to pull one block to make contact with the other block. The Object Picking requires the robot the pick up an object randomly sampled from a set of 11 objects (Figure 11). The Drawer Opening requires the robot to pull open a drawer. The Block Stacking requires the robot to stack one block on top of another. The House Building requires the robot to stack a triangle roof on top of a block. The Corner Picking requires the robot to slide the block from the corner and then pick it up.

heading: D NETWORK ARCHITECTURE
text: Our equivariant models are implemented using the E2CNN (Weiler & Cesa, 2019) library with PyTorch (Paszke et al., 2017).
D.1 EQUIVARIANT DQN ARCHITECTURE
In the Equivariant DQN, we use a 7-layer Steerable CNN defined in the group C4 (Figure 12a). The input Fs is encoded as a 2-channel ρ0 feature map, and the output is a 18-channel 3 × 3 ρ0 feature map where the channel encodes the invariant actions Ainv and the spatial dimension encodes Axy .
D.2 EQUIVARIANT SAC ARCHITECTURE
In the Equivariant SAC, there are two separate networks, both are Steerable CNN defined in the group C8. The actor π (Figure 12b top) is an 8-layer network that takes in a 2-channel ρ0 feature map (Fs) and outputs a mixed representation type 1 × 1 feature map (ā) consisting of 1 ρ1 feature for axy and 8 ρ0 features for ainv and aσ . The critic (Figure 12b bottom) is a 9-layer network that takes in both Fs as a 2-channel ρ0 feature map and a as a 1 × 1 mixed representation feature map
consisting of 1 ρ1 feature for axy and 3 ρ0 for ainv. The upper path e encodes Fs into a 64-channel regular representation feature map s̄ with 1 × 1 spatial dimensions, then concatenates it with a. Two separate Q-value paths q take in the concatenated feature map and generate two Q-estimates in the form of 1 × 1 ρ0 feature. The non-linear maxpool layer is used for transforming regular representations into trivial representations to prevent the equivariant overconstraint (Section 5.2). Note that there are two Q outputs based on the requirement of the SAC algorithm.

heading: E BASELINE DETAILS
text: Figure 13 shows the baseline network architectures for DQN and SAC. The RAD (Laskin et al., 2020a) Crop baselines, CURL (Laskin et al., 2020b) baselines, and FERM (Zhan et al., 2020) baselines use random crop for data augmentation. The random crop crops a 142 × 142 state image to the size of 128 × 128. The contrastive encoder of CURL baselines has a size of 128 as in Laskin et al. (2020b), and that for the FERM baselines has a size of 50 as in Zhan et al. (2020). The FERM baseline’s contrastive encoder is pretrained for 1.6k steps using the expert data as in Zhan et al. (2020). The DrQ (Kostrikov et al., 2020) Shift baselines use random shift of ±4 pixels for data augmentation as in the original work. In all DrQ baselines, the number of augmentations for calculating the target K and the number of augmentations for calculating the loss M are both 2 as in Kostrikov et al. (2020).

heading: F TRAINING DETAILS
text: We implement our experimental environments in the PyBullet simulator (Coumans & Bai, 2016). The workspace’s size is 0.4m×0.4m×0.24m. The pixel size of the visual state I is 128×128 (except for the RAD Crop baselines, CURL baselines, and FERM baselines, where I’s size is 142 × 142 and will be cropped to 128 × 128). I’s FOV is 0.6m × 0.6m. During training, we use 5 parallel environments. We implement all training in PyTorch (Paszke et al., 2017). Both DQN and SAC use soft target update with τ = 10−2.
In the DQN experiments, we use the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 10−4. We use Huber loss (Huber, 1964) for calculating the TD loss. We use a discount factor γ = 0.95. The batch size is 32. The buffer has a capacity of 100,000 transitions.
In the SAC (and SACfD) experiments, we use the Adam optimizer with a learning rate of 10−3. The entropy temperature α is initialized at 10−2. The target entropy is -5. The discount factor γ = 0.99. The batch size if 64. The buffer has a capacity of 100,000 transitions. SACfD uses the prioritized replay buffer (Schaul et al., 2015) with prioritized replay exponent of 0.6 and prioritized importance sampling exponent β0 = 0.4 as in Schaul et al. (2015). The expert transitions are given a priority bonus of d = 1.

heading: G ADDITIONAL EXPERIMENTAL RESULTS FOR EQUIVARIANT SACFD
text: Figure 14 (a)-(b) shows the results for the experiment of Section 6.3 in Block Pulling and Object Picking environments. The Equivariant SACfD outperforms all baselines in those two environments.
Figure 14 (c)-(d) shows the results for the experiment of Section 6.4 in block Pulling and Object Picking environments. Similarly as the results in Figure 9, our Equivariant SACfD outperforms both RAD and DrQ equipped with SO(2) dat augmentation.

heading: H ABLATION STUDIES
text: H.1 USING EQUIVARIANT NETWORK ONLY IN ACTOR OR CRITIC
In this experiment, we investigate the effectiveness of the equivariant network in SACfD by only applying it in the actor network or the critic network. We evaluate four variations: 1) Equi Actor + Equi Critic that uses equivariant network in both the actor and the critic; 2) Equi Actor + CNN Critic that uses equivariant network solely in the actor and uses conventional CNN in the critic; 3) CNN Actor + Equi Critic that uses conventional CNN in the actor and equivariant network in the Critic; 4) CNN Actor + CNN Critic that uses the conventional CNN in both the actor and the critic. Other experimental setup mirrors Section 6.3. As is shown in Figure 15, applying the equivariant network
in the actor generally helps more than applying the equivariant network in the critic (in 5 out of 6 experiments), and using the equivariant network in both the actor and the critic always demonstrates the best performance.
H.2 DIFFERENT SYMMETRY GROUPS
This experiment compares the equivariant networks defined in three different symmetry groups: C8, C4, and C2. We run this experiment in SACfD with the same setup as in Section 6.3. As is shown in Figure 16, the network defined in C8 generally outperforms the network defined in C4, followed by the network defined in C2.
H.3 EQUIVARIANT SACFD IN NON-SYMMETRIC ENVIRONMENTS
This experiments evaluates the performance of Equivariant SACfD in non-symmetric tasks where the initial orientation of the environments are fixed rather than random. (Similarly as in Section 6.5 but both the training and the evaluation environments have the fix orientation.) Specifically, in Block Pulling, the two blocks in the training environment is initialized with a fixed relative orientation; in Drawer Opening, the drawer is initialized with a fixed orientation. As is shown in Figure 17, when the environments do not contain SO(2) symmetries, the performance gain of using equivariant network is less significant.
H.4 ROTATIONAL AUGMENTATION + BUFFER AUGMENTATION
Section 6.4 compares our Equivariant SACfD with rotational data augmentation baselines. This experiment shows the performance of those baselines (and an extra CNN SACfD baseline that uses conventional CNN) equipped with the data augmentation buffer. As is mentioned in Section 6.2, the data augmentation baseline creates 4 extra augmented transitions using random SO(2) rotation every time a new transition is added. Figure 18 shows the result, where none of the baselines outperform our proposal in any tasks. Compared with Figure 9, the data augmentation buffer hurts RAD and DrQ because of the redundancy of the same data augmentation.

Review summaries:
This paper explores to integrate equivariance deep learning to robotic applications. The authors propose two main contributions: 1) define and theoretically characterize an important class of group-equivariant MDPs, 2) and integrate equivariant variations to DQN, SAC, and LfD. The paper provides many different sets of experiments. The results are promising which shows benefits of the proposed approach. 

The paper uses rotation equivariant CNNs for model-free reinforcement learning. More specifically, it is argued that for robotic manipulation tasks the corresponding MDP is invariant under translation and rotation, and therefore one could more efficiently learn equivariant/invariant policy/value functions. This idea is applied to both DQN and SAC for control with finite and continuous action spaces respectively. Experimental results on several tasks demonstrate substantial improvement over the competing methods. 

This paper defines and theoretically characterizes a class of group-equivariant MDPs and studies its invariance and equivariance properties. It introduces two new models, one for discrete action spaces (equivariant DQN) and one for continuous action spaces (equivariant SAC). It compares the performance of the proposed methods against strong competitive baselines for multiple robotic manipulation tasks and establishes their superior performance. 

In this paper, the authors present an application of equivariant neural networks to reinforcement learning. They demonstrate new DQN and SAC architectures that make use of equivariant representations in order to improve sample efficiency. Results on manipulation tasks demonstrate sample complexity reduction compared to other techniques.