In SpaceTime, we only consider using one ClosedLoopBlock as the last-layer in a single-layer decoder. However, other architectures can also be explored, e.g., having more "open" blocks on top of the ClosedLoopBlock in a multi-layer decoder. In future, can refac
| 87 | |
| 88 | |
| 89 | class Decoder(nn.Module): |
| 90 | """ |
| 91 | In SpaceTime, we only consider using one ClosedLoopBlock |
| 92 | as the last-layer in a single-layer decoder. |
| 93 | |
| 94 | However, other architectures can also be explored, e.g., |
| 95 | having more "open" blocks on top of the ClosedLoopBlock |
| 96 | in a multi-layer decoder. |
| 97 | |
| 98 | In future, can refactor this class to be more general |
| 99 | and support multiple layers. (p easy, just weirdness with |
| 100 | nn.Sequential and multiple outputs) |
| 101 | """ |
| 102 | def __init__(self, config): |
| 103 | super().__init__() |
| 104 | self.config = config |
| 105 | self.blocks = self.init_blocks(config) |
| 106 | |
| 107 | def init_blocks(self, config): |
| 108 | return ClosedLoopBlock(**config['blocks'][0]) |
| 109 | |
| 110 | def forward(self, x): |
| 111 | return self.blocks(x) # y, (u_next, u) |
| 112 |