#  On discrete symmetries of robotics systems:
A group-theoretic and data-driven analysis

Daniel Ordonez-Apraez1, Mario Martin23, Antonio Agudo1 and Francesc Moreno-
Noguer1  1 Institut de Robòtica i Informàtica Industrial, CSIC-UPC. 2Barcelona
Supercomputing Center (BSC).  3 Departament de Ciències de la Computació,
Universitat Politècnica de Catalunya (UPC).
[dordonez, aagudo<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

In this work, we study discrete morphological symmetries of dynamical systems,
a predominant feature in animal biology and robotic systems, expressed when
the system’s morphology has one or more planes of symmetry describing the
duplication and balanced distribution of body parts. These morphological
symmetries imply that the system’s dynamics are symmetric (or approximately
symmetric), which in turn imprints symmetries in optimal control policies and
in all proprioceptive and exteroceptive measurements related to the evolution
of the system’s dynamics. For data-driven methods, symmetry represents an
inductive bias that justifies data augmentation and the construction of
symmetric function approximators. To this end, we use group theory to present
a theoretical and practical framework allowing for (1) the identification of
the system’s morphological symmetry group $\mathcal{G}$, (2) data-augmentation
of proprioceptive and exteroceptive measurements, and (3) the exploitation of
data symmetries through the use of $\mathcal{G}$-equivariant/invariant neural
networks, for which we present experimental results on synthetic and real-
world applications, demonstrating how symmetry constraints lead to better
sample efficiency and generalization while reducing the number of trainable
parameters.

##  I Introduction

$\bm{f}_{1}$$g_{r}\cdot\bm{f}_{1}$$g_{t}\cdot\bm{f}_{1}$$g_{s}\cdot\bm{f}_{1}$$e$$g_{r}$$g_{t}$$g_{s}$$g_{t}$$g_{s}$$g_{s}$$g_{t}$$g_{r}$$\bm{h}\doteq\left[\begin{smallmatrix}\bm{{\color[rgb]{0.6,0.42,0.11}\definecolor[named]{pgfstrokecolor}{rgb}{0.6,0.42,0.11}l}}\\\
\mathbf{{\color[rgb]{0.17,0.56,0.14}\definecolor[named]{pgfstrokecolor}{rgb}{0.17,0.56,0.14}k}}\end{smallmatrix}\right]$$g_{s}\cdot\bm{h}$$g_{t}\cdot\bm{h}$$g_{r}\cdot\bm{h}$$\begin{aligned}
g\cdot\bm{y}&=f(g\cdot\bm{x};\ \bm{\phi})\ \ |\ \ \ \forall\ g\
\in\mathcal{K}_{4}\\\
\bm{\phi}&\doteq\left\\{{}^{0}\bm{c},\dotsc,^{l}\bm{c}\right\\}\end{aligned}$$\mathcal{K}_{4}=\left\\{e,g_{s},g_{t},g_{r}\
\ |\ \ g_{s}^{2}=g_{t}^{2}=g_{r}^{2}=e,\
g_{r}=g_{s}g_{r}\right\\}$${}^{0}\bm{c}$$+$${}^{0}\bm{W}$$\times$$\sigma$${}^{l}\bm{c}$$+$$\times$$\sigma$$f(\bm{x};\bm{\phi})$${}^{l}\bm{W}$${}^{0}{\bm{\mathsfit{B}}}$${}^{l}{\bm{\mathsfit{B}}}$$\bm{x}$$g_{s}\cdot\bm{x}$$g_{t}\cdot\bm{x}$$g_{r}\cdot\bm{x}$${}^{0}\bm{z}$${}^{l-1}\bm{z}$$\bm{y}$$g_{s}\cdot\bm{y}$$g_{t}\cdot\bm{y}$$g_{r}\cdot\bm{y}$$\bm{l}$$\mathbf{k}$${}^{0}{\bm{\mathsfit{B}}}_{:,:,1}$${}^{0}{\bm{\mathsfit{B}}}_{:,:,r}$$e$$g_{s}$$g_{s}$$\bm{f}_{1}$$g_{s}\cdot\bm{f}_{1}$$g_{s}\cdot\bm{h}$$\bm{h}$$\mathcal{C}_{2}=\left\\{e,g_{s}\
\ |\ \ g_{s}^{2}=e\right\\}$$\mathsf{Reflection\ plane\ of}\ g_{s}$ Figure 1:
Left: Symmetric configurations of the bipedal robot Atlas (3D animation),
whose morphological symmetry (described by the reflection group
$\mathcal{C}_{2}$) allow it to imitate the reflections of space $g_{s}$ (hint:
see how the text on the robot’s chest is not reflected). Middle: Top-view of
symmetric configurations of the quadruped robot Solo (3D animation), whose
morphological symmetries (described by the Klein four-group $\mathcal{K}_{4}$)
allow it to imitate two perpendicular reflections $(g_{s},g_{t})$ and a
$180^{\circ}$ rotation ($g_{r}$) of space (hint: see how the robot’s heading
direction and legs coloring are not reflected/rotated). Symmetry
transformations (arrows) affect the robot configuration, along with
proprioceptive (center of mass linear ${\bm{l}}$ and angular ${\mathbf{k}}$
momentum) and exteroceptive measurements (terrain elevation, external force
$\bm{f_{1}}$). Right: diagram of a toy $\mathcal{K}_{4}$-equivariant neural
network, processing the symmetric states of robot Solo ${\bm{x}}$ and
outputting the symmetric binary feet contact states ${\bm{y}}$ (see section
V).

Discrete Morphological Symmetries (DMS) are a predominant feature in biology.
The vast majority of living and extinct animal species (including humans)
feature bilateral/sagittal reflection symmetry (i.e., the right side of the
body is approximately a reflection of the left one. See fig. 1-left). While a
significant number of species feature radial symmetry (i.e., two or more
morphological symmetry planes. See fig. 1-center) [12]. Likewise, most robotic
systems share these symmetries due to bio-mimicry design and the precise
duplication of body parts and mechanisms.

In biology, morphological symmetries are related to the duplication and
balanced distribution of body parts [12]. However, in order to study these
phenomena in dynamical systems theory, we present a more rigorous definition
(section IV), which, loosely speaking, defines a DMS as an energy-preserving
linear-transformation of the system state configuration allowing it to
imitate a Euclidean isometry (i.e., a reflection/rotation + translation of
space). For instance, see how the bipedal robot Atlas and the quadruped Solo
in fig. 1 imitate the reflection of space ($g_{s}$) with a discrete change in
their body and limbs pose (i.e., their state configuration).

These morphological symmetries imply that the dynamics and control of body
motions are symmetric [29], which in turn, imprints symmetries in all
proprioceptive and exteroceptive measurements related to the evolution of the
system’s dynamics (e.g. joint torques, depth images, contact forces).
Therefore, for systems with morphological symmetries, we can use data
augmentation to mitigate the challenges of data collection in robotics,
computer graphics, and computational biology. Additionally, in data-driven
applications, we can impose symmetry constraints in machine learning
algorithms to boost sample efficiency and enhance generalization [29, 7, 23].

Despite the potential benefits of exploiting symmetry and the ubiquitous
presence of morphological symmetries in robotic systems, animals, and animated
characters; this relevant inductive bias is frequently left unexploited in
data-driven applications in the fields of robotics, computer graphics, and
computational biology. We attribute the scarce adoption of these techniques to
(1) a missing theoretical framework that consolidates the concept of
morphological symmetries, facilitating their study and  identification, and
(2) a missing practical framework enabling the  efficient and convenient
exploitation of symmetries in real-world data-driven applications.

The absence of a clear theoretical framework makes the process of identifying
morphological symmetries (and the symmetries of proprioceptive and
exteroceptive data) a laborious system-specific and error-prone process. Thus,
it is of no surprise that most recent works exploiting some morphological
symmetry (see [27, 1, 28] in computer graphics, and [23, 16, 10, 6] in
robotics/dynamical systems) have done so only for simple systems and for the
simplest morphological symmetry: the reflection/sagittal symmetry (see fig.
1-left) (with exception of Finzi et al. [6]). While giving no insights on how
to apply these techniques to other systems (especially to systems with more
than a single morphological symmetry).

Contrary to previous works, the focus of this paper is on understanding
morphological symmetries and presenting the theoretical abstractions that
allow studying these phenomena in  arbitrary dynamical systems with  any
number of symmetries. To achieve this, we are required to study morphological
symmetries from the lens of dynamical systems and of group theory (the field
of mathematics that studies symmetries, broadly used in physics and machine
learning) (sections II and III). In summary, our work presents the following
theoretical contributions:

  * ❈

A definition of the set of DMSs of a dynamical system as a  symmetry group
$\mathcal{G}$, isomorphic to a group of isometries of the Euclidean space
(section IV).

  * ❈

A characterization of how DMSs translate to the symmetries of the system’s
state and any proprioceptive and exteroceptive measurements. Facilitating the
identification of $\mathcal{G}$ and the use of data augmentation (section
IV-A).

Lastly, our  practical contributions (section V) are:

  * ✥

An open-access repository111 github.com/Danfoa/RobotEquivariantNN enabling the
prototyping of $\mathcal{G}$-equivariant Neural Networks (NN) for arbitrary
DMS.

  * ✥

Mitigation of the computational and memory complexity of equivariant
architectures. Enabling the construction of large-scale
$\mathcal{G}$-equivariant NN.

  * ✥

We show an approximate $\nicefrac{{1}}{{|\mathcal{G}|}}$ reduction in the
trainable parameters of NN. Being $|\mathcal{G}|$ the number of DMSs.

  * ✥

We derived an optimal initialization for the trainable parameters of
$\mathcal{G}$-equivariant NN layers.

Lastly, we provide optional appendices where we extend our theoretical
derivations and provide tutorial-like examples.

##  II Background on Symmetry Groups

Group theory is the default language for studying symmetry transformations.
Thus, we provide a shallow introduction to the field222 Being this short
section undoubtedly an unsatisfactory introduction to group theory, we refer
the uninitiated and interested reader to Carter [5] for intuition and to
Bronstein et al. [3] for a machine learning introduction.  and define the
notation required for our development. In a nutshell, a symmetry group in
group theory is an abstraction of the  set of symmetries that  different
geometric objects have. Understanding symmetry as a  transformation that
conserves a relevant property of the object (e.g. energy).

For instance, in fig. 1-left the reflection group $\mathcal{C}_{2}$ describes
the symmetries that vectors, pseudo-vectors, rigid-bodies, and the robot atlas
have to a reflection of space $g_{s}$. Being the symmetries, transformations
preserving vector magnitudes and the energy of the robot. Similarly in fig.
1-center, the Klein four-group $\mathcal{K}_{4}$ describes the symmetries that
the quadruped robot Solo has to $180^{\circ}$ rotations ($g_{r}$) and two
perpendicular reflections $(g_{s},g_{t})$. While on fig. 1-right the same
group describes the symmetries of the input ${\bm{x}}$ and output ${\bm{y}}$
vector spaces of a $\mathcal{K}_{4}$-equivariant NN.

This flexible formalism allows us to study the set of morphological symmetries
of a system as a symmetry group. Formally, a symmetry group is a set of
invertible symmetry transformations (or  actions)
$\mathcal{G}=\\{e,g_{1},g_{1}^{\text{-}1},g_{2},\dots\\}$, having an
associative composition operator
$(\cdot):\mathcal{G}\times\mathcal{G}\rightarrow\mathcal{G}$ mapping group
actions to other group actions. And containing the trivial action $e$ (leaving
objects unchanged). Not surprisingly, a group action acts differently on
different objects. Here, is where group  representations allow us to use the
familiar language of linear algebra to characterize how an action $g$
transforms a specific geometric object, say
${\bm{x}}\in\mathcal{X}\subseteq\mathbb{R}^{k}$. A representation
$\rho_{\mathcal{X}}:\mathcal{G}\rightarrow GL(k)$ is a mapping from group
actions to the set of invertible square matrices of $k$ dimensions (i.e., the
General Linear group $GL$). Thus, a representation specifies how objects
${\bm{x}}\in\mathcal{X}$ are transformed by group actions:
$g\cdot{\bm{x}}\doteq{\rho_{\scriptscriptstyle{\mathcal{X}}}(g)}{\bm{x}}$.

A fundamental concept for this work is the notion of function
$\mathcal{G}$-equivariance and $\mathcal{G}$-invariance. The function
$f:\mathbb{R}^{n}\rightarrow\mathbb{R}^{m}$, is said to be
$\mathcal{G}$-equivariant or $\mathcal{G}$-invariant if:

${\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{g\cdot{\bm{y}}=f(g\cdot{\bm{x}})\,|\,\forall
g\in\mathcal{G}}}_{Equivariance}}}\quad\text{or}\quad{\color[rgb]{0.570,0.458,0.0912}\definecolor[named]{pgfstrokecolor}{rgb}{0.570,0.458,0.0912}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{{\bm{y}}=f(g\cdot{\bm{x}})\,|\,\forall
g\in\mathcal{G}}}_{Invariance}}}.$ (1)

Roughly speaking, an equivariant function maps symmetries of the input to
symmetries of the output, while an invariant function maps symmetries of the
input to an invariant output.

##  III Lagrangian Mechanics and Symmetries of Dynamical Systems

Here we provide a group-theoretic perspective of symmetries in an arbitrary
dynamical system. The definitions and notations of this section are
fundamental for understanding the objective of this work, namely DMSs. To this
end, let us consider a dynamical system with generalized coordinates
${\bm{q}}\in\mathrm{Q}\subseteq\mathbb{R}^{n}$ and velocities
$\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}\subseteq\mathbb{R}^{n}$.
Being $\mathrm{Q}$ the constrained configuration space, and
$\mathrm{T}_{{\bm{q}}}\mathrm{Q}$ the space of constrained generalized
velocities (i.e., the configuration tangent space at ${\bm{q}}$).
Additionally, consider a Lagrangian function
$\mathcal{L}:\mathrm{Q}\times\mathrm{T}_{{\bm{q}}}\mathrm{Q}\rightarrow\mathbb{R}=\mathcal{T}({\bm{q}},\dot{{\bm{q}}})-\mathcal{U}({\bm{q}},\dot{{\bm{q}}})$
specifying the total energy of the system at any state. Where
$\mathcal{T}({\bm{q}},\dot{{\bm{q}}})$, $\mathcal{U}({\bm{q}},\dot{{\bm{q}}})$
describe the state kinetic and potential energies, respectively.

The symmetries of a dynamical system are defined as transformations in the
space of generalized coordinates that keep the total energy of the system
invariant [18, 14]. In this work, we study time-invariant linear
transformations of generalized coordinates
${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}:\mathbb{R}^{n}\rightarrow\mathbb{R}^{n}$,
which are interpreted as the representations of actions of a symmetry group:
$g\cdot{\bm{q}}\doteq{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}{\bm{q}}\,|\,\forall\;{\bm{q}}\in\mathrm{Q},g\in\mathcal{G}$.
Note that because of the linearity of the transformation, the velocity and
acceleration of the transformed coordinates are given by
$g\cdot\dot{{\bm{q}}}\doteq{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\dot{{\bm{q}}}$
and
$g\cdot\ddot{{\bm{q}}}\doteq{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\ddot{{\bm{q}}}$,
respectively.

Formally, we say that a dynamical system has a symmetry group $\mathcal{G}$ if
its  Lagrangian is $\mathcal{G}$-invariant:

$\begin{split}\mathcal{L}\left({\bm{q}},\dot{{\bm{q}}}\right)=\mathcal{L}\left(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}}\right)\,|\,\forall
g\in\mathcal{G},{\bm{q}}\in\mathrm{Q},\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}.\\\
\end{split}$ (2)

Being $g$ a  feasible symmetry if the transformed state is a feasible state,
i.e. when $g\cdot{\bm{q}}\ \in\mathrm{Q}$ and
$g\cdot\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}$ (assuming both
$\mathrm{Q}$ and $\mathrm{T}_{{\bm{q}}}\mathrm{Q}$ are connected sets).

Since the Lagrangian structure differs between the original
$({\bm{q}},\dot{{\bm{q}}})$ and transformed coordinates
$(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}})\;|\;\forall\;g\in\mathcal{G}$, when we
derive the Equations of Motion (EoM) of the system in the set of transformed
coordinates, we obtain a set of EoMs describing the true system dynamics in
different coordinate systems. Formally, if we derive the EoM through the
Euler-Lagrange equation of the second order
$\left(\frac{d}{dt}\frac{\partial\mathcal{L}\left({\bm{q}},\dot{{\bm{q}}}\right)}{\partial\dot{{\bm{q}}}}-\frac{\partial\mathcal{L}\left({\bm{q}},\dot{{\bm{q}}}\right)}{\partial{\bm{q}}}\equiv\mathbf{M}({\bm{q}})\ddot{{\bm{q}}}-\bm{\tau}({\bm{q}},\dot{{\bm{q}}})=\bm{0}\right)$,
the distinct EoM are equivariant to each other [14], a property we will refer
to as  dynamics $\mathcal{G}$-equivariance:

$g\cdot[{\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\mathbf{M}({\bm{q}})\ddot{{\bm{q}}}}}_{Inertial}}}-{\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\bm{\tau}({\bm{q}},\dot{{\bm{q}}})}}_{Moving}}}]={\color[rgb]{0.570,0.458,0.0912}\definecolor[named]{pgfstrokecolor}{rgb}{0.570,0.458,0.0912}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\mathbf{M}(g\cdot{\bm{q}})g\cdot\ddot{{\bm{q}}}}}_{Inertial}}}-{\color[rgb]{0.570,0.458,0.0912}\definecolor[named]{pgfstrokecolor}{rgb}{0.570,0.458,0.0912}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\bm{\tau}(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}})}}_{Moving}}}=\bm{0}\\\
\,|\,\;\forall\;g\in\mathcal{G},\;{\bm{q}}\in\mathrm{Q},\;\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}.$
(3)

Denoting $\mathbf{M}({\bm{q}}):\mathrm{Q}\rightarrow\mathbb{R}^{n\times n}$ as
the generalized mass matrix function and
$\bm{\tau}({\bm{q}},\dot{{\bm{q}}}):\mathrm{Q}\times\mathrm{T}_{{\bm{q}}}\mathrm{Q}\rightarrow\mathbb{R}^{n}$
as the generalized moving forces at a given state $({\bm{q}},\dot{{\bm{q}}})$.
Note that, in eq. 3 the original and transformed dynamics are related linearly
by the Jacobian of the coordinate transformation [25]. Which in this case is
${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}$ (reduced to $g$ to preserve
notation).

Note that to ensure dynamics $\mathcal{G}$-equivariance (eq. 3), both the
generalized inertial and moving forces need to be independently equivariant,
implying:

$\mathbf{M}(g\cdot{\bm{q}})=g\mathbf{M}({\bm{q}})g^{\text{-}1}\quad\land\quad
g\cdot\bm{\tau}({\bm{q}},\dot{{\bm{q}}})=\bm{\tau}(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}})\\\
\,|\,\;\forall\;g\in\mathcal{G},\;{\bm{q}}\in\mathrm{Q},\;\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}.$
(4)

The resultant $\mathcal{G}$-equivariance of the generalized mass matrix
becomes an identifying property of symmetrical systems, providing a pathway
for the  identification of action representations of the symmetry group
${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\;|\;g\in\mathcal{G}$ (section
IV-B). While the equivariance of the generalized moving forces (which in
practice usually incorporates control, constraint, and external forces)
implies that dynamics $\mathcal{G}$-equivariance (eq. 3) is upheld until a
symmetry breaking force violates the equivariance of $\bm{\tau}$.

To gain some intuition, consider the bipedal robot Atlas with a symmetry group
$\mathcal{G}=\mathcal{C}_{2}=\\{e,g_{s}\\}$. For this system, eq. 2 says that
both robot states in fig. 1-left are symmetric states (related by the action
$g_{s}$). Then, eq. 3 says that any motion trajectory of the robot to the left
is equivalent (up to transformation by $g_{s}$) to the motion trajectory of
the robot to the right. This, if both motion trajectories feature
$\mathcal{C}_{2}$-equivariant control and external interactions (eq. 4). A
similar analysis follows for systems with larger symmetry groups (e.g. Solo in
fig. 1-center).

###  III-A Floating-base dynamical systems

Let us now narrow our focus to floating-base dynamical systems. Namely,
legged/flying/swimming/moving robots, animals, and animated characters
evolving in a Euclidean space of $d$ dimensions (space embedded with its
corresponding Euclidean group of isometries $\mathbb{E}_{d}$, representing
$d$-dimensional rotations/reflections $+$ translations), being
$d\in\\{0,1,2,3\\}$. For these systems, the generalized coordinates can be
decoupled into ${\bm{q}}=\begin{bmatrix}{\bm{X}}_{{B}}\\\
\hat{{\bm{q}}}\end{bmatrix}\in\mathrm{Q}\doteq\mathbb{E}_{d}\times\mathrm{Q}_{J}$.
Where ${\bm{X}}_{{B}}\in\mathbb{E}_{d}$ represents the system’s base (or
center of mass (CoM)) position and orientation333 We deliberately abuse
notation to keep the homogeneous matrix representation ${\bm{X}}_{{B}}$ of
position and orientation, instead of the vector-quaternion representation,
common in robotics and computer graphics. ,
$\hat{{\bm{q}}}\in\mathrm{Q}_{J}\subseteq\mathbb{R}^{n_{J}}$ represents the
internal Degrees of Freedom (DoF) configuration, and $\mathrm{Q}_{J}$ is the
internal constrained configuration space, commonly referred to as joint-space.
In this coordinate space, we can decouple the effect of the symmetry actions
$g$ on $\mathbb{E}_{d}$ and $\mathrm{Q}_{J}$, noting that:
$g\cdot{\bm{q}}={\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\>{\bm{q}}=\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}&\bm{0}\\\
\bm{0}&{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\end{bmatrix}\begin{bmatrix}{\bm{X}}_{{B}}\\\
\hat{{\bm{q}}}\end{bmatrix}\;\big{|}\;\forall\;g\in\mathcal{G}$. With
representation
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}\in\mathbb{E}_{d}$ being a
homogeneous matrix transformation affecting the base, and
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\in\mathbb{R}^{{n_{J}}\times{n_{J}}}$
describing the transformation of the joint-space configuration. This
decoupling enables the differentiation between the system’s morphological
symmetries (section IV) and symmetries to Euclidean isometries.

#### Symmetries to Euclidean isometries

floating-base systems are known for having symmetries to (some) continuous
translations and/or rotations/reflections of space . These symmetries belong
to a subset of the Euclidean group $\overline{g}\in\mathbb{E}_{d}$ (denoted as
$\overline{g}$ to highlight that the action represents a true Euclidean
isometry). The identifying property of these symmetries is the invariance of
the system’s joint-space
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(\overline{g})}={\bm{I}}_{{n_{J}}}\,|\,\;\forall\;\overline{g}\in\mathbb{E}_{d}$,
contrary to DMSs (section IV). For instance, the robot Altas (fig. 1) is
symmetric to true reflections of space and to horizontal translations (eq. 2).
These transformations leave the joint-space configuration invariant, while the
dynamics of the transformed system is related to the original up to the
reflection/translation (eq. 3).

##  IV Discrete morphological symmetries (DMSs)

A DMS is a mathematical formalization of the property of some dynamical
systems that can imitate the effect of rotations, translations, and infeasible
reflections of space with a feasible discrete change in the system
configuration. To understand DMSs it is helpful to first study the most simple
(and most frequent) DMS: the reflection symmetry, which all humans and most
animals approximately possess [12].

#### Reflection DMS ($\mathcal{G}=\mathcal{C}_{2}$)

Despite most floating-base dynamical systems being symmetric (eq. 2) to
reflections of space ($\overline{g}\in\mathbb{E}_{d}$), in practice, it is
common to ignore reflection symmetries, since, in general, it is infeasible to
subject a real-world dynamical system to a true reflection of space [21].
However, systems with sagittal symmetry (e.g., Atlas in fig. 1-left, or the
reader of this work) can  imitate the effect of a true reflection of space
with a feasible discrete change in the system’s configuration (i.e., modifying
your internal configuration (your body pose), and rotating and translating
your base/hip). Therefore, Atlas and you share the same DMS, making your DMS
group the reflection group $\mathcal{G}=\mathcal{C}_{2}$.

#### Multiple DMSs ($|\mathcal{G}|>2$)

When a floating-base system has $k\geq 2$ DMSs it is able to imitate more than
a single Euclidean isometry (i.e., some subset of rotation/reflections $+$
translations) (see fig. 1-center). For these systems, the set of DMSs forms a
group $\mathcal{G}$ that is isomorphic to a subset of Euclidean isometries
(i.e., there is a one-to-one invertible mapping between the set
$g\in\mathcal{G}$ and a subset of $|\mathcal{G}|$ Euclidean isometries
$\overline{g}\in\mathbb{E}_{d}$). Most frequently $\mathcal{G}$ is a Cyclic
$\mathcal{C}_{k}$ group (for systems able to imitate $k$ distinct rotations)
or Dihedral $\mathcal{D}_{2k}$ group (for systems able to imitate $k$ distinct
rotations and a reflection). See examples for $\mathcal{C}_{3}$ in fig. 6, and
for $\mathcal{D}_{4}\equiv\mathcal{K}_{4}$ in fig. 1-center. However, the
symmetries in $\mathcal{G}$ could imitate a finite or infinite set of
Euclidean isometries.

######  Definition (Discrete morphological symmetry).

A floating-base dynamical system with generalized coordinates
${\bm{q}}\in\mathrm{Q}\doteq\mathbb{E}_{d}\times\mathrm{Q}_{J}$, is said to
have a DMS if, for a given Euclidean isometry $\overline{g}\in\mathbb{E}_{d}$,
there exists an action $g\in\mathcal{G}$, with a  proper representation in
$\mathbb{E}_{d}$ ($|{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}|=1$) and a
non-trivial representation in joint-space
(${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\neq{\bm{I}}_{{n_{J}}}$), such
that both $g$ and $\overline{g}$ are equivalent symmetries of the system:

$\mathcal{L}\left({\bm{q}},\dot{{\bm{q}}}\right)=\mathcal{L}\left(\overline{g}\cdot{\bm{q}},\overline{g}\cdot\dot{{\bm{q}}}\right)=\mathcal{L}\left(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}}\right)\\\
\,|\,g\in\mathcal{G},\;\overline{g}\in\mathbb{E}_{d},\;\forall\;g\cdot{\bm{q}},{\bm{q}}\in\mathrm{Q},\;g\cdot\dot{{\bm{q}}},\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}.$
(5)

The set of DMSs of a dynamical system forms its symmetry group $\mathcal{G}$.
The characteristic properties of these symmetries are that they represent
feasible transformations involving a change in joint-space configuration.

Having identified a potential Euclidean isometry to imitate
$\overline{g}\in\mathbb{E}_{d}$, we can determine
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}$. Since at any system state:

$\small\mathcal{L}\big{(}{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}{\bm{X}}_{{B}}\\\
\hat{{\bm{q}}}\end{bmatrix}},{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}\dot{{\bm{X}}}_{{B}}\\\
\dot{\hat{{\bm{q}}}}\end{bmatrix}}\big{)}=\mathcal{L}\big{(}{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}{\bm{X}}_{{B}}\\\
{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\;\;\hat{{\bm{q}}}\end{bmatrix}},{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}\dot{{\bm{X}}}_{{B}}\\\
{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\;\;\dot{\hat{{\bm{q}}}}\end{bmatrix}}\big{)}\\\
\bigg{|}\quad{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\begin{aligned}
&|{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}|=\pm
1,\;|{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}|=1\\\
&{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}{\bm{X}}={\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}{\bm{X}}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}^{\text{-}1}\end{aligned}}$
(6)

This structure of the proper transformation
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}{\bm{X}}={\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}{\bm{X}}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}^{\text{-}1}$,
along with the $\mathcal{G}$-equivariant nature of the system generalized mass
matrix (eq. 4), provide a pathway for the identification of $\mathcal{G}$ and
the representations ${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\;|\;\forall
g\in\mathcal{G}$ for any floating-base dynamical system (section IV-C).

###  IV-A Data augmentation in systems with DMS

Recall from section III that due to the linearity of the transformation
$g\cdot{\bm{q}}={\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}{\bm{q}}$, the same
action representation ${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}$ acts on
elements of the configuration tangent space $\mathrm{T}_{{\bm{q}}}\mathrm{Q}$
and any higher order tangent spaces:
$g\cdot\dot{{\bm{q}}}={\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\dot{{\bm{q}}}$,
$g\cdot\ddot{{\bm{q}}}={\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\ddot{{\bm{q}}}$,
including generalized forces
$g\cdot\bm{\tau}={\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\bm{\tau}$ (eq. 3).
Since our floating-base systems’ configuration space has the structure
$\mathrm{Q}\doteq\mathbb{E}_{d}\times\mathrm{Q}_{J}$, this property translates
to the action representations on $\mathbb{E}_{d}$ and $\mathrm{Q}_{J}$. This
effectively implies that ${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}$ can
be used to augment elements of $\mathbb{E}_{d}$ and of $\mathbb{E}_{d}$ higher
order tangent spaces (i.e., points, vectors, pseudo-vectors, orientations,
linear & angular velocities/accelerations). Likewise the representation
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$ can be used to augment
members of $\mathrm{Q}_{J}$ and its higher order tangent spaces (i.e., joints
positions/velocities/accelerations, joint forces/torques).

In practice, this means that any proprioceptive (e.g., joint torques, contact
forces) and exteroceptive (e.g., point clouds, terrain height maps, RGBD-
images) measurements relevant to the evolution of the system’s dynamics, can
be augmented solely with combinations of
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}$,
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}$ and
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$, as these measurements are
composed of elements in $\mathrm{Q}$ and $\mathbb{E}_{d}$ and their higher
order tangent spaces (see examples in sections C-C1 and C-D1). Furthermore,
any data point will have $|\mathcal{G}|$ symmetric data points, being
$|\mathcal{G}|$ the order of the group (i.e., the number of symmetries). This,
roughly implies that for every minute of recorded data of a system with a
symmetry group of order $|\mathcal{G}|=4$ (e.g. fig. 1-center) we can obtain
an additional $3$ minutes of recordings, solely by considering the symmetric
states of the recorded data.

To exploit the measurements’ symmetries we need to identify the joint-space
representations ${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$. However,
this requires further assumptions over the nature of the system. Here, we
study the case of rigid-body dynamics, but a similar analysis is possible for
other types of systems, e.g., soft robots.

###  IV-B DMS in the case of rigid-body dynamics

In this section, we assume the system dynamics are ruled by rigid-body
dynamics. Implying that our system is a collection of ${n_{B}}$ interconnected
rigid bodies. This is the usual scenario in robotics, computer graphics, and
computational biology.

In rigid body dynamics, the generalized mass matrix is given by
$\mathbf{M}({\bm{q}})=\sum_{k}^{{n_{B}}}\mathbf{J}_{T_{k}}({\bm{q}})^{\intercal}m_{k}\mathbf{J}_{T_{k}}({\bm{q}})+\mathbf{J}_{R_{k}}({\bm{q}})^{\intercal}\mathbf{I}_{k}\mathbf{J}_{R_{k}}({\bm{q}})$,
being
$\mathbf{J}_{T_{k}}({\bm{q}}):\mathrm{Q}\rightarrow\mathbb{R}^{d\crossproduct
n}$ and
$\mathbf{J}_{R_{k}}({\bm{q}}):\mathrm{Q}\rightarrow\mathbb{R}^{d\crossproduct
n}$ the position and orientation Jacobians, used to map generalized velocities
to the linear
($\mathbf{\dot{r}}_{k}=\mathbf{J}_{T_{k}}({\bm{q}})\dot{{\bm{q}}}$) and
angular ($\bm{\mathit{w}}_{k}=\mathbf{J}_{R_{k}}({\bm{q}})\dot{{\bm{q}}}$)
velocities of the body $k$ [26]. With $\mathbf{M}({\bm{q}})$, we can formulate
the kinetic energy of the system as
$\small\mathcal{T}({\bm{q}},\dot{{\bm{q}}})=\frac{1}{2}\sum_{k}^{{n_{B}}}m_{k}\mathbf{\dot{r}}_{k}^{2}+\bm{\mathit{w}}_{k}^{\intercal}\mathbf{I}_{k}\bm{\mathit{w}}_{k}=\frac{1}{2}\dot{{\bm{q}}}^{\intercal}\mathbf{M}({\bm{q}})\dot{{\bm{q}}}$.
Allowing us to understand the $\mathcal{G}$-equivariance nature of
$\mathbf{M}({\bm{q}})$ (eq. 4) as required property for actions
$g\in\mathcal{G}$ to conserve kinetic energy.

These Jacobians are functions of the  kinematic parameters of the system444
The Denavit–Hartenberg parameters are a common convention of kinematic
parameters adopted in robotics and computer graphics. . While the mass and
inertia of all bodies are the system’s  dynamic parameters. A DMS implies
symmetries over both kinematic and dynamic parameters.

#### Symmetries of kinematic parameters (Kinematic Tree)

Roughly speaking, the symmetry in kinematic parameters can be interpreted as a
kinematic tree symmetry. Requiring the DMS $g$ to modify the system state such
that the resultant kinematic tree is indistinguishable from the one obtained
by applying the Euclidean isometry $\overline{g}$.

To see this, we ignore momentarily the dynamic parameters and study the
$\mathcal{G}$-equivariant nature of $\mathbf{M}({\bm{q}})$ (eq. 4). For any
symmetry (eq. 2) the rigid-body system must have positional and rotational
Jacobians that respect
$\mathbf{J}_{T_{i}}(g\cdot{\bm{q}})=\mathbf{J}_{T_{k}}({\bm{q}})g^{\text{-}1}\land\mathbf{J}_{R_{i}}(g\cdot{\bm{q}})=\mathbf{J}_{R_{k}}({\bm{q}})g^{\text{-}1}\;|\;\forall\;g\in\mathcal{G}$.
If $\mathcal{G}$ is a group of DMSs (i.e., each $g\in\mathcal{G}$ imitates an
Euclidean isometry $\overline{g}\in\mathbb{E}_{d}$), we have that the $i^{th}$
body Jacobians respect:

$\displaystyle\begin{split}\small\mathbf{J}_{T_{i}}(g\cdot{\bm{q}})g&=\mathbf{J}_{T_{k}}(\overline{g}\cdot{\bm{q}})=\mathbf{J}_{T_{k}}(q)\overline{g}^{\text{-}1}\;\;\text{and}\;\;\\\
\mathbf{J}_{R_{i}}(g\cdot{\bm{q}})g&=\mathbf{J}_{R_{k}}(\overline{g}\cdot{\bm{q}})=\mathbf{J}_{R_{k}}(q)\overline{g}^{\text{-}1}\\\
&\;|\;\forall\;\\{(g,\overline{g})\;|\;g\in\mathcal{G},\overline{g}\in\mathbb{E}_{d}\\},\end{split}$
(7)

where $i$ is the body index in the kinematic tree result of applying action
$g$, while $k$ is the body index in the kinematic tree result of applying the
Euclidean isometry $\overline{g}$. When $k\neq i$ the representation
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$ of the DMS, involves a
permutation/exchange of body’s $i$ and $k$ joint-space configuration. For
instance, the action $g_{s}$ exchanges the left and right legs configurations
of robots Altas and Solo in fig. 1.

However, kinematic tree symmetries (eq. 7) is a required but not sufficient
condition for DMSs. Additional symmetries over the dynamic parameters are
required.

#### Symmetries of dynamic parameters (Mass & Inertia)

Roughly speaking, in addition to the kinematic tree symmetry of eq. 7
(relating the configuration of bodies $i$ and $k$ in space) the mass, CoM, and
the inertia of the bodies $i$ and $k$ need to be equivalent. This ensures the
$\mathcal{G}$-equivariance of $\mathbf{M}({\bm{q}})$ (eq. 4) and in turn the
existence of the DMS (eq. 5).

To understand this morphological constraint, consider the base body
configuration ${\bm{X}}_{{B}}\in\mathbb{E}_{d}$ transformed by the DMS
(${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}{\bm{X}}_{{B}}={\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}{\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}^{\text{-}1}$)555
Where the action on the left of ${\bm{X}}_{{B}}$ is interpreted as a Euclidean
isometry of the base in a global reference frame and the action to the right
as a Euclidean isometry in the frame attached to the base. , and transformed
by the Euclidean isometry $\overline{g}$, which the DMS imitates,
(${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}{\bm{X}}_{{B}}$).
For both base configurations to have the same dynamics, their CoM must
coincide, and more importantly, the Inertia matrix $\mathbf{I}_{B}$ in both
configurations should be identical. Because in general,
${\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(g)}\neq{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}$,
the rigid-body Inertia must be invariant to the right transformation
${\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}^{\text{-}1}$
(eq. 6). This inertia invariance implies a  symmetric mass distribution of the
rigid body (see geometric proof in section A-B)).

To gain some intuition, consider the non-trivial example of robot Solo in fig.
1-center. This robot is able to imitate two reflections of space
($\overline{g}_{t}$, $\overline{g}_{s}$) and a $180^{\circ}$ rotation of space
$\overline{g}_{r}$, because its base body has two symmetry planes (see fig.
2), making the reflected inertia of the base, at any arbitrary configuration,
invariant under the transformation
${\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}^{\text{-}1}\;|\;\overline{g}\in\\{e,\overline{g}_{t},\overline{g}_{s},\overline{g}_{r}\\}\in\mathcal{K}_{4}$.
As discussed in section IV-C, the set of potential isometries that a DMS could
imitate is the set of isometries to which the inertia of the base of the
system is invariant.

Note, however, that we do not impose this inertia invariance constraint on
other rigid bodies of the robot (the bodies composing each of the four legs).
This happens when the kinematic tree is  modular (i.e., has multiple kinematic
subchains containing rigid bodies that are reflected or identical versions of
rigid bodies in another subchain). For the robot Solo, this modularity is
expressed in the left legs’ rigid bodies being true reflections ($g_{s}$) of
the right legs’ rigid bodies. While the front legs’ bodies are true
reflections ($g_{t}$) of the hind legs’ bodies.666 This front-hind reflection
symmetry of the base and rigid bodies of the legs of the robot Solo is why
this quadruped has additional DMSs ($g_{t}$) compared to quadrupeds in nature.
This allows to determine
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\,|\,\forall\;g\in\mathcal{K}_{4}$
as the exchange of configuration of left-right legs (for $g_{s}$) and of
front-hind legs (for $g_{t}$). Complying with eq. 5 for all isometries.

Figure 2: Robot Solo sagittal (blue) and transversal (red) symmetry planes of
the base rigid body.

###  IV-C Identification of DMS group $\mathcal{G}$ in rigid-body dynamics

The identification of the DMS group $\mathcal{G}$ of a floating-base dynamical
system, composed of rigid-bodies, can be outlined in four steps (see tutorial
examples in fig. 6):

  1. 1.

Identify all the unique bodies of the kinematic tree (i.e., no duplicated or
reflected version of the body in the tree) including the base of the system.

  2. 2.

Identify the set of Euclidean isometries $\overline{g}\in\mathbb{E}_{d}$ for
which the inertia of each unique body is simultaneously invariant. These are
the candidate Euclidean isometries for which DMSs of the system could exist.

  3. 3.

Identify modularity in the kinematic tree. i.e., all sets of
duplicated/reflected symmetric kinematic subchains.

  4. 4.

From base to end-effectors use eq. 7 to determine for each $\overline{g}$, if
the action $g$ exists and its a feasible symmetry.

Although the analysis presented might appear to be excessive for simple
systems and simple DMS groups, the abstractions presented open the door for
the study of more complex systems and symmetry groups, for computational
design of symmetric robotic systems, and for algorithmic identification of
DMSs and data augmentation.

(a)

(b)

(c)

Figure 3: CoM-estimation results comparing MLP, MLP-aug, and EMLP models. Left
and Middle: Test set sample efficiency, for robot Solo and Atlas, of model
variants with different capacities (number of neurons hc in hidden layers).
Right: Sample efficiency for robot Solo (fig. 1), of models with $hc=512$,
when exploiting $\mathcal{G}=\mathcal{K}_{4}$ (sagittal and traversal
symmetries) and
$\mathcal{G}=\mathcal{C}_{2}=\\{e,g_{s}\\}\subset\mathcal{K}_{4}$ (only
sagittal symmetry). Plots display average and standard deviation across $10$
seeds.

##  V $\mathcal{G}$-Equivariant and $\mathcal{G}$-Invariant Function
Approximators

Once we identified the DMS group $\mathcal{G}$ of our system, we know that any
proprioceptive or exteroceptive measurements have the same symmetry group
$\mathcal{G}$ (section IV-A). Therefore, to improve generalization and sample
efficiency, we can exploit the known symmetries of the input ${\bm{x}}$ and
output ${\bm{y}}$ spaces, of any mapping we desire to approximate, by
constructing $\mathcal{G}$-equivariant or $\mathcal{G}$-invariant (eq. 1) NN
$f({\bm{x}};\bm{\phi})$, with parameters $\bm{\phi}$ [2]. This section is
built on top of Finzi et al. [7] framework for $\mathcal{G}$-equivariant NN.
Our main motivation is to address the limitations that prohibit the
construction of large-scale $\mathcal{G}$-equivariant NN, which are ubiquitous
in real-life applications (see details in appendix B).

Consider $f\left({\bm{x}};\bm{\phi}\right)$ to be composed of multiple
perceptrons (or convolutional) layers of the form
${}^{l}{\bm{y}}:=\sigma(^{l}{\bm{W}}^{l}{\bm{x}}+\;^{l}\bm{b})$, where
${}^{l}{\bm{x}}\in\mathbb{R}^{n}$, ${}^{l}{\bm{y}}\in\mathbb{R}^{m}$ are the
$l^{th}$ layer input-output. ${}^{l}{\bm{W}}\in\mathbb{R}^{m\times n}$ and
${}^{l}\bm{b}$ are the layer’s linear map and bias; and
$\sigma:\mathbb{R}\rightarrow\mathbb{R}$ is a strictly monotonic nonlinearity
[20]. With this parametrization, the equivariance constraints of eq. 1 can be
reduced to constraints on the linear map ${\bm{W}}$ (dropping the layer index
${l}$ for notation clarity): 777A similar analysis can be made for the bias
vector $\bm{b}$.

${\rho_{\scriptscriptstyle{out}}(g)}{\bm{W}}={\bm{W}}{\rho_{\scriptscriptstyle{in}}(g)}\;\;\iff\;\;({\rho_{\scriptscriptstyle{{\bm{W}}}}(g)}-{\bm{I}}){w}=\bm{0}\\\
\,|\,\forall\;g\in\mathcal{G}.$ (8)

The right-side of eq. 8 is a reformulation of the linear map equivariance
constraints (left-side) as a standard set of linear equations. Denoting
${w}=vec({\bm{W}})\in\mathbb{R}^{mn}$ as a vectorized version of ${\bm{W}}$
and
${\rho_{\scriptscriptstyle{{\bm{W}}}}(g)}={\rho_{\scriptscriptstyle{out}}(g)}\otimes{\rho_{\scriptscriptstyle{in}}(g^{\text{-}1})}^{\intercal}\in\mathbb{R}^{mn\times
mn}$ ($\otimes$ stands for the Kronecker product) as the action representation
acting on the parameter space of the linear map. Here, we consider the group
acting on ${\bm{W}}$ a  semi-direct product888 Since in DMSs the input and
output groups are isomorphic, a direct product results in an overconstraint of
the linear map. Reducing the number of trainable parameters. of the input and
output groups (refer to Finzi et al. [7] for details). Since the constraint
imposed by each $g$ is linear in ${\bm{W}}$, we can stack them into a single
large system of linear equations ${\bm{C}}{w}=\bm{0}$. The nullspace of this
system of equations ${{\bm{B}}}\in\mathbb{R}^{mn\times r}$ describes the $r$
basis vectors spawning the entire space of equivariant linear maps. Allowing
to parameterize all $\mathcal{G}$-equivariant ${\bm{W}}$ as:

$\begin{split}{w}={\textstyle\sum_{k}^{r}}{c}_{k}{{\bm{B}}_{:,k}}\;\;\iff\;\;{\bm{W}}&={\textstyle\sum_{k}^{r}}{c}_{k}\;\textrm{unvec}({{\bm{B}}_{:,k}})\\\
&\doteq{\textstyle\sum_{k}^{r}}{c}_{k}{\bm{\mathsfit{B}}}_{:,:,k}.\end{split}$
(9)

Where the basis coefficients ${\bm{c}}\in\mathbb{R}^{r}$ represent the free
variables of the system of equations and the  trainable parameters of the
equivariant layer (see fig. 1 right).

###  V-A Dealing with memory complexity of equivariant layers:

An equivariant layer needs to store the matrices
${\rho_{\scriptscriptstyle{{\bm{W}}}}(g)}\in\mathbb{R}^{mn\times mn}$ and
${{\bm{B}}}\in\mathbb{R}^{mn\times r}$, in addition to the typical memory
complexity of a perceptron or convolutional layer. These matrices’ memory
complexity quickly becomes intractable for moderate input-output dimensions
(see table I). Fortunately, the symmetry groups of DMSs (finite groups) have
sparse action matrix representations, resulting in both of the aforementioned
matrices being sparse. Our implementation1 extends the Pytorch API from Finzi
et al. [7] to process finite groups with sparse matrix definitions limiting
the additional memory footprint of equivariant layers to a minimum.

###  V-B Dealing with the computational complexity of determining the
equivariant basis ${{\bm{B}}}$

Computing ${{\bm{B}}}$ amounts to finding the nullspace of a large linear
system of equations. Finzi et al. [7] proposes a Krylov gradient-based method
able to handle both finite and Lie groups’ arbitrary representations. While
Van der Pol et al. [23] approximates ${{\bm{B}}}$ through SVD of a matrix
$\bar{\bm{W}}\in\mathbb{R}^{z\times mn}$ ($z\geq mn$). Both approaches run in
polynomial time $\mathcal{O}(r^{2}(mn)^{2})$ (prohibiting their use in large
dimensional spaces) and approximate the space rank $r$ numerically.

Fortunately, DMS groups $\mathcal{G}$ are finite having permutation matrices
as regular representations (which are used for the internal latent spaces
${}^{l}{\bm{z}}$ of the architecture (see fig. 1-right). Such that
$g\cdot{\bm{z}}={\rho_{\scriptscriptstyle{\mathcal{Z}}}(g)}{\bm{z}}\,|\,{\bm{z}}\in\mathcal{Z},g\in\mathcal{G}$).
Reducing the computation of the nullspace ${{\bm{B}}}$ to a search of the
unique permutations (or orbits) of ${w}$ in linear time.

To see this, note that the constraints imposed by each
${\rho_{\scriptscriptstyle{{\bm{W}}}}(g)}$ result in parameter sharing
constraints (e.g., ${w}_{10}=-{w}_{2}=\ldots={w}_{0}$). In these cases, every
vector of the null-space of ${\bm{C}}$ (i.e., ${{\bm{B}}_{i}}$) simply
describes the sharing scheme of a free variable of the system of equations
(i.e., the trainable parameter ${c}_{i}$), and this sharing scheme is nothing
else but one of the unique $r$ orbits of the dimensions of ${w}$ when
transformed by all group actions, e.g.,
$\mathcal{G}\cdot{w}_{10}=\\{g\cdot{w}_{10}\;:\;\forall\;g\in\mathcal{G}\\}=\\{{w}_{10},-{w}_{2},\dots,{w}_{0}\\}$
(see the parameter orbits of length 4 in fig. 1-right, for $\mathcal{K}_{4}$).
The orbits of all $w\in{w}$ are trivially computed with
$[{w},{\rho_{\scriptscriptstyle{{\bm{W}}}}(g_{1})}{w},\dots,{\rho_{\scriptscriptstyle{{\bm{W}}}}(g_{|\mathcal{G}|})}{w}]$,
while the unique $r$ orbits can be identified in $\mathcal{O}(mn)$ time. Our
proposed solution can be thought of as a linear-time version of Ravanbakhsh et
al. [20].

###  V-C Optimal parameter initialization for equivariant layers

Proper initialization of the equivariant layer’s trainable parameters
${\bm{c}}_{l}$ (eq. 9) is required to avoid activations/gradients from
vanishing or exploding [13]. Following the same derivation of the Kaiming
initialization [11] (see section B-B), we can conclude that the parameters
should be initially sampled from a distribution with
$\mathrm{Var}({\bm{c}}_{l})=\nicefrac{{m}}{{\lambda_{{\bm{\mathsfit{B}}}}\gamma_{\sigma}}}$,
to ensure constant variance of activations throughout the network layers (see
fig. 7). Where
$\lambda_{{\bm{\mathsfit{B}}}}=\sum_{i}^{m}\sum_{j}^{n}\sum_{k}^{r}{\bm{\mathsfit{B}}}_{i:j:k}^{2}$
and $\gamma_{\sigma}$ is a nonlinearity dependant scalar (e.g.,
$\gamma_{\text{ReLu}}=\nicefrac{{1}}{{2}}$, $\gamma_{\text{SeLu}}=1$ following
Klambauer et al. [13]). This initialization depends only on
${\bm{\mathsfit{B}}}$. Thus, is applicable to any Lie or finite group.

###  V-D Reduction of trainable parameters in equivariant layers:

Determining analytically the number of trainable parameters (i.e. the rank
$r$) of an $\mathcal{G}$-equivariant layer is, in general, an unresolved
problem. However, for DMS groups, we show on section B-A that the number of
trainable parameters of a $\mathcal{G}$-equivariant layer can range from
$\nicefrac{{|{w}|}}{{|\mathcal{G}|}}\leq r\leq|{w}|$, depending on the number
of dimensions of the input-output spaces left invariant by the symmetry
actions. In practice, this implies that for a $\mathcal{G}$-equivariant layer
without any input-output fixed points (e.g., all intermediate layers of a
$\mathcal{G}$-equivariant NN), the number of trainable parameters is reduced
by $\nicefrac{{1}}{{|\mathcal{G}|}}$ being $|\mathcal{G}|$ the group order.
Therefore a $\mathcal{G}$-equivariant architecture with
$\mathcal{G}=\mathcal{C}_{2}$ (or $\mathcal{G}=\mathcal{K}_{4}$) will have
approximately  $\nicefrac{{1}}{{2}}$ (or $\nicefrac{{1}}{{4}}$) of the
trainable parameters of an unconstrained NN of the same architectural size
(this applies to NN processing data from robot Atlas and Solo fig. 1). The
reduction of parameters is caused by the parameter sharing constraints (eq. 9)
and is visually depicted in fig. 1-right.

##  VI Experiments

We present two experiments of supervised learning, a regression application
using synthetic data and a classification application using real-world data.
Both experiments aim to illustrate the versatility of DMSs for data
augmentation and training of equivariant functions, along with the impact on
the model’s sample efficiency and generalization capacity when exploiting
DMSs. While we keep the presentation concise, all the technical aspects are
detailed in appendix C and 1.

###  VI-A CoM momentum estimation (Regression)

In this experiment, we train a NN to approximate a robot’s center-of-mass
momentum given the joint-space position and velocities:
${\bm{h}}=\mathbf{A}_{G}(\hat{{\bm{q}}})\dot{\hat{{\bm{q}}}}$, where
${\bm{h}}=[{\bm{l}}^{\intercal}\;{\mathbf{k}}^{\intercal}]^{\intercal}$ are
the linear ${\bm{l}}$ and angular ${\mathbf{k}}$ momentum components and
$\mathbf{A}_{G}$ is the Centroidal Momentum Matrix (CMM) of Orin et al. [17].
This analytical function is highly non-linear and $\mathcal{G}$-equivariant to
the robot’s DMS group $\mathcal{G}$ (eqs. 18 and 20). Consequently, the
function approximator is expected to be equivariant or approximately
equivariant.

We test two robots: (1) Atlas, a ${n_{J}}=30[\text{DoF}]$ humanoid robot with
a reflection DMS group $\mathcal{G}=\mathcal{C}_{2}$ (fig. 1-left). (2) Solo,
a ${n_{J}}=12[\text{DoF}]$ quadruped robot with the Klein-4 group as DMS group
$\mathcal{G}=\mathcal{K}_{4}$ (fig. 1-center). Furthermore, we compare three
variants of a function approximation: a standard Multi-Layer Perceptron (MLP),
a version of the MLP trained using data augmentation (MLP-aug), and a version
of the MLP with hard-equivariance constraints (E-MLP).

On fig. 3-left-&-middle, we compare the model variants. For both robots and
all model capacities, the E-MLP and MLP-Aug outperform MLP on sample
efficiency (better generalization with fewer data) and robustness to
overfitting when training data is scarce. Comparing the E-MLP and MLP-Aug
model variants, we see that the lower capacity versions behave similarly, but
as capacity increases, E-MLP starts to show better sample efficiency and
generalization. Lastly, on (fig. 3-right) we compare, for the robot Solo, the
performance of the model variants when exploiting the robots’ entire symmetry
group ($\mathcal{K}_{4}$) and a subgroup of the real symmetry group
($\mathcal{C}_{2}\subset\mathcal{K}_{4}$). The results indicate that sample
efficiency and generalization capacity increase with the number of  true
symmetries of the data exploited.

###  VI-B Static-friction-regime contact detection (Classification)

Figure 4: Static-Friction-Regime contact detection results comparing CNN, CNN-
aug, and ECNN. Left: Sample efficiency in log-log scale. Middle: Average legs
F1-score Right: Classification metrics on test set performance of models
trained with the entire training set. Selected metrics are contact-state
(${\bm{y}}\in\mathbb{R}^{16}$) accuracy (Acc) and f1-score (F1) for each leg
binary contact state. Due to the sagittal symmetry of the robot, the left
front (LF) and right front (RF) legs are expected to be symmetric, as the left
hind (LH) and right hind (RH) legs. F1-score is presented considering the
dataset class imbalance (see section C-D). Reported values represent the
average and standard deviation across $8$ different seeds.

This experiment uses the dataset presented in Lin et al. [15] for the
estimation of static-friction-regime contacts in each of the four legs of the
Mini-Cheetah quadruped robot. These real-world datasets consist of
${\bm{x}}\in\mathbb{R}^{54\times 150}$, the history of the past $150$ time-
frames of proprioceptive data ($\hat{{\bm{q}}}$, $\dot{\hat{{\bm{q}}}}$, base
linear acceleration, base angular velocity, and each of the four legs feet’s
position and velocities). Data was obtained from inboard sensors during
locomotion, with various gaits and terrains. Along with
${\bm{y}}\in\mathbb{R}^{16}$, the ground truth contact state of the robot,
estimated off-line using a non-causal algorithm (i.e., dependant on the past
and future). The objective is to train a causal function approximator
$f({\bm{x}};\bm{\phi})$ for the contact state.

The real-world Mini-Cheetah robot has an  approximate reflection DMS
$\mathcal{G}\approx\mathcal{C}_{2}$. Hence, both the proprioceptive data
${\bm{x}}$ and the contact state ${\bm{y}}$ share the symmetry group
$\mathcal{G}$ (see section C-D). We compare three variants of function
approximators: the original Conv-NN architecture of Lin et al. [15] (CNN), a
version of CNN trained using data-augmentation (CNN-aug), and a version of CNN
with hard-equivariance constraints (E-CNN).

The sampling efficiency of the model variants and the average legs contact
state classification are illustrated in fig. 4-left-&-middle. Where the
equivariant model E-CNN presents better generalization, performance, and
robustness to dataset biases (section C-D2) than the unconstrained models
across all training set sizes, followed by CNN-aug. In fig. 4-right we
evaluate test set classification metrics when using the entire training data.
The E-CNN model outperforms both CNN-aug and CNN on contact state
classification and average leg contact detection. Of relevant importance is
the mitigation of suboptimal asymmetries of the models by exploiting
symmetries. Preventing the model from favoring the classification of one leg
above others (see legs LF and RF in fig. 4-right). Refer to section C-E for
details.

##  VII Conclusions & Discussion

In this work, we present the definition of Discrete Morphological Symmetry
(DMS). A capability of some dynamical systems to imitate the effect of
rotations, translations, and infeasible reflections of space with a feasible
discrete change in the system configuration. Using the language of group
theory we study the set of DMSs of a dynamical system as a symmetry group
$\mathcal{G}$ and conclude that: (1) A system with a symmetry group
$\mathcal{G}$ has $\mathcal{G}$-equivariant generalized mass matrix and
$\mathcal{G}$-equivariant dynamics. (2) That the symmetries of the dynamics
translate to symmetries in optimal control policies and to any proprioceptive
and exteroceptive measurements, related to the evolution of the system’s
dynamics. Thus, justifying the study of DMSs for their potential for data
augmentation and machine learning applications exploiting symmetries.

Furthermore, we present the theoretical abstractions required to study DMSs in
arbitrary dynamical systems with any number of symmetries. With this
formalism, we identify the reflection/sagittal symmetry of humans (and most
animals/robots) as the simplest DMS group $\mathcal{G}=\mathcal{C}_{2}$.
Additionally, we present several examples of more complex DMS groups involving
real robotic systems (for which DMSs can be exploited, but currently are not).

On the practical side, we release an open-access repository enabling the rapid
prototyping of $\mathcal{G}$-equivariant neural networks for the exploitation
of DMS in applications processing data from rigid-body dynamics (e.g.,
robotics, computer graphics, and computational biology). This repository holds
an expanding library of symmetric robotic systems with their groups already
identified. Moreover, we present empirical and theoretical results justifying
the exploitation of DMSs in data-driven applications through data augmentation
or the use of $\mathcal{G}$-equivariant NN. Both symmetry exploitation methods
result in improved sample efficiency and generalization.

#### Limitations

Our work makes two assumptions: (1) that the system symmetry group
$\mathcal{G}$ is finite, and (2) that the symmetries of the system are exact.
For a detailed account of limitations see appendix D.

#### Further work

For data-driven applications the benefits of DMSs suggest the computational
design of symmetrical dynamical systems. While for control applications, the
$\mathcal{G}$-equivariance nature of the generalized mass matrix suggests
research on the numerical implications of this previously unexploited
constraint in optimal control.

## Acknowledgments

This work’s experiments were run at the Barcelona Supercomputing Center in
collaboration with the HPAI group. This work is supported by the Spanish
government with the project MoHuCo PID2020-120049RB-I00 and the ERA-Net
Chistera project IPALM PCI2019-103386.

## References

  * Abdolhosseini et al. [2019] Farzad Abdolhosseini, Hung Yu Ling, Zhaoming Xie, Xue Bin Peng, and Michiel Van de Panne.  On learning symmetric locomotion.  In _Motion, Interaction and Games_ , pages 1–10. 2019.
  * Bronstein et al. [2017] Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst.  Geometric deep learning: going beyond euclidean data.  _IEEE Signal Processing Magazine_ , 34(4):18–42, 2017.
  * Bronstein et al. [2021] Michael M Bronstein, Joan Bruna, Taco Cohen, and Petar Veličković.  Geometric deep learning: Grids, groups, graphs, geodesics, and gauges.  _arXiv preprint arXiv:2104.13478_ , 2021.
  * Carpentier et al. [2019] Justin Carpentier, Guilhem Saurel, Gabriele Buondonno, Joseph Mirabel, Florent Lamiraux, Olivier Stasse, and Nicolas Mansard.  The pinocchio c++ library: A fast and flexible implementation of rigid body dynamics algorithms and their analytical derivatives.  In _2019 IEEE/SICE International Symposium on System Integration (SII)_ , pages 614–619. IEEE, 2019.
  * Carter [2021] Nathan Carter.  _Visual group theory_ , volume 32.  American Mathematical Soc., 2021.
  * Finzi et al. [2021a] Marc Finzi, Gregory Benton, and Andrew G Wilson.  Residual pathway priors for soft equivariance constraints.  _Advances in Neural Information Processing Systems_ , 34:30037–30049, 2021a.
  * Finzi et al. [2021b] Marc Finzi, Max Welling, and Andrew Gordon Wilson.  A practical method for constructing equivariant multilayer perceptrons for arbitrary matrix groups.  In _International Conference on Machine Learning_ , pages 3318–3328. PMLR, 2021b.
  * Funk et al. [2021] Niklas Funk, Charles Schaff, Rishabh Madan, Takuma Yoneda, Julen Urain De Jesus, Joe Watson, Ethan K Gordon, Felix Widmaier, Stefan Bauer, Siddhartha S Srinivasa, et al.  Benchmarking structured policies and policy optimization for real-world dexterous object manipulation.  _IEEE Robotics and Automation Letters_ , 7(1):478–485, 2021.
  * Glorot and Bengio [2010] Xavier Glorot and Yoshua Bengio.  Understanding the difficulty of training deep feedforward neural networks.  In _Proceedings of the thirteenth international conference on artificial intelligence and statistics_ , pages 249–256. JMLR Workshop and Conference Proceedings, 2010.
  * Hamed and Grizzle [2013] Kaveh Akbari Hamed and Jessy W Grizzle.  Event-based stabilization of periodic orbits for underactuated 3-d bipedal robots with left-right symmetry.  _IEEE Transactions on Robotics_ , 30(2):365–381, 2013.
  * He et al. [2015] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun.  Delving deep into rectifiers: Surpassing human-level performance on imagenet classification.  In _Proceedings of the IEEE international conference on computer vision_ , pages 1026–1034, 2015.
  * Holló [2017] Gábor Holló.  Demystification of animal symmetry: Symmetry is a response to mechanical forces.  _Biology Direct_ , 12(1):1–18, 2017.
  * Klambauer et al. [2017] Günter Klambauer, Thomas Unterthiner, Andreas Mayr, and Sepp Hochreiter.  Self-normalizing neural networks.  _Advances in neural information processing systems_ , 30, 2017.
  * Lanczos [2020] Cornelius Lanczos.  _The variational principles of mechanics_.  University of Toronto press, 2020.
  * Lin et al. [2021] Tzu-Yuan Lin, Ray Zhang, Justin Yu, and Maani Ghaffari.  Legged robot state estimation using invariant kalman filtering and learned contact events.  In _5th Annual Conference on Robot Learning_ , 2021.
  * Ordonez-Apraez et al. [2022] Daniel Ordonez-Apraez, Antonio Agudo, Francesc Moreno-Noguer, and Mario Martin.  An adaptable approach to learn realistic legged locomotion without examples.  In _2022 International Conference on Robotics and Automation (ICRA)_ , pages 4671–4678. IEEE, 2022.
  * Orin et al. [2013] David E Orin, Ambarish Goswami, and Sung-Hee Lee.  Centroidal dynamics of a humanoid robot.  _Autonomous robots_ , 35(2):161–176, 2013.
  * Ostrowski and Burdick [1996] Jim Ostrowski and Joel Burdick.  Geometric perspectives on the mechanics and control of robotic locomotion.  In _Robotics Research_ , pages 536–547. Springer, 1996.
  * Quigley [1973] Robert J Quigley.  Pseudovectors and reflections.  _American Journal of Physics_ , 41(3):428–430, 1973.
  * Ravanbakhsh et al. [2017] Siamak Ravanbakhsh, Jeff Schneider, and Barnabas Poczos.  Equivariance through parameter-sharing.  In _International conference on machine learning_ , pages 2892–2901. PMLR, 2017.
  * Selig [2005] Jon M Selig.  _Geometric fundamentals of robotics_ , volume 128.  Springer, 2005.
  * Simpkins [2012] Alex Simpkins.  System identification: Theory for the user, (ljung, l.; 1999)[on the shelf].  _IEEE Robotics & Automation Magazine_, 19(2):95–96, 2012.
  * Van der Pol et al. [2020] Elise Van der Pol, Daniel Worrall, Herke van Hoof, Frans Oliehoek, and Max Welling.  Mdp homomorphic networks: Group symmetries in reinforcement learning.  _Advances in Neural Information Processing Systems_ , 33:4199–4210, 2020.
  * Wang et al. [2022] Rui Wang, Robin Walters, and Rose Yu.  Approximately equivariant networks for imperfectly symmetric dynamics.  _arXiv preprint arXiv:2201.11969_ , 2022.
  * Wheeler [2014] James T. Wheeler.  General coordinate covariance of the euler lagrange equations.  Classical Mechanics class notes, 2014.  URL http://www.physics.usu.edu/Wheeler/ClassicalMechanics/CMCoordinateinvarianceofEulerLagrange.pdf.
  * Wieber [2006] P-B Wieber.  Holonomy and nonholonomy in the dynamics of articulated motion.  In _Fast motions in biomechanics and robotics_ , pages 411–425. Springer, 2006.
  * Yeh et al. [2019] Raymond Yeh, Yuan-Ting Hu, and Alexander Schwing.  Chirality nets for human pose regression.  _Advances in Neural Information Processing Systems_ , 32, 2019.
  * Yu et al. [2018] Wenhao Yu, Greg Turk, and C Karen Liu.  Learning symmetric and low-energy locomotion.  _ACM Transactions on Graphics (TOG)_ , 37(4):1–12, 2018.
  * Zinkevich and Balch [2001] Martin Zinkevich and Tucker Balch.  Symmetry in markov decision processes and its implications for single agent and multi agent learning.  In _In Proceedings of the 18th International Conference on Machine Learning_. Citeseer, 2001.

##  Appendix A Properties of Robotic Systems with DMSs

$\overline{g}$$o$$y$$x$$p$$o$$\mathit{w}$$x$$y$$p_{g}$$\overline{x}$$\overline{y}$$p_{\overline{g}}$$\overline{o}$${}^{\overline{o}}w_{\overline{g}}$$g$$o$$y$$x$$p$$o$$x$$y$$p_{g}$$\overline{x}$$\overline{y}$$p_{\overline{g}}$$\overline{o}$$e$$y$$x$$o$$\overline{x}$$\overline{y}$$\overline{o}$$y$$x$$o$$p_{1}{}_{g}$$p_{1}$$p_{2}$$p_{2}{}_{g}$${}^{\overline{o}}w_{2\overline{g}}$${}^{\overline{o}}w_{1}{}_{\overline{g}}$$\mathit{w}_{1}{}_{\overline{g}}$$\mathit{w}_{2}{}_{\overline{g}}$$\mathit{w}_{\overline{g}}$$\mathit{w}_{2}$$\mathit{w}$$\mathit{w}$${}^{\overline{o}}w_{\overline{g}}$$x$$x$$x$$\mathit{w}_{\overline{g}}$
Figure 5: Properties of bodies capable of imitating a true reflection
$\overline{g}$ of space (w.r.t the $yz$-plane in this case), with a proper
transformation $g$ involving only a rotation and translation. The first row
shows the original bodies with their respective angular velocities
$\bm{\mathit{w}}$, subjected to trivial symmetry transformation $e$ (dashed
lines represent the principle axes of inertia of the bodies), and the second
and third rows display the effect of $\overline{g}$ and $g$ on the bodies and
angular velocities, respectively. The first column displays a rigid body with
symmetric mass distribution, for which $g$ exists, as the reflected and
rotated bodies share an equivalent angular kinetic energy. The second column
shows a rigid body with asymmetrical mass distribution, for which the rotation
$g$, that produces a kinematic symmetry, results in the reflected and rotated
bodies having different angular kinetic energies (eq. 2). The third column
shows two bodies with asymmetrical mass distributions, each a reflected
version of the other, in this case, the action $g$ swaps bodies configurations
to imitate the configuration and energy state of the reflected bodies
transformed with $\overline{g}$. Angular velocity is a pseudo-vector (or
axial-vector), for which a reflection transformation is computed as
$\bm{\mathit{w}}_{\overline{g}}=|{{\bm{R}}_{\overline{g}}}|{{\bm{R}}_{\overline{g}}}\bm{\mathit{w}}$
(see Quigley [19]).

Here, we present a geometric (instead of albegraic) development analog to
section IV-B. For clarity of the explanation, let us imagine two different
Euclidean spaces and two versions of the robot: the original space (with
reference frame $\mathit{o}$) and robot with coordinates ${\bm{q}}$ and
$\dot{{\bm{q}}}$, and the virtual rotated/reflected space (with a reference
frame $\overline{\mathit{o}}$, with configuration
$\tensor*[^{\mathit{o}}]{{{\bm{X}}_{\overline{\mathit{o}}}}}{}=\begin{bmatrix}{{\bm{R}}_{\overline{g}}}&\mathbf{r}_{\overline{\mathit{o}}}\\\
\bm{0}&1\end{bmatrix}$ ) and virtual robot with coordinates
$\overline{g}\cdot{\bm{q}}$ and $\overline{g}\cdot\dot{{\bm{q}}}$ referenced
to $\overline{\mathit{o}}$. Noting that in the case of a reflection, the
virtual robot has reflected versions of each rigid body.

For eqs. 5 and 3 to hold, there must exist an action $g\in\mathcal{G}$
transforming the real robot configuration
$g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}}$ resulting in the same kinetic energy as
the virtual robot’s kinetic energy:

$\begin{split}{\mathcal{T}(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}})}&=\tfrac{1}{2}\sum_{i=1}^{{n_{B}}}m_{i}{\mathbf{\dot{r}}_{g,i}}^{\intercal}{\mathbf{\dot{r}}_{g,i}}+{\bm{\mathit{w}}_{g,i}^{\intercal}}{{\mathbf{I}_{i}}}{\bm{\mathit{w}}_{g,i}}\\\
&\doteq\tfrac{1}{2}\sum_{k=1}^{{n_{B}}}\overline{m}_{k}{\dot{\overline{\mathbf{r}}}_{k}}^{\intercal}{\dot{\overline{\mathbf{r}}}_{k}}+{\overline{\bm{\mathit{w}}}_{k}^{\intercal}}{{\overline{\mathbf{I}}_{k}}}{\overline{\bm{\mathit{w}}}_{k}}={\mathcal{T}(\overline{g}\cdot{\bm{q}},\overline{g}\cdot\dot{{\bm{q}}})},\end{split}$
(10)

where $\mathbf{\dot{r}}_{g,i}$, $\bm{\mathit{w}}_{g,i}$, $m_{i}$ and
$\mathbf{I}_{i}$ are the linear and angular velocity, mass, and inertia matrix
of the transformed body $i$ (referenced to $\mathit{o}$). Likewise,
$\dot{\overline{\mathbf{r}}}_{i}$, $\overline{\bm{\mathit{w}}}_{i}$,
$\overline{m}_{i}$ and $\overline{\mathbf{I}}_{i}$ are the equivalent
quantities for the virtual robot and body $i$ (referenced to
$\overline{\mathit{o}}$).

###  A-A Symmetries of kinematic parameters:

Ignore momentarily the influence of the mass and inertia in terms of the real
and virtual bodies. We can assert that for eq. 10 to hold, the transformed
configuration should result in a kinematic tree indistinguishable from the
virtual robot’s. Thus, for everybody $i$ in the real robot kinematic tree,
there should exist an equivalent virtual body $k$ (as seen in fig. 6, not
always $k=i$). By equating the linear and angular velocities of the real and
virtual bodies, referenced to $\mathit{o}$, and expressing the velocities as
functions of the generalized coordinates we obtain:

$\displaystyle\mathbf{\dot{r}}_{g,i}$
$\displaystyle=\dot{\overline{\mathbf{r}}}_{k}{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\doteq{{\bm{R}}_{\overline{g}}}\cdot\mathbf{\dot{r}}_{k}}$
$\displaystyle\mathbf{J}_{T_{i}}(g\cdot{\bm{q}})g\cdot\dot{{\bm{q}}}$
$\displaystyle={{\bm{R}}_{\overline{g}}}\cdot\mathbf{J}_{T_{k}}({\bm{q}})\dot{{\bm{q}}}$
$\displaystyle\mathbf{J}_{T_{i}}(g\cdot{\bm{q}})g$
$\displaystyle={{\bm{R}}_{\overline{g}}}\cdot\mathbf{J}_{T_{k}}({\bm{q}})$
(11) $\displaystyle\bm{\mathit{w}}_{g,i}$
$\displaystyle=\overline{\bm{\mathit{w}}}_{k}{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\doteq|{{\bm{R}}_{\overline{g}}}|{{\bm{R}}_{\overline{g}}}\cdot\bm{\mathit{w}}_{k}}$
$\displaystyle\mathbf{J}_{R_{i}}(g\cdot{\bm{q}})g\cdot\dot{{\bm{q}}}$
$\displaystyle=|{{\bm{R}}_{\overline{g}}}|{{\bm{R}}_{\overline{g}}}\cdot\mathbf{J}_{R_{k}}({\bm{q}})\dot{{\bm{q}}},$
$\displaystyle\mathbf{J}_{R_{i}}(g\cdot{\bm{q}})g$
$\displaystyle=|{{\bm{R}}_{\overline{g}}}|{{\bm{R}}_{\overline{g}}}\cdot\mathbf{J}_{R_{k}}({\bm{q}}),$
(12)

where
$\mathbf{J}_{T_{i}}({\bm{q}}),\;\mathbf{J}_{R_{i}}({\bm{q}})\in\mathbb{R}^{3\times
n}$ are the position and orientation analytical Jacobians (describing the
instantaneous velocity vectors contributed by each DoF to body $i$) of the
real robot at a configuration ${\bm{q}}$ [26]. Formulating eq. 12 for each of
the ${n_{B}}$ bodies of the robot we obtain at best ${n_{B}}\times 3\times n$
non-linear equations that can be used to assert if $g$ exists. In practice,
the action representation ${\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}$ and
especially its component acting on the joint space
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$ can be trivially determined
by solving eq. 12 (or equivalently eq. 7) for each body from top to bottom of
the kinematic tree (i.e., base first, end-effectors last), if $g$ exists.

###  A-B Symmetries of dynamic prameters

Let us assume kinematic symmetry and direct our attention now to the influence
of the mass and inertia terms on the kinetic energy of a single rigid body
when it is transformed with the action $g$, which imitates a true reflection
of space $\overline{g}$. Focus on the first two columns of fig. 5. Because of
the kinematic symmetry the CoM of the reflected and transformed bodies
coincide, both bodies have equivalent linear components of kinetic energy.
However, for arbitrary rigid bodies, the reflected and transform bodies will
have different angular components of kinetic energy. Note that in the general
case, the transformed and reflected bodies’ inertia will differ, thus even if
both bodies have the same angular velocities, their kinetic energy will
differ.

Let $p$, $p_{\overline{g}}$ and $p_{g}$ be frames located at the CoM of the
original, reflected and transformed bodies, aligned with the principal axes of
inertia of each of the bodies. Similarly, denote
$\tensor*[^{\mathit{o}}]{{\mathbf{I}}}{}$ and
$\tensor*[^{\mathit{o}}]{{\mathbf{I}_{g}}}{}$ as the original and transformed
bodies inertias referenced to $\mathit{o}$, and
$\tensor*[^{\overline{\mathit{o}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}$
as the reflected body inertia referenced to the reflected Euclidean space
$\overline{\mathit{o}}$. In order to comply with eq. 12, we must ensure that:

$\displaystyle\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{{}^{\intercal}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{\mathbf{I}_{g}}}{}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{{}_{\overline{g}}}$
$\displaystyle=\tensor*[^{\overline{\mathit{o}}}]{{\bm{\mathit{w}}}}{{}^{\intercal}_{\overline{g}}}\tensor*[^{\overline{\mathit{o}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}\tensor*[^{\overline{\mathit{o}}}]{{\bm{\mathit{w}}}}{{}_{\overline{g}}},,$
$\displaystyle({{\bm{R}}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{})^{\intercal}\tensor*[^{\mathit{o}}]{{\mathbf{I}_{g}}}{}({{\bm{R}}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{})$
$\displaystyle=\tensor*[^{\overline{\mathit{o}}}]{{\bm{\mathit{w}}}}{{}^{\intercal}_{\overline{g}}}\tensor*[^{\overline{\mathit{o}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}\tensor*[^{\overline{\mathit{o}}}]{{\bm{\mathit{w}}}}{{}_{\overline{g}}}\quad$
$\displaystyle\qquad|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}_{\overline{g}}}}{}=|{{\bm{R}}_{\overline{g}}}|{{\bm{R}}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{}},$
$\displaystyle\tensor*[^{\mathit{o}}]{{\mathbf{I}_{g}}}{}$
$\displaystyle={{\bm{R}}_{\overline{g}}}\tensor*[^{\overline{\mathit{o}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}{{\bm{R}}_{\overline{g}}}$
$\displaystyle\qquad|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\tensor*[^{\mathit{o}}]{{\bm{\mathit{w}}}}{}\equiv\tensor*[^{\overline{\mathit{o}}}]{{\bm{\mathit{w}}}}{{}_{\overline{g}}},\quad{{\bm{R}}_{\overline{g}}}{{\bm{R}}_{\overline{g}}}={\bm{I}}},$
$\displaystyle\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}\tensor*[^{p_{g}}]{{\mathbf{I}_{g}}}{}\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}^{\intercal}$
$\displaystyle={{\bm{R}}_{\overline{g}}}\tensor*[^{\overline{\mathit{o}}}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}\tensor*[^{p_{\overline{g}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}\tensor*[^{\overline{\mathit{o}}}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}^{\intercal}{{\bm{R}}_{\overline{g}}}$
$\displaystyle\qquad|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\tensor*[^{a}]{{\mathbf{I}}}{}=\tensor*[^{b}]{{{{\bm{R}}}}}{{}^{a}}\tensor*[^{b}]{{\mathbf{I}}}{}\tensor*[^{b}]{{{{\bm{R}}}}}{{}^{a}}^{\intercal}},$
$\displaystyle\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}\tensor*[^{p_{g}}]{{\mathbf{I}_{g}}}{}\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}^{\intercal}$
$\displaystyle={{\bm{R}}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p}}\tensor*[^{p}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}\tensor*[^{p_{\overline{g}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}\tensor*[^{p}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}^{\intercal}\tensor*[^{\overline{\mathit{o}}}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}^{\intercal}{{\bm{R}}_{\overline{g}}},$
$\displaystyle\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}$
$\displaystyle\doteq{{\bm{R}}_{\overline{g}}}\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p}}\tensor*[^{p}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}$
(13a)
$\displaystyle\qquad|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\tensor*[^{p}]{{\mathbf{I}}}{}\equiv\tensor*[^{p_{g}}]{{\mathbf{I}_{g}}}{}\equiv\tensor*[^{p_{\overline{g}}}]{{\overline{\mathbf{I}}_{\overline{g}}}}{}}.$

What eq. 13a states is that in order for the reflected and transformed bodies
to have equivalent angular kinetic energy, both bodies should have co-linear
(or aligned) principal axes of inertia. This allows us to describe
$\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p_{g}}}$ as a function of the
original body configuration $\tensor*[^{\mathit{o}}]{{{{\bm{R}}}}}{{}^{p}}$
and two reflection matrices: the true reflection of space
${{\bm{R}}_{\overline{g}}}$ and a body specific diagonal reflection matrix
$\tensor*[^{p}]{{{{\bm{R}}}}}{{}^{p_{\overline{g}}}}$, which exists only if
the rigid body has a symmetric mass distribution. A visual example for
symmetric and asymmetrical rigid bodies is presented in fig. 5 left and middle
columns. A similar analysis follows for DMSs imitating rotations

###  A-C Symmetric position and velocity constraint configuration spaces

Although it is implicitly implied on eq. 2 that the constrained position
$\mathrm{Q}$ and velocity $\mathrm{T}_{{\bm{q}}}\mathrm{Q}$ configuration
vector spaces should also be symmetric or equivariant, this property might be
easily overlooked. As mentioned in section IV the relevance of morphological
symmetries relies on the equivariant nature of the system dynamics (eqs. 3 and
1), which imprints symmetry constraints on optimal control policies and
proprioceptive and exteroceptive measurements. However, with non-symmetric
constrained configuration spaces, eq. 2 will not hold for every system state
${\bm{q}}\in\mathrm{Q}$, $\dot{{\bm{q}}}\in\mathrm{T}_{{\bm{q}}}\mathrm{Q}$,
and any uncontrolled or controlled trajectory of the system dynamics shall not
have a symmetric equivalent trajectory, as this has the potential to violate
the constraints of the configuration space.

##  Appendix B Efficient Construction of $\mathcal{G}$-equivariant NNs for DMS
Groups $\mathcal{G}$

As mentioned in section V our work builds upon the framework for the
construction of $\mathcal{G}$-equivariant NN of Finzi et al. [7]. The core
limitation of this framework is the inability to handle large dimensional
spaces, due to the computational and memory complexities. For instance, for an
equivariant layer with input dimension $n$ and output dimension $m$, the
computational complexity of finding the equivariant linear map basis
${\bm{\mathsfit{B}}}$ (which is quadratic $\mathcal{O}((mn)^{2}r^{2})$ through
the Krylov subspace method) and the memory complexity of
${\bm{\mathsfit{B}}}\in\mathbb{R}^{mn\times r}\;|\;r\leq mn$, become easily
intractable for moderate $n$ and $m$ dimensions. This limitation is openly
discussed in the EMLP repository README.md, but regretfully not in the
original paper.

In practice, we found these limitations when trying to construct the
equivariant version of the Contact CNN [15] in our second experiment. This
architecture in its internal layers has $n,m>2000$, for which: (i) the Krylov
subspace method complexity renders the operation intractable with standard
hardware and (ii) the matrices ${\bm{\mathsfit{B}}}$ of internal layers
required storage of $1[Gb]>$ for moderate input output dimensions ($m,n\approx
250$) and $1[Pb]>$ for $m,n>2000$). See table I for a comparison between dense
and sparse matrix representations.

###  B-A Trainable parameter reduction of $\mathcal{G}$-equivariant layers
(for $\mathcal{G}$ a DMS group)

Determining analytically the number of trainable parameters (i.e. the rank
$r$) of an $\mathcal{G}$-equivariant layer is, in general, an unresolved
problem. However, for DMS groups, $r$ can be computed once the input-output
action representations are known. The requirement to compute $r$ is that
actions affecting the linear maps are a semi-direct product8 of the input-
output groups, and the input-output representations are generalized
permutation matrices. These conditions are met for most DMS groups (see
appendix D).

The equivariance constraints of eq. 9 on linear maps of perceptron (or
convolutional) layers imply a reduction of trainable parameters from
$|{w}|=mn$ to $|{\bm{c}}|=r\leq mn$. For DMS groups, $r$ is associated with
the number of unique orbits of the elements of ${w}$. Thus we can compute this
value using the orbit-counting theorem (also known as Burnside’s Lemma), which
states that the number of orbits is the average number of fix-points of
$\mathcal{G}$, that is
$r=\tfrac{1}{|\mathcal{G}|}\sum_{g\in\mathcal{G}}|{w}^{g}|$, where
${w}^{g}\doteq\\{{w}\in{w}:g\cdot{w}={w}\\}$ represents the set of elements of
${w}$ that are invariant to $g$ (i.e. fix-points). Those fix-points can be
identified by the elements on the diagonal of
${\rho_{\scriptscriptstyle{{\bm{W}}}}(g)}$ that are equal to one. Therefore,
for a $\mathcal{G}$-equivariant layer, the number of trainable parameters is
determined by:

$r=\tfrac{1}{|\mathcal{G}|}{\textstyle\sum}_{g\in\mathcal{G}}\chi^{\bm{1}}_{\rho_{{\bm{W}}}}(g)=\tfrac{1}{|\mathcal{G}|}{\textstyle\sum}_{g\in\mathcal{G}}\;\chi^{\bm{1}}_{\rho_{in}}(g^{\text{-}1})\cdot\chi^{\bm{1}}_{\rho_{out}}(g),$
(14)

denoting $\chi^{\bm{1}}_{\rho}(g):\mathcal{G}\rightarrow\mathbb{N}$ as the
number of fix-points of the action representation ${\rho(g)}$. Therefore, the
number of trainable parameters can range from
$\nicefrac{{|{w}|}}{{|\mathcal{G}|}}\leq r\leq|{w}|$, depending on the fix-
points of the layers’ input and output spaces.

###  B-B Parameter initialization of equivariant layers for DMS

Consider a Equivariant Neural Network architecture composed of multiple layers
of equivariant linear (or convolutional) layers of the form
${}^{l}{\bm{y}}:=\sigma(\,^{l}{\bm{W}}\,^{l}{\bm{x}}+\,^{l}\bm{b})$, being $l$
the layer index, ${}^{l}{\bm{x}}\in\mathbb{R}^{n}$ and
${}^{l}{\bm{y}}\in\mathbb{R}^{m}$ the layer’s input and output vector spaces,
${}^{l}{\bm{W}}\doteq{\textstyle\sum_{k}^{r}}\,^{l}{c}_{k}\,^{l}{\bm{\mathsfit{B}}}_{:,:,k}\in\mathbb{R}^{m\times
n}$ the layer’s linear map, $\,{}^{l}{\bm{\mathsfit{B}}}\in\mathbb{R}^{m\times
n\times r}$ the layer’s $r$ basis vectors spawning the space of equivariant
linear maps, $\,{}^{l}{\bm{c}}\in\mathbb{R}^{r}$ the layer’s trainable
parameters, and ${}^{l}\bm{b}\in\mathbb{R}^{m}$ the layer’s bias vector.

For the optimal flow of information throughout the network, it’s relevant to
initialize the trainable parameters such that the variance of activations
(during inference/forward-propagation) and gradients (during back-propagation)
is kept constant, avoiding activations/gradients from vanishing or exploiting
[9]999See Pierre Ouannes blog: pouannes.github.io/blog/initialization.

The derivation is based on the equivalent process for unconstrained layers
presented in He et al. [11]. Let the layer’s activations before the non-
linearity be denoted by
${}^{l}{\bm{z}}=\,^{l}{\bm{W}}\,^{l}{\bm{x}}+\,^{l}\bm{b}$, such that
${}^{l}{\bm{y}}=\sigma(^{l}{\bm{z}})$, and note that
$\,{}^{l}{\bm{x}}=\,^{l-1}{\bm{y}}$. Furthermore, we will assume the elements
of ${}^{l}{\bm{c}}$ and ${}^{l}{\bm{x}}$ are mutually independent and sampled
from two independent distributions, denoting the random variables of the two
distributions as ${}^{l}{c}$ and ${}^{l}{\textnormal{x}}$.

The core difference in the initialization of unconstrained and equivariant
layers lies in the way the linear map is parameterized. For equivariant layers
we have:

$\displaystyle\mathrm{Var}(\,^{l}{\bm{W}}\,^{l}{\bm{x}}+\,^{l}\bm{b})$
$\displaystyle=\sum_{i}^{m}\sum_{j}^{n}\mathrm{Var}\left(\,{}^{l}{W}_{i,j}\,^{l}{\textnormal{x}}_{j}\right)|\;{{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\mathrm{Var}(\,^{l}\bm{b})=0}}$
$\displaystyle=\sum_{i}^{m}\sum_{j}^{n}\mathrm{Var}\left(\left(\sum_{k}^{r}\,{}^{l}{c}_{k}\,^{l}{\bm{\mathsfit{B}}}_{m,n,k}\right)\,^{l}{\textnormal{x}}_{j}\right)$
,
$\displaystyle=\mathrm{Var}\left(\,{}^{l}{c}\,^{l}{\textnormal{x}}\right){\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\sum_{i}^{m}\sum_{j}^{n}\sum_{k}^{r}{\bm{\mathsfit{B}}}_{m,n,k}^{2}}}_{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}}}}$
(15)
$\displaystyle\qquad|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\small\mathrm{Var}\left(\sum_{a}\underbracket{s_{a}}_{const}{\mathbf{p}}\right)=\sum_{a}s_{a}^{2}\mathrm{Var}({\mathbf{p}})}$

In the forward-propagation scenario, we are interested in conserving the
variance of the activations throughout layers, that is we must ensure
$\mathrm{Var}(\,^{l}{\mathbf{z}})=\mathrm{Var}(\,^{l-1}{\mathbf{z}})$. Using
eq. 15 we obtain:

$\displaystyle\mathrm{Var}(\,^{l}{\bm{z}})$
$\displaystyle=\mathrm{Var}(\,^{l}{\bm{W}}\,^{l}{\bm{x}}+\,^{l}\bm{b})$
$\displaystyle m\;\mathrm{Var}(\,^{l}{\mathbf{z}})$
$\displaystyle=\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\mathrm{Var}\left(\,{}^{l}{c}\,^{l}{\textnormal{x}}\right)$
$\displaystyle\mathrm{Var}(\,^{l}{\mathbf{z}})$
$\displaystyle=\frac{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}}{m}\left({\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\mathbb{E}(^{l}{c}^{2})}}_{\mathrm{Var}(^{l}{c})}}}\mathbb{E}(\,^{l}{\textnormal{x}}^{2})-{\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\mathbb{E}(^{l}{c})^{2}}}_{=0}}}\mathbb{E}(\,^{l}{\textnormal{x}})^{2}\right)$
$\displaystyle\mathrm{Var}(\,^{l}{\mathbf{z}})$
$\displaystyle=\frac{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}}{m}\mathrm{Var}(^{l}{c})\mathbb{E}\left(\,{}^{l-1}{\textnormal{y}}^{2}\right)$
$\displaystyle\qquad\;|\;{\color[rgb]{0.035,0.298,0.345}{}^{l}{\textnormal{x}}=\,^{l-1}{\textnormal{y}}=\sigma(\,^{l-1}{\mathbf{z}})}$
$\displaystyle\mathrm{Var}(\,^{l}{\mathbf{z}})$
$\displaystyle=\frac{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma}}{m}\mathrm{Var}(^{l}{c})\mathrm{Var}(\,^{l-1}{\mathbf{z}})$
(16)
$\displaystyle\qquad\;|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\mathbb{E}\left(\,{}^{l-1}{\textnormal{y}}^{2}\right)=\lambda_{\sigma}\mathrm{Var}\left(\,{}^{l-1}{\mathbf{z}}\right)}$
$\displaystyle\mathrm{Var}(\,^{l}{\mathbf{z}})$
$\displaystyle\equiv\mathrm{Var}(\,^{l-1}{\mathbf{z}})$ (17)
$\displaystyle\qquad\;|\;{\color[rgb]{0.035,0.298,0.345}\definecolor[named]{pgfstrokecolor}{rgb}{0.035,0.298,0.345}\mathrm{Var}\left({}^{`l}{c}\right)\doteq\frac{m}{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma}}}$

where $\lambda_{\sigma}$ in eq. 16 is a non-linearity dependent scalar
computed analytically or empirically (see He et al. [11]). In eq. 17 we
conclude that if we sample the equivariant layer trainable parameters
${}^{l}{\bm{c}}$ from a distribution ensuring
$\mathrm{Var}(^{l}{c})\doteq\frac{m}{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma}}$,
the variance of the activations across equivariant layers remain constant. A
similar procedure can be applied to the backward propagation case, concluding
that in order to maintain a constant variance of the gradients across the
network layers we should sample the trainable parameters ensuring
$\mathrm{Var}(^{l}{c})\doteq\frac{n}{\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma}}$.
As remarked in He et al. [11] both variance values for the forward and
backward propagation cases lead to the proper flow of information in the
network. On fig. 7, it can be appreciated that our method achieves equivalent
results for equivariant architectures as [11] does for standard linear and
convolutional architectures.

##  Appendix C Implementation Details & Code

|  |  | Dense Memory [Bytes] | Sparse Memory [Bytes]
---|---|---|---|---
Layer Type | $n$ | $m$ | ${\rho_{\scriptscriptstyle{{w}}}(g)}$ | ${\bm{\mathsfit{B}}}$ | ${\rho_{\scriptscriptstyle{{w}}}(g)}$ | ${\bm{\mathsfit{B}}}$
1D-Conv | $54$ | $64$ | $764.41M$ | $191.10M$ | $221.18k$ | $110.59k$
1D-Conv | $64$ | $64$ | $1.07G$ | $268.43M$ | $262.14k$ | $131.07k$
1D-Conv | $64$ | $128$ | $4.29G$ | $1.07G$ | $524.28k$ | $262.14k$
1D-Conv | $128$ | $128$ | $17.18G$ | $4.29G$ | $1.04M$ | $524.28k$
Percept | $4736$ | $2048$ | $6.02P$ | $1.50P$ | $620.75M$ | $310.37M$
Percept | $2048$ | $512$ | $70.36T$ | $17.59T$ | $67.10M$ | $33.55M$
Percept | $512$ | $16$ | $4.29G$ | $1.07G$ | $524.28k$ | $262.14k$
TABLE I:  Comparison of memory complexity of individual layers of the
equivariant version of Contact-CNN [15] (ECNN). This example compares the
sparse and dense representations of matrices
${\bm{\mathsfit{B}}}\in\mathbb{R}^{mn\times r}$ and the $|\mathcal{G}|$ group
action representations
${\rho_{\scriptscriptstyle{{w}}}(g)}\in\mathbb{R}^{mn\times mn}$, for the
symmetry group $\mathcal{G}=\mathcal{C}_{2}$ of the Mini-Cheetah robot, with
$r=\nicefrac{{mn}}{{2}}$ (see eq. 14). Here, $n,m$ represents the input and
output dimensions of each layer. The dense memory complexity of all action
representations increases with the group order $|\mathcal{G}|$ while the
memory complexity for ${\bm{\mathsfit{B}}}$ decreases with larger group orders
(since $r\leq mn$ becomes smaller). We assume floating point representations
with $32$ bits.

Additional to this section, we provide open-access code with the scripts for
reproducing the experiments of this work, the parameters of the models used
for comparison, along with additional interactive examples visualizing
morphological symmetries of both robotic systems and data.

###  C-A Efficient data augmentation

Since any input ${\bm{x}}$ and output ${\bm{y}}$ spaces of equivariant
architectures have matrix symmetry action representations,
${\rho_{\scriptscriptstyle{\mathcal{X}}}(g)}$,
${\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}$, it is possible to perform
batched data augmentation, reducing the computational complexity of augmenting
a batch of $N_{b}$ samples from $N_{b}$ matrix-vector multiplications to a
single matrix-matrix multiplication, preferably performed after data is loaded
to GPU for optimal performance.

###  C-B Hyperparameter tunning

The only hyper-parameter tunned for each model and model variant was the
learning rate. For all model variants presented in this work (except the
original Contact-CNN model from Lin et al. [15], which we retrained using the
same hyperparameters reported by the authors) we ran a grid-search in log-
scale among 20 different learning rates. In this scenario, we always used the
entire training dataset and optimized w.r.t computed loss in the entire
validation partition. The learning rate values used for each model are
depicted in table III.

###  C-C Experiment: CoM Momentum Estimation

The dataset for the CoM estimation experiment was generated using Pinocchio
[4], which in turn uses the URDF models of the robots Solo and Atlas, to
extract the kinematic and dynamic parameters required to compute the
Centroidal Momentum Matrix $\mathbf{A}_{G}({\bm{q}})$ matrix [17], with which
computing the CoM momentum reduces to:

$\displaystyle g\cdot{\bm{h}}$
$\displaystyle=\mathbf{A}_{G}(g\cdot\hat{{\bm{q}}})g\cdot\dot{\hat{{\bm{q}}}}$
$\displaystyle|\quad\forall g\in\mathcal{G}.$ (18) $\displaystyle
g\cdot{\bm{h}}$ $\displaystyle\approx
f\left(g\cdot\hat{{\bm{q}}},g\cdot\dot{\hat{{\bm{q}}}};\bm{\phi}\right)$
$\displaystyle|\quad\forall g\in\mathcal{G}.$ (19)

Where eq. 18 expresses the analytical $\mathcal{G}$-equivariant function to
compute the CoM momentum. While eq. 19 is the approximation of this function
by an $\mathcal{G}$-equivariant NN, with parameters $\bm{\phi}$.

####  C-C1 Determination of the input and output representations
${\rho_{\scriptscriptstyle{\mathcal{X}}}(g)},{\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}\;|\;g\in\mathcal{G}$

Both robots Solo and Atlas evolve in the Euclidean space of $3$-dimensions.
Therefore their configuration space can be decoupled into
$\mathrm{Q}\doteq\mathbb{E}_{3}\times\mathrm{Q}_{J}$. After identifying their
symmetry groups and their corresponding $\mathbb{E}_{3}$ and $\mathrm{Q}_{J}$
representations
(${\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(g)},{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\;|\;\forall\;g\in\mathcal{G}$),
identifying the representations of the input and output spaces of the NN
function approximator (eq. 19) becomes a trivial task considering that:

${\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}&\bm{0}\\\
\bm{0}&{\rho_{\scriptscriptstyle{\mathbb{E}_{d}}}(\overline{g})}\end{bmatrix}}}_{{\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}}}}{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}{\bm{l}}\\\
{\mathbf{k}}\end{bmatrix}}}_{{\bm{y}}}}}\approx
f\bigg{(}{\color[rgb]{0.570,0.458,0.0912}\definecolor[named]{pgfstrokecolor}{rgb}{0.570,0.458,0.0912}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}&\bm{0}\\\
\bm{0}&{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\end{bmatrix}}}_{{\rho_{\scriptscriptstyle{\mathcal{X}}}(g)}}}}{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}\hat{{\bm{q}}}\\\
\dot{\hat{{\bm{q}}}}\end{bmatrix}}}_{{\bm{x}}}}}\bigg{)}\\\
|\quad\forall\quad(g,\,\overline{g})|g\in\mathcal{G},\overline{g}\in\mathbb{E}_{3}$
(20)

Defining ${\bm{x}}=\begin{bmatrix}\hat{{\bm{q}}}\\\
\dot{\hat{{\bm{q}}}}\end{bmatrix}\in\mathbb{R}^{2{n_{J}}}$ and
${\bm{y}}={\bm{h}}\in\mathbb{R}^{2d}\equiv\mathbb{R}^{6}$. Note that by
definition any improper transformation applied to a pseudo-vector (e.g.
angular velocity/momentum, torques) is computed as
$|{{\bm{R}}}|{{\bm{R}}}\cdot{\mathbf{k}}$.

####  C-C2 Practical details of the dataset generation

The URDF files of the robots Solo and Atlas are generated using XACRO scripts,
which replicate the structure of limbs to their symmetric counterparts, making
the dynamics of the robots in simulation exactly $\mathcal{G}$-equivariant.
However, the algorithm for computing the CoM momentum from Pinocchio is
numerically sensitive, resulting in the orbits of the momentum
$\mathcal{G}\cdot{\bm{h}}$ deviating slightly from the theoretical orbits.
Therefore to reduce numerical errors and ensure the theoretical equivariance
of the data, we replace every target variable by the average of its orbit
${\bm{y}}={\bm{h}}\doteq\frac{1}{|G|}\sum\mathcal{G}\cdot
g^{-}1(\mathbf{A}_{G}\left({\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\hat{{\bm{q}}}\right){\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\dot{\hat{{\bm{q}}}})\quad|\quad\forall\quad
g\in\mathcal{G}$.

###  C-D Experiment: Static-Friction-Regime Contact Detection

RF | LF | RH | LH | ${\bm{y}}$ | $g\cdot{\bm{y}}$ | LF | RF | LH | RH
---|---|---|---|---|---|---|---|---|---
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0
0 | 0 | 0 | 1 | 1 | 2 | 0 | 0 | 1 | 0
0 | 0 | 1 | 0 | 2 | 1 | 0 | 0 | 0 | 1
0 | 0 | 1 | 1 | 3 | 3 | 0 | 0 | 1 | 1
0 | 1 | 0 | 0 | 4 | 8 | 1 | 0 | 0 | 0
0 | 1 | 0 | 1 | 5 | 10 | 1 | 0 | 1 | 0
0 | 1 | 1 | 0 | 6 | 9 | 1 | 0 | 0 | 1
0 | 1 | 1 | 1 | 7 | 11 | 1 | 0 | 1 | 1
1 | 0 | 0 | 0 | 8 | 4 | 0 | 1 | 0 | 0
1 | 0 | 0 | 1 | 9 | 6 | 0 | 1 | 1 | 0
1 | 0 | 1 | 0 | 10 | 5 | 0 | 1 | 0 | 1
1 | 0 | 1 | 1 | 11 | 7 | 0 | 1 | 1 | 1
1 | 1 | 0 | 0 | 12 | 12 | 1 | 1 | 0 | 0
1 | 1 | 0 | 1 | 13 | 14 | 1 | 1 | 1 | 0
1 | 1 | 1 | 0 | 14 | 13 | 1 | 1 | 0 | 1
1 | 1 | 1 | 1 | 15 | 15 | 1 | 1 | 1 | 1
TABLE II: Symmetric contact state for Mini-Cheetah quadruped robot.
Considering its morphological symmetry group $\mathcal{C}_{2}=\\{e,g\\}$. Each
leg binary contact state (LF: Left Front, RF: Right Front, LH: Left Hind, RH:
Right Hind) is displayed with its corresponding robot contact state
${\bm{y}}$.

The dataset presented in [15] is composed of output samples
${\bm{y}}\in\mathbb{R}^{16}$, where each dimension of ${\bm{y}}$ represents a
logit of a specific contact state, among the $16$ different combinations of
each of the $4$ legs possible binary contact states. The input samples
${\bm{y}}=\\{{\bm{z}}_{i}\\}_{i=0}^{150}\in\mathbb{R}^{54\times 150}$, are a
history of $150$ samples
${\bm{z}}=[\hat{{\bm{q}}},\dot{\hat{{\bm{q}}}},{\bm{a}},{\bm{\mathit{w}}},{{\bm{p}}},{{\bm{v}}}]\in\mathbb{R}^{54}$.
Where
$\hat{{\bm{q}}}\in\mathbb{R}^{{n_{J}}},\dot{\hat{{\bm{q}}}}\in\mathbb{R}^{{n_{J}}},{\bm{a}}\in\mathbb{R}^{3},{\bm{\mathit{w}}}\in\mathbb{R}^{3},{{\bm{p}}}\in\mathbb{R}^{12},{{\bm{v}}}\in\mathbb{R}^{12}$
are the MIT-Mini-Cheetah robot joint-space positions, velocities, base linear
acceleration, base angular velocity, and each of the four legs feet’s position
and velocities, respectively, referenced to the robots base frame $B$.

The function approximator to learn is expected to be approximately equivariant
to the reflection group $\mathcal{C}_{2}$, considering the sagittal symmetry
of the robot morphology. Therefore:

$\displaystyle
g\cdot{\bm{y}}=f\left(g\cdot{\bm{x}};\bm{\phi}\right)\quad|\quad
g\in\mathcal{G}=\mathcal{C}_{2}$ (21)

####  C-D1 Determination of the input and output representations
${\rho_{\scriptscriptstyle{\mathcal{X}}}(g)},{\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}\;|\;g\in\mathcal{G}$

The MiniCheetah robot evolves in the Euclidean space of $3$-dimensions.
Therefore its configuration space can be decoupled into
$\mathrm{Q}\doteq\mathbb{E}_{3}\times\mathrm{Q}_{J}$. After identifying their
symmetry groups and their corresponding $\mathbb{E}_{3}$ and $\mathrm{Q}_{J}$
representations
(${\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(g)},{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\;|\;\forall\;g\in\mathcal{G}$),
we can identify the representations of the input and output spaces of the NN
function approximator (eq. 21), considering that:

$\small{\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}{\bm{y}}\approx\\\
f\Biggl{(}{\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}&\bm{0}&\bm{0}&\bm{0}&\bm{0}&\bm{0}\\\
\bm{0}&{\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}&\bm{0}&\bm{0}&\bm{0}&\bm{0}\\\
\bm{0}&\bm{0}&{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}&\bm{0}&\bm{0}&\bm{0}\\\
\bm{0}&\bm{0}&\bm{0}&{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}&\bm{0}&\bm{0}\\\
\bm{0}&\bm{0}&\bm{0}&\bm{0}&{\rho_{\scriptscriptstyle{{\bm{p}}}}(g)}&\bm{0}\\\
\bm{0}&\bm{0}&\bm{0}&\bm{0}&\bm{0}&{\rho_{\scriptscriptstyle{{\bm{p}}}}(g)}\\\
\end{bmatrix}}}_{{\rho_{\scriptscriptstyle{\mathcal{X}}}(g)}}}}{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{\begin{bmatrix}\hat{{\bm{q}}}\\\
\dot{\hat{{\bm{q}}}}\\\ {\bm{a}}\\\ {\bm{\mathit{w}}}\\\ {{\bm{p}}}\\\
{{\bm{v}}}\\\ \end{bmatrix}}}_{{\bm{x}}}}}\Biggl{)}\\\
|\;\forall\;(g,\,\overline{g})|g\in\mathcal{G},\overline{g}\in\mathbb{E}_{3}$
(22)

Where the representation ${\rho_{\scriptscriptstyle{{\bm{p}}}}(g)}$ acting on
${{\bm{p}}}\in\mathbb{R}^{12}$ and ${{\bm{v}}}\in\mathbb{R}^{12}$ is
determined understanding that each of the feet positions
$({\bm{p}}{{}_{RF}},{\bm{p}}{{}_{LF}},{\bm{p}}{{}_{RH}},{\bm{p}}{{}_{LH}})$
and velocities
$({\bm{v}}{{}_{RF}},{\bm{v}}{{}_{LF}},{\bm{v}}{{}_{RH}},{\bm{v}}{{}_{LH}})$
are simply vectors living in $\mathbb{E}_{3}$. Thus, we must apply the
euclidean action ${\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}$
while at the same time permuting the feets (similar to the permutation of the
kinematic subchains described by
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}$):

$\displaystyle\small g\cdot{\bm{p}}$
$\displaystyle={\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{{\rho_{\scriptscriptstyle{\mathbb{R}^{4}}}(g)}\otimes{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}}}_{{\rho_{\scriptscriptstyle{{\bm{p}}}}(g)}}}}{\bm{p}},\;\;|\;\forall(g,\,\overline{g})|g\in\mathcal{G},\overline{g}\in\mathbb{E}_{3}$
(23) $\displaystyle=\begin{bmatrix}0&1&0&0\\\ 1&0&0&0\\\ 0&0&0&1\\\ 0&0&1&0\\\
\end{bmatrix}\otimes{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}\begin{bmatrix}{\bm{p}}{{}_{RF}}\\\
{\bm{p}}{{}_{LF}}\\\ {\bm{p}}{{}_{RH}}\\\ {\bm{p}}{{}_{LH}}\\\
\end{bmatrix}\;\;|\;g\neq e$ $\displaystyle g\cdot{\bm{v}}$
$\displaystyle={\color[rgb]{0.054,0.415,0.505}\definecolor[named]{pgfstrokecolor}{rgb}{0.054,0.415,0.505}{\underbrace{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}{{\rho_{\scriptscriptstyle{\mathbb{R}^{4}}}(g)}\otimes{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}}}_{{\rho_{\scriptscriptstyle{{\bm{p}}}}(g)}}}}{\bm{v}}\;\;|\;\forall(g,\,\overline{g})|g\in\mathcal{G},\overline{g}\in\mathbb{E}_{3}$
(24) $\displaystyle=\begin{bmatrix}0&1&0&0\\\ 1&0&0&0\\\ 0&0&0&1\\\ 0&0&1&0\\\
\end{bmatrix}\otimes{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}\begin{bmatrix}{\bm{v}}{{}_{RF}}\\\
{\bm{v}}{{}_{LF}}\\\ {\bm{v}}{{}_{RH}}\\\ {\bm{v}}{{}_{LH}}\\\
\end{bmatrix}\;\;|\;g\neq e$

Being ${\rho_{\scriptscriptstyle{\mathbb{R}^{4}}}(g)}\;|\;\forall
g\in\mathcal{C}_{2}$ two regular representations of $\mathcal{C}_{2}$ stack in
block diagonal form to form a representation in $4$-dimensional space,
representing the right-left symmetries of the $4$ kinematic tree’s subchains.
The nature of the representation
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\doteq{\rho_{\scriptscriptstyle{\mathbb{R}^{4}}}(g)}\otimes{\bm{I}}_{n_{s}}$
might be better understood if you consider that we apply
${\rho_{\scriptscriptstyle{\mathbb{R}^{4}}}(g)}$ to the number of degrees of
freedom of the kinematic subchain $n_{s}$ (which for the case of MiniCheetah
is $n_{s}=3$ DoF). See simpler examples in fig. 6.

Lastly, the representation for the contact state
${\rho_{\scriptscriptstyle{\mathcal{Y}}}(g)}$ is given by the permutation
matrix relating ${\bm{y}}$ and $g\cdot{\bm{y}}$ described in
LABEL:table:contact_state_symmetry.

####  C-D2 Details on dataset partitioning

Robot | Model | $\mathcal{G}$ | lr | Samples
---|---|---|---|---
Solo | MLP/EMLP | $\mathcal{C}_{2}\;\&\;\mathcal{K}_{4}$ | $2.4\times 10^{-3}$ | 100k
Atlas | MLP/EMLP | $\mathcal{C}_{2}$ | $1.5\times 10^{-3}$ | 500k
MiniCheetah | CNN | $\mathcal{C}_{2}$ | $1.0\times 10^{-4}$ | 730k
MiniCheetah | E-CNN | $\mathcal{C}_{2}$ | $1.0\times 10^{-5}$
TABLE III: Robot, Models and Dataset parameters.

We modified the original dataset partitioning to properly evaluate the
generalization capacity of the models. The original dataset was composed of 15
different recordings varying ground type and gait type used during data
collection (most recordings were performed on a trot gait, which heavily
biased the dataset to contact states $0$, $6$, and $9$ of
LABEL:table:contact_state_symmetry).

The authors of [15] partitioned all 15 recordings into ($70\%,15\%,15\%$)
training, validation and testing. This partition was made such that the first
$70\%$ time-samples of each recording were assigned for training, the
following $15\%$ to validation, and the rest for testing.

Because we are interested in studying the generalization capacity of the
models and the out-of-training-distribution performance, we modified this
partitioning such that among the $15$ different recordings we selected
randomly $5$ recordings for testing, and the remaining $10$ recordings were
used for training splitting these recordings into ($85\%$, $15\%$) training
and validation splits as in [15], that is, for each recording, the first
$85\%$ data-samples go for training and the remaining for validation.

The selected training-validation recordings were: air walking gait, concrete
difficult slippery, concrete left circle, middle pebble, rock road, asphalt
road, concrete galloping, grass, old asphalt road, sidewalk. While the
selected testing recordings were: air jumping gait, concrete pronking,
concrete right circle, forest, small pebble.

###  C-E Mitigation of suboptimal asymmetries in model performance

When comparing individual leg classification we see that the equivariant model
converges to having a similar performance for each symmetric pair of legs,
while the unconstrained models converge to an asymmetrical suboptimal state
favoring the contact detection of one leg at the expense of reduced
performance for the symmetric leg (see LF and RF f1-scores). This asymmetrical
performance is attributed to the CNN and CNN-aug models learning to extract
temporal features for both symmetric legs separately, increasing the
likelihood of converging to asymmetrical local minima. On the contrary, the
equivariant model E-CNN can be thought of as learning to extract a single set
of symmetric temporal features for each symmetric pair of states (a
consequence of the model’s equivariance and parameter sharing). This implies
that the temporal features used for determining the contact state of, say the
left frontal leg, would also be used to determine the contact state of the
symmetric leg, the right frontal leg, and vice-versa.

###  C-F Equivariant Conv1D layers

For details on the construction of the Equivariant 1D Convolutional layers
reefer to 1. Note that the symmetry of a single time-sample ${\bm{z}}_{i}$ is
shared across all time-samples ${\bm{y}}=\\{{\bm{z}}_{i}\\}_{i=0}^{150}$.

Tri-Finger Robot $\mathcal{G}=\mathcal{C}_{3}$ This fixed-based robot is
symmetric w.r.t. rotations of space by $\theta=120^{\circ}$ in the vertical
axis. Therefore, its symmetry group is the cyclic group of order three
($\mathcal{G}=\mathcal{C}_{3}$). To identify this symmetry group we apply the
procedure in section IV-C: 1. Identify ${\bm{X}}_{{B}}$ and $\mathbf{I}_{B}$:
As a fix-based robot, we define ${\bm{X}}_{{B}}$ to be the mounting structure
supporting each finger, and the gray disk delimiting the workspace (see
image). 2. Identify symmetries of $\mathbf{I}_{B}$: The inertia of this
virtual base $\mathbf{I}_{B}$ is invariant to rotations by $120^{\circ}$ in
the vertical axis. I.e., $\mathbf{I}_{B}$ is invariant to
${\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}^{\text{-}1}|\overline{g}\in\\{e,\overline{g}_{\theta},\overline{g}_{\theta}^{2}\\}\equiv\mathcal{C}_{3}$
(eq. 6). 3. Identify modularity in the kinematic tree: There are three
symmetric kinematic subchains. Each finger is composed of replicated versions
of the same bodies. 4. Identify the DMS group $\mathcal{G}$: Consider that the
transformation
${\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(g)}{\bm{X}}_{{B}}\doteq{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}{\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}^{\text{-}1}$
(eq. 6) can be interpreted as a rotation of the virtual base by
$\theta^{\circ}$ followed by a rotation $-\theta^{\circ}$ in the $z$ axis.
Thus respecting the fix-base constraint of the system. Denote the joint-space
${\bm{q}}=\hat{{\bm{q}}}=[{\bm{q}}_{f1}^{\intercal},{\bm{q}}_{f2}^{\intercal},{\bm{q}}_{f3}^{\intercal}]^{\intercal}$
be composed of each finger’s DoF (${\bm{q}}_{fi}\in\mathbb{R}^{3}$). Then we
can define
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\doteq{\rho_{\scriptscriptstyle{\mathbb{R}^{3}}}(\overline{g})}\otimes{\bm{I}}_{3}\;|\;\overline{g}\in\mathcal{C}_{3}$.
Being ${\rho_{\scriptscriptstyle{\mathbb{R}^{3}}}(\cdot)}$ the permutation
representation of $3$ elements of $\mathcal{C}_{3}$ ($3$ kinematic subchains).
For the generator action of the group this is
${\rho_{\scriptscriptstyle{\mathbb{R}^{3}}}(\overline{g})}=\begin{bmatrix}0&1&0\\\
0&0&1\\\ 1&0&0\\\ \end{bmatrix}$. Lastly, we verify if
$\mathcal{G}=\mathcal{C}_{3}$ by testing all tentative group actions for DMSs
eq. 5. Augmentation of data samples: Say we collect a dataset of robot states
$({\bm{q}},\dot{{\bm{q}}})$ and cube states ${\bm{X}}_{C}$ at every time step
$t$, to train the manipulation policy [8]. To obtain the symmetric states, at
every $t$, we need to understand that since we are imitating the effect of a
true rotation of space $\overline{g}$, the symmetric states are obtained by
($g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}}$) and
($\overline{g}\cdot{\bm{X}}_{C}\doteq{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}{\bm{X}}_{C}$).
Bolt Bipedal Robot $\mathcal{G}=\mathcal{C}_{2}$ Bolt is a bipedal robot with
a sagittal plane reflection symmetry ($\mathcal{G}=\mathcal{C}_{2}$). This
morphological symmetry allows it to imitate the effect of arbitrary
reflections of space ($\overline{g}\in\mathbb{E}_{3}$) by re-configuring its
base and legs. To identify this symmetry group we apply the procedure in
section IV-C: 1. Identify ${\bm{X}}_{{B}}$ and $\mathbf{I}_{B}$:
${\bm{X}}_{{B}}$ is the robot base (hips) body, with its corresponding inertia
$\mathbf{I}_{B}$ 2. Identify symmetries of $\mathbf{I}_{B}$: The base body has
symmetrical mass distribution w.r.t the sagittal plane. Thus, $\mathbf{I}_{B}$
is invariant to the transformation
${\bm{X}}_{{B}}{\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(\overline{g})}^{\text{-}1}|\overline{g}\in\\{e,\overline{g}_{s}\\}\equiv\mathcal{C}_{2}$
(eq. 6). 3. Identify modularity in the kinematic tree: There are two symmetric
kinematic subchains. The left leg subchain and bodies are reflected versions
of the right leg subchain and bodies. 4. Identify the DMS group $\mathcal{G}$:
Since a reflection w.r.t to the sagittal plane would imply a true reflection
of the rigid bodies of the legs, we need to permute each body in the kinematic
tree with each reflected version. Denote the joint-space
$\hat{{\bm{q}}}=[{\bm{q}}_{L}^{\intercal},{\bm{q}}_{R}^{\intercal}]^{\intercal}$
as composed of the left $L$ and right $R$ legs’ DoF
(${\bm{q}}_{L/R}\in\mathbb{R}^{3}$). Denote the sign-relation between the DoF
of the Left and right legs’ degrees of freedom as
${\bm{s}}_{L|R}\in\mathbb{R}^{3}$. Then we can define
${\rho_{\scriptscriptstyle{\mathrm{Q}_{J}}}(g)}\doteq{\rho_{\scriptscriptstyle{\mathbb{R}^{2}}}(\overline{g})}\otimes({\bm{s}}_{L|R}{\bm{I}}_{3})\;|\;\overline{g}\in\mathcal{C}_{2}$.
Being ${\rho_{\scriptscriptstyle{\mathbb{R}^{2}}}(\cdot)}$ the permutation
representation of a $2$ elements of $\mathcal{C}_{2}$($2$ kinematic
subchains). For the non-trivial action of the group this is
${\rho_{\scriptscriptstyle{\mathbb{R}^{2}}}(\overline{g}_{s})}=\begin{bmatrix}0&1\\\
1&0\end{bmatrix}$. Lastly, recalling the definition of
${\rho_{\scriptscriptstyle{\mathbb{E}_{3}}}(g)}$ in eq. 6, we verify if
$\mathcal{G}=\mathcal{C}_{2}$ by testing all tentative group actions for DMSs
eq. 5. Augmentation of data samples: Say we collect a dataset of robot states
$({\bm{q}},\dot{{\bm{q}}})$ and ground reaction forces
$({\bm{f}}_{L},{\bm{f}}_{R})$, that we transform to the space of generalized
forces as $(\bm{\tau}_{f_{L}},\bm{\tau}_{f_{R}})$, at every timestep $t$. This
dataset can be used to train a reactive locomotion policy as in Ordonez-Apraez
et al. [16]. The symmetric states, at every $t$, are then defined as:
$(g\cdot{\bm{q}},g\cdot\dot{{\bm{q}}})$ and
$(g\cdot\bm{\tau}_{f_{L}},g\cdot\bm{\tau}_{f_{R}})\equiv({\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\bm{\tau}_{f_{L}},{\rho_{\scriptscriptstyle{\mathrm{Q}}}(g)}\bm{\tau}_{f_{R}})$

Figure 6: Tutorial example morphological symmetries of the Tri-Finger [8] and
Bolt robots.  Figure 7:  Comparison of the initialization method of
unconstrained layers of He et al. [11] with our initialization method for
equivariant layers. Left and right columns correspond to MLP & EMLP
architectures with $\sigma=ReLu$ (left) and $\sigma=Tanh$ (right) non-
linearities. Each row shows different initialization methods differing in the
variance of the initialization distribution of the layer’s trainable
parameters. First and second rows show the forward and backward propagation
cases of [11] for MLP and of section B-B for EMLP, with
$\mathrm{Var}(^{l}{c})\doteq\nicefrac{{m}}{{(\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma})}}$
and
$\mathrm{Var}(^{l}{c})\doteq\nicefrac{{n}}{{(\lambda_{{}^{l}{\bm{\mathsfit{B}}}}\lambda_{\sigma})}}$,
respectively. In these cases, the variance of activations through the network
depth remains nearly constant, as desired. The last two rows show the
initialization of layer parameters with a constant variance of $0.05^{2}$ and
$0.8^{2}$, illustrating scenarios of activations vanishings and exploiting.
All intermediate layers have 256 neurons. In the equivariant case, the network
is $\mathcal{K}_{4}$-equivariant.

##  Appendix D Limitations

Our work makes two main assumptions:

  1. 1.

Symmetries are exact: By assuming that a dynamical system has exact and not
approximate symmetries we are departing from the real-world nature of DMSs
since for any robotic system in the real-world the manufacturing and assembly
process introduces errors/tolerances in the kinematic and dynamic parameters
of each of the robot’s bodies. Likewise, the dynamics of animals in nature are
not perfectly equivariant since morphological symmetries are only approximate
symmetries. Although exact symmetries seem to be a strong assumption, in
practice, the reality is that it is a common assumption in the fields of
robotics and control theory, in which idealized models of the dynamics are
often assumed (in simulation and real-world).

On section VI we show that the exact symmetry bias is justifiable and
beneficial for learning function approximators processing the dynamics of
approximately symmetrical systems in the real world. However, the authors
highlight the necessity to properly address the case of approximate
equivariance, which we leave to future work. To address this case, system
identification techniques [22] have been wildly used to approximate the
deviation of the kinematic and dynamic parameters from the assumed values.
While in the case of $\mathcal{G}$-equivariant NN Wang et al. [24], Finzi et
al. [6] provide clear and valuable approaches to learn approximate
$\mathcal{G}$-equivariant NN.

It is relevant to highlight that, in physics-based simulation, the most common
practice is to work with the idealized model of dynamics. Thus, the assumption
of exact symmetries is justifiable and encouraged in applications where
simulation is a relevant tool.

  2. 2.

Symmetry group is finite: This work narrows its focus to DMSs, even do the
definition of DMS eq. 5 can be relaxed to cover continuous morphological
symmetries (an example of this continuous symmetry is the capability of a
robot arm manipulator to imitate rotations of space by rotating its first
degree of freedom). This assumption allows us to compute in linear time the
basis ${\bm{\mathsfit{B}}}$ of equivariant linear maps (restricted to groups
with finite regular matrix representations).