SO(2) -E
QUIVARIANT R EINFORCEMENT L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
Equivariant neural networks enforce symmetry within the structure of their convolutional layers, resulting in a substantial improvement in sample efﬁciency 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 of Q -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 signiﬁcantly more sample efﬁcient than competing algorithms on an important class of robotic manipulation problems.
I NTRODUCTION
A key challenge in reinforcement learning is to improve sample efﬁciency – 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 efﬁciency is to create “artiﬁcial” experiences through data augmentation.
This is typically done in visual state spaces where an afﬁne 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 afﬁne 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 efﬁciency 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 ﬁnite 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 deﬁne 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.
R ELATED W ORK
Equivariant Learning:
Encoding symmetries in the structure of neural networks can improve both generalization and sample efﬁciency.
The idea of equivariant learning is ﬁrst 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 reﬂectional 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 efﬁciency is data augmentation.
Recent works demonstrate that the use of simple data augmentation methods like random crop or random translate can signiﬁcantly 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 efﬁcient 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 signiﬁcant sample-efﬁciency 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 deﬁnitions 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 efﬁciency.
B ACKGROUND
SO(2) and C n : We will reason about rotation in terms of the group SO(2) and its cyclic subgroup
C n ≤ SO(2) .
SO(2) is the group of continuous planar rotations { Rot θ : 0 ≤ θ < 2 π } .
C n is the discrete subgroup C n = { Rot θ : θ ∈ { 2 πin | 0 ≤ i < n }} of rotations by multiples 2 πn .
C n actions: A group G may be equipped with an action on a set X by specifying a map · : G × X →
X satisfying g 1 · ( g 2 · x )
= ( g 1 g 2 ) · x and 1 · x = x for all g 1 , g 2 ∈ G, x ∈ X .
Note that closure, gx ∈ X , and invertibility, g − 1 gx = x , follow immediately from the deﬁnition.
We are interested in actions of C n which formalize how vectors or feature maps transform under rotation.
The group
C n acts in three ways that concern us (for a more comprehensive background, see Bronstein et al.
R through the trivial representation ρ 0 .
Let g ∈ C n 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).
R 2 through the standard representation ρ 1 .
Let g ∈ C n and v ∈ R 2 .
Then ρ 1 ( g ) v = (cid:0) cos g − sin g sin g cos g (cid:1) v .
This describes how elements of a vector ﬁeld change when rotated (Figure 1 middle).
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.
Speciﬁcally, we may write an h × w one-channel image F ∈ R 1 × h × w as a function F : R 2 → R where F ( x, y ) describes the intensity at pixel x, y .
Similarly, an m -channel tensor F ∈ R m × h × w may be written as F : R
→ R m .
We refer to the domain of this function as its “spatial dimensions”.
C n actions on vectors and feature maps: C n acts on vectors and feature maps differently depending upon their semantics.
We formalize these different ways of acting as follows.
Let F : R 2 → R m be an m -channel feature map and let V ∈ R m × 1 × 1 =
R m be a vector represented as a special case of a feature map with 1 × 1 spatial dimensions.
Then g is deﬁned to act on F by
[Equation]
For a vector V (considered to be at ( x, y ) = (0 , 0) ), this becomes:
[Equation]
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 C n -equivariant layer is a function h whose output is constrained to transform in a deﬁned way when the input feature map is transformed by a group action.
Consider an equivariant layer h with an input F in : R 2 → R | ρ in | and an output F out : R 2 → R | ρ out | , where ρ in and ρ out denote the group representations associated with F in and F out , respectively.
When the input is transformed, this layer is constrained to output a transformed version of the same output feature map:
[Equation]
where g ∈ C n acts on F in or F out 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 satisﬁes Equation 3 with respect to the group C n if the convolutional kernel K : R 2 → R | ρ out |×| ρ in | has the following form (Cohen et al., 2018):
[Equation]
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).
P ROBLEM S TATEMENT 4. G ROUP - INVARIANT MDP S
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 .
Deﬁnition 4.1 ( G -invariant MDP) .
A G -invariant MDP M G =
( S, A, T, R, G ) is an MDP M =
( S, A, T, R ) that satisﬁes the following conditions:
Reward Invariance: The reward function is invariant to the action of the group element g ∈ G , R ( s, a ) =
R ( gs, ga ) .
Transition Invariance: The transition function is invariant to the action of the group element g ∈ G , T ( s, a, s (cid:48) )
=
T ( gs, ga, gs (cid:48) ) .
A key feature of a G -invariant
MDP is that its optimal solution is also G -invariant (proof in Appendix A):
Proposition 4.1.
Let M G 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 Deﬁnition 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. follows directly from those results.
4. SO(2) - INVARIANT MDP S 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 C n .
State space: State is expressed as an m -channel image, F s : R 2 → R m .
The group operator g ∈ C n acts on this image as deﬁned in Equation 1 where we set ρ j = ρ 0 : g F s ( x, y )
=
ρ 0 ( g ) F s ( ρ 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
A inv × A equiv
=
A ⊆ R k embedded in a k -dimensional Euclidean space where A inv ⊆ R k inv and A equiv ⊆
R k − k inv .
We require the variables in A inv to be invariant with the rotation operator and the variables in A equiv to rotate with the representation ρ equiv =
ρ 1 .
Therefore, the rotation operator g ∈ C n acts on a ∈ A via ga =
( ρ equiv ( g ) a equiv , a inv ) where a inv ∈
A inv and a equiv ∈
A equiv .
[Figure]
Application to robotic manipulation: We express the state as a depth image centered on the gripper position where depth is deﬁned relative to the gripper.
The orientation of this image is relative to the base reference frame – not the gripper frame.
We require the ﬁngers 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 λ , a xy , a z , a θ ) ∈
A ⊂ R 5 , where a λ ∈ A λ denotes the commanded gripper aperture, a xy ∈
A xy denotes the commanded change in gripper xy position, a z ∈
A z 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 ∈ C n , A equiv =
A xy , and the rest of the action variables are invariant, A inv =
A λ ×
A z ×
A θ .
Notice that the transition dynamics are C n -invariant (i.e. T ( s, a, s (cid:48) )
=
T ( gs, ga, gs (cid:48) ) )
because the
Newtonian physics of the interaction are invariant to the choice of reference frame.
If we constrain the reward function to be C n -invariant as well, then the resulting MDP is C n -invariant.
A PPROACH 5. E QUIVARIANT DQN
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 A equiv ⊂
A equiv and A inv ⊂
A inv be discrete subsets of the full equivariant and invariant action spaces, respectively.
Next, we deﬁne a function F a : A equiv → R A inv from the equivariant action variables in A equiv to the Q values of the invariant action variables in A inv .
For example, in the robotic manipulation domain described Section 4.2, we have A equiv =
A xy and
A inv =
A λ ×
A z ×
A θ and ρ equiv = ρ 1 , and we deﬁne A equiv and A inv 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 satisﬁes:
[Equation]
where we have substituted F in = F s and F out = F a .
In the above, the rotation operator g ∈ C n is applied using Equationas g F a ( a xy )
=
ρ 0 ( g ) F a ( ρ 1 ( g ) − 1 ( a xy )) .
Figure 3 illustrates this equivariance constraint for the robotic manipulation example with |A equiv | = |A
xy | = 9 .
When the state (represented as an image on the left) is rotated by 90 degrees, the values associated with the action variables in A xy 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 A equiv and A inv with the group action on the spatial dimension and the channel dimension of a feature map F a , which is more efﬁcient than learning such mapping using FC layers.
5. E QUIVARIANT 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 deﬁne
A σ = R k to be the domain of the standard deviation variables over the k -dimensional action space deﬁned 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 F s .
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
=
A equiv ×
A inv × A σ .
In order to identify the equivariance relation for ¯ A , we must deﬁne 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:
[Equation]
We can now deﬁne the actor network π to be a mapping F s (cid:55)→ ¯ a (Figure 4 top) that satisﬁes the following equivariance constraint (Equation 3):
[Equation]
Critic network: The critic network takes both state and action as input and maps onto a real value.
We deﬁne two equivariant networks: a state encoder e and a Q network q .
The equivariant state encoder, e , maps the input state F s onto a regular representation ¯ s ∈
( R n ) α where each of n group elements is associated with an α -vector.
Since ¯ s has a regular representation, we have g ¯ s =
ρ reg ( g )¯ s .
Writing the equivariance constraint of Equation 3 for e , we have that e must satisfy e ( g F s ) =
ge ( F s ) =
g ¯ s .
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 =
( g ¯ s, ga ) where ga
= ( ρ equiv ( g ) a equiv , a inv ) .
Finally, the q network maps from w onto R , a real-valued estimate of the Q 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 satisﬁes the following invariance equation:
[Equation]
This network is illustrated at the bottom of Figure 4.
For a robotic manipulation domain in Section 4.2, we have A equiv =
A xy and A inv =
A λ ×
A z ×
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 (cid:80) i v i where x is a trivial representation, a is a constant, and v is a regular representation).
This implies that a linear mapping f : R n × R n → R from two regular representations to a trivial representation that satisﬁes f ( gv, gw ) =
f ( v, w ) for all g ∈ G will also satisfy f ( g 1 v, w ) =
f ( v, w ) and f ( v, g 2 w ) =
f ( v, w ) for all
g 1 , g 2 ∈ 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.
5. E QUIVARIANT SAC F D
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:
[Equation]
where L SAC is the actor’s loss term in standard SAC, 1 e = 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 a e is the expert action.
Since both the sampled action a ∼ π ( s ) and the expert action a e transform equivalently, L actor is compatible with the equivariance we introduce in Section 5.2.
We refer to this method as SACfD (SAC from Demonstration).
E XPERIMENTS
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 (+ when reaching the goal and 0 otherwise).
See environment details in Appendix C.
6. E QUIVARIANT DQN
We evaluate Equivariant DQN in the Block Pulling, Object Picking, and Drawer Opening tasks for the group C 4 .
The discrete action space is A λ
= { OPEN , CLOSE } ; A xy = { ( x, y ) | x, y ∈ {− 0 .
02 m, 0 m, 0 .
02 m }}
; A z = {− 0 .
02 m, 0 m, 0 .
02 m } ; A θ = {− π 16 , 0 , π 16 } .
Note that the definition of A xy and g ∈ C 4 satisﬁes the closure requirement of the action space in a way that ∀ a xy ∈
A xy , ∀ g ∈ C 4 , ρ 1 ( g ) a xy ∈
A xy .
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).
RAD Crop
[Figure] [Figure]
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.
6. E QUIVARIANT SAC
In this experiment, we evaluate the performance of Equivariant SAC (Equi SAC) for the group
C 8 .
The continuous action space is: A λ =
[0 , 1] ; A xy = { ( x, y ) | x, y ∈ [ − 0 .
05 m, 0 .
05 m ] } ;
A z = [ − 0 .
05 m, 0 .
05 m ] ; 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).
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
[Figure]
[Figure]
in addition to the augmentation is performed training run 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 signiﬁcantly.
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.
6. E QUIVARIANT SAC F D
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 difﬁcult 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.
6. C OMPARING WITH L EARNING E QUIVARIANCE U SING A UGMENTATION
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 modiﬁed to learn SO(2) equivariance using SO(2) data augmentation.
Here, we explore this idea as an alternative to our equivariant model.
Speciﬁcally, instead of augmenting on the state as in Laskin
[Figure]
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. G ENERALIZATION E XPERIMENT
[Figure]
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 ﬁxed orientation rather than a random orientation.
For example, in Block Pulling, the two blocks in the training environment are initialized with a ﬁxed relative orientation; in
Drawer Opening, the drawer is initialized with a ﬁxed 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 ﬁxed 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.
D ISCUSSION
This paper deﬁnes a class of group-invariant MDPs and identiﬁes 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 deﬁnition 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 satisﬁed.
R EPRODUCIBILITY S TATEMENT
For the review propose, our code is anonymously available at https://anonymous.4open.
science/r/equi_close_loop_ICLR22/README.md .
In the ﬁnal submission, we will include a link to a public-available repository.
A P ROOF OF P ROPOSITION 4.
The proof in this section follows Wang et al.
Note that the deﬁnition 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 ﬁrst 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 ) .
[Equation]
) : The Bellman optimality equations for Q ∗ ( s, a ) and Q ∗ ( gs, ga ) are, respectively:
[Equation]
10) and
[Equation]
Since g ∈ G merely permutes the elements of S , we can re-index the integral using ¯ s (cid:48)
=
gs (cid:48) :
[Equation] [Equation]
[Equation]
Using the Reward Invariance and the Transition Invariance in Deﬁnition 4.1, this can be written:
[Equation] [Equation]
Now, deﬁne a new function ¯ Q such that ∀ s, a ∈ S × A , ¯ Q ( s, a ) =
Q ( gs, ga ) and substitute into
Eq. 14, resulting in:
[Equation] [Equation]
Notice that Eq.
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 ) .
[Equation] [Equation]
gπ ∗ ( s ) :
The optimal policy for π ∗ ( s ) and π ∗ ( gs ) can be written in terms of the optimal Q -function, Q ∗ , as:
[Equation]
16) and
[Equation]
Using the invariant property of Q ∗ we can substitute Q ∗ ( gs, ¯ a ) with Q ∗ ( s, g − 1 ¯ a ) in Equation 17:
[Equation]
Let ¯ a = ga , Equation 18 can be written as:
[Equation]
Cancelling g − 1 and g and substituting Equation 16 we have,
[Equation]
B E QUIVARIANCE O VERCONSTRAIN
Proposition B.1.
Let f : V reg ⊕ V reg → V triv be a linear C n -equivariant function.
Then f ( v, w ) =
a (cid:80) i v i
+ b (cid:80) i w i .
Proof.
By Weyl decomposibility (Hall, 2003), V reg decomposes into irreducible representations for
C n 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 V reg ⊕ V reg
→ V triv must factor through the trivial representation embedded in V reg .
The projection onto the trivial representation is given v (cid:55)→ a (cid:80) i v i .
The result follows by linearity.
As a corollary, we ﬁnd that C n -equivariant maps V reg ⊕ V reg → V triv are actually C n × C nequivariant.
Let ( g 1 , g 2 ) ∈ C n × C n , then applying the Proposition f ( g 1 v, g 2 w ) = a (cid:80) i
( gv )
i + b (cid:80)
i ( gw ) i = a (cid:80) i v i
+ b (cid:80) i w i =
f
( v, w ) .
C E NVIRONMENT D ETAILS
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 conﬁguration.
The workspace has a size of 0 .
4 m × 0 . 4 m × 0 .
24 m .
All environments have a sparse reward, i.e., the agent acquires a + 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.
D N ETWORK A RCHITECTURE
Our equivariant models are implemented using the E2CNN (Weiler & Cesa, 2019) library with
PyTorch (Paszke et al., 2017).
D. E QUIVARIANT DQN A RCHITECTURE
In the Equivariant DQN, we use a 7-layer Steerable CNN deﬁned in the group C 4 (Figure 12a).
The input F s 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 A inv and the spatial dimension encodes A xy .
D. E QUIVARIANT SAC A RCHITECTURE
In the Equivariant SAC, there are two separate networks, both are Steerable CNN deﬁned in the group C 8 .
The actor π (Figure 12b top) is an 8-layer network that takes in a 2-channel ρ 0 feature map ( F s ) and outputs a mixed representation type 1 × 1 feature map ( ¯ a ) consisting of 1 ρ 1 feature for a xy and 8 ρ 0 features for a inv and a σ .
The critic (Figure 12b bottom) is a 9-layer network that takes in both F s as a 2-channel ρ 0 feature map and a as a 1 × 1 mixed representation feature map
[Figure]
consisting of 1 ρ 1 feature for a xy and 3 ρ 0 for a inv .
The upper path e encodes F s 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 ×
ρ 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.
E B ASELINE D ETAILS
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.
The FERM baseline’s contrastive encoder is pretrained for 1.6k steps using the expert data as in Zhan et al.
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.
F T RAINING D ETAILS
We implement our experimental environments in the PyBullet simulator (Coumans & Bai, 2016).
The workspace’s size is 0 .
4 m × 0 . 4 m × 0 .
24 m .
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 ×and will be cropped to 128 × 128 ).
I ’s FOV is 0 .
6 m × 0 .
6 m .
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 .
The batch size is 32.
The buffer has a capacity of 100,000 transitions.
[Figure] [Figure]
The plots evaluation performance the greedy policy in terms of the discounted reward.
The evaluation is performed every 500 training steps.
Results are averaged over four runs.
denotes standard error.
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 .
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.
The expert transitions are given a priority bonus of (cid:15) d = 1 .
G A DDITIONAL E XPERIMENTAL R ESULTS FOR E QUIVARIANT SAC F D
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.
[Figure] [Figure]
H A BLATION S TUDIES H. U SING E QUIVARIANT N ETWORK O NLY IN A CTOR OR C RITIC
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
[Figure]
[Figure]
in the actor generally helps more than applying the equivariant network in the critic (in 5 out ofexperiments), and using the equivariant network in both the actor and the critic always demonstrates the best performance.
H. D IFFERENT S YMMETRY G ROUPS
This experiment compares the equivariant networks deﬁned in three different symmetry groups: C 8 ,
C 4 , and C 2 .
We run this experiment in SACfD with the same setup as in Section 6.3.
As is shown in Figure 16, the network deﬁned in C 8 generally outperforms the network deﬁned in C 4 , followed by the network deﬁned in C 2 .
H. E QUIVARIANT SAC F D IN N ON -S YMMETRIC E NVIRONMENTS
This experiments evaluates the performance of Equivariant SACfD in non-symmetric tasks where the initial orientation of the environments are ﬁxed rather than random.
(Similarly as in Section 6.
but both the training and the evaluation environments have the ﬁx orientation.)
Speciﬁcally, in Block
Pulling, the two blocks in the training environment is initialized with a ﬁxed relative orientation; in Drawer Opening, the drawer is initialized with a ﬁxed 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 signiﬁcant.
H. R OTATIONAL A UGMENTATION + B UFFER A UGMENTATION
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.