Elio Saade
Note

MDP Homomorphic Networks: Group Symmetries in Reinforcement Learning

MDP with Symmetries

In a MDP with symmetries, there exists transformations on the state-action space that leave the reward and state transition invariant. Consider a state transformation Lg:S→SL_g : \mathcal{S}\rightarrow \mathcal{S} and a state-dependent action transformation Kgs:A→AK_g^s:\mathcal{A} \rightarrow \mathcal{A}, then invariance of the reward and state transition in a MPD with symmetries are defined as
R(s,a)=R(Lg[s],Kgs[a])R(s,a)=R(L_g[s], K^s_g[a])
T(s′∣s,a)=T(Lg[s′]∣Lg[s],Kgs[a])T(s' \vert s, a) = T( L_g[s'] \vert L_g[s], K^s_g[a])

Main Problem

In traditional deep RL, symmetry is not inherently applied into the problem. If the agent collects a transition with ss and aa, it does not affect the learning of Lg[s]L_g[s] and KGa[a]K^a_G[a]. The agent would have to explore these state action pairs independently, and even then, it is not guaranteed that the trained policy network would produce a symmetric behavior. This affects the sample efficiency and learning speed of the RL algorithm as it would have to explore the whole state-action space instead of learning from equivalent transitions.

Paper's Idea

The paper aims to build the symmetry directly into the policy and value neural networks. In other words, they want the networks to be equivariant, i.e., to satisfy:
π(Lg[s])=Kas[π(s)]\pi(L_g[s]) = K^s_a[\pi(s)]
Which means that: transform the state and pass it through the network = pass the state through the network then transform action

The idea is to constrain the weight matrices of ordinary linear layers such that the network satisfies the relation above.
Starting from a single MLP layer z′=Wz+bz'=Wz+b, the bias can be merged into the weights: W←[W,b]W \leftarrow [W, b] and z←[z,1]z \leftarrow [z,1] to obtain z′=Wzz'=Wz. Given the symmetry transformations (Lg,Kg)(L_g, K_g), then the layer must satisfy:
KgWz=WLgzK_gWz=WL_gz
By dropping zz:
KgW=WLgK_gW=WL_g
This is a linear constrain in WW.

They propose a numerical method to find the set of matrices WW that satisfy the constraint:
Equivariant_Layer.png

where the symmetrizer is defined as
S(W)≜1∣G∣∑g∈GKg−1WLgS(W) \triangleq \frac{1}{|G|} \sum_{g \in G} K^{-1}_gWL_g
Algorithm 1 produces the matrices ViV_i that form the basis of WW. In other words, WW is a linear combination of the basis weights {Vi}i=1r\{V_i\}_{i=1}^r:
W=∑i=1rciViW=\sum_{i=1}^rc_iV_i
where the cic_i's are the learnable parameters of the layer.

Because each ViV_i is equivariant, then their linear combination is equivariant. Also, the composition of equivariant functions is equivariant, then, having having multiple equivariant layers results in an equivariant network.

Connections

Direct relationships to this note.