Md. Asif Uddin
    I.14.X02

    Equivariance, proved and broken

    proof▲▲△

    Prove that the sum layer H′=σ(HW0+AHW1)\mat H'=\sigma(\mat H\mat W_0+\mat A\mat H\mat W_1), with σ\sigma applied entrywise, is permutation-equivariant, and that the readout 1TH′\mathbf 1^{\mathsf T}\mat H' is invariant. Then show that the layer “take the feature of your lowest-numbered neighbour” is not equivariant, using the paw graph with x=(1,2,3,4)\vec x=(1,2,3,4) and the relabelling that swaps nodes 11 and 44.

    Hint

    PTP=I\mat P^{\mathsf T}\mat P=\mat I, an entrywise function commutes with reordering rows, and 1TP=1T\mathbf 1^{\mathsf T}\mat P=\mathbf 1^{\mathsf T}.

    Solution

    Equivariance. Relabel: A↦PAPT\mat A\mapsto\mat P\mat A\mat P^{\mathsf T} and H↦PH\mat H\mapsto\mat P\mat H. The pre-activation becomes

    PHW0+PAPTPHW1    =P(HW0+AHW1).\begin{aligned} &\mat P\mat H\mat W_0+\mat P\mat A\mat P^{\mathsf T}\mat P\mat H\mat W_1\\ &\;\;=\mat P\big(\mat H\mat W_0+\mat A\mat H\mat W_1\big). \end{aligned}

    An entrywise σ\sigma applied to a matrix with reordered rows gives the same rows reordered, so the output is PH′\mat P\mat H'. ■\blacksquare

    Invariance. A permutation matrix’s columns each contain one 11, so 1TP=1T\mathbf 1^{\mathsf T}\mat P=\mathbf 1^{\mathsf T} and 1T(PH′)=1TH′\mathbf 1^{\mathsf T}(\mat P\mat H')=\mathbf 1^{\mathsf T}\mat H'. ■\blacksquare

    A layer that breaks it. On the paw the lowest-numbered neighbours of nodes 11 to 44 are 22, 11, 11 and 33, so the layer returns (2,1,1,3)(2,1,1,3). After swapping nodes 11 and 44, the features are (4,2,3,1)(4,2,3,1) and the lowest-numbered neighbours are 33, 33, 11 and 22: the layer returns (3,3,4,2)(3,3,4,2). Equivariance would require the original output with its first and last entries swapped, (3,1,1,2)(3,1,1,2). The second and third entries differ: node 22‘s output changed although nothing about node 22 did. The layer reads the labelling, which carries no information about the graph.

    Draws on