Skip to content

Equivariance test fails on C8 for EquivariantObsEnc, EquivariantResEncoder76Cyclic, and full model #9

@htrbao

Description

@htrbao

Description

I tested equivariance of two components from this repo (EquivariantObsEnc and EquivariantResEncoder76Cyclic) as well as the full policy model, under the cyclic group C8.
The results suggest that none of them are strictly equivariant:

  • EquivariantObsEnc: fails for all rotations.
  • EquivariantResEncoder76Cyclic: passes for identity (0 rotation) but fails for all other rotations.
  • DiffusionEquiUNetCNNEncPolicy: fails for all rotations.

Test Method

I used the standard equivariance check:

  • f(Tx) = apply transformation T to the input, then pass through the network
  • T(f(x)) = pass input through the network, then transform the output
  • Compare whether f(Tx) ≈ T(f(x)) for each group element

Results

EquivariantObsEnc

False 0[2pi/8] tensor(0.2026, device='cuda:1')
False 1[2pi/8] tensor(0.2031, device='cuda:1')
False 2[2pi/8] tensor(0.2006, device='cuda:1')
False 3[2pi/8] tensor(0.2044, device='cuda:1')
False 4[2pi/8] tensor(0.2044, device='cuda:1')
False 5[2pi/8] tensor(0.2025, device='cuda:1')
False 6[2pi/8] tensor(0.2030, device='cuda:1')
False 7[2pi/8] tensor(0.2027, device='cuda:1')

EquivariantResEncoder76Cyclic

True  0[2pi/8] tensor(4.1376e-18, device='cuda:1')
False 1[2pi/8] tensor(0.4769, device='cuda:1')
False 2[2pi/8] tensor(0.2295, device='cuda:1')
False 3[2pi/8] tensor(0.4780, device='cuda:1')
False 4[2pi/8] tensor(0.2746, device='cuda:1')
False 5[2pi/8] tensor(0.4778, device='cuda:1')
False 6[2pi/8] tensor(0.2294, device='cuda:1')
False 7[2pi/8] tensor(0.4769, device='cuda:1')

DiffusionEquiUNetCNNEncPolicy

False 0[2pi/8] tensor(0.6322)
False 1[2pi/8] tensor(0.6452)
False 2[2pi/8] tensor(0.6487)
False 3[2pi/8] tensor(0.6303)
False 4[2pi/8] tensor(0.6254)
False 5[2pi/8] tensor(0.6534)
False 6[2pi/8] tensor(0.6494)
False 7[2pi/8] tensor(0.6729)

Test Script

  • The script here for checking equivariant property of EquivariantObsEnc module.

  • The script here for checking equivariant property of EquivariantResEncoder76Cyclic module.

  • The script here for checking equivariant property of DiffusionEquiUNetCNNEncPolicy.


Expected Behavior

For a properly equivariant module, all rotations in C8 should satisfy:

f(T_g x) ≈ T_g f(x)

within numerical tolerance. That means torch.allclose(y_new, y_transformed, atol=1e-4) should be True for all group elements g.


Actual Behavior

  • EquivariantObsEnc: fails for all C8 rotations.
  • EquivariantResEncoder76Cyclic: only passes for identity rotation.
  • DiffusionEquiUNetCNNEncPolicy: fails for all rotations.

Questions

  1. Are these components expected to be strictly C8-equivariant?
  2. Is any additional configuration (e.g., padding, stride, field types) required to preserve equivariance?
  3. If my understanding of the equivariance test is incorrect, is there another recommended way to verify the model’s equivariance property?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions