(self, n: int)
| 15 | """Camera pose optimization module.""" |
| 16 | |
| 17 | def __init__(self, n: int): |
| 18 | super().__init__() |
| 19 | # Delta positions (3D) + Delta rotations (6D) |
| 20 | self.embeds = torch.nn.Embedding(n, 9) |
| 21 | # Identity rotation in 6D representation |
| 22 | self.register_buffer("identity", torch.tensor([1.0, 0.0, 0.0, 0.0, 1.0, 0.0])) |
| 23 | |
| 24 | def zero_init(self): |
| 25 | torch.nn.init.zeros_(self.embeds.weight) |