This commit is contained in:
wassname
2023-11-19 10:58:45 +08:00
parent 328d281651
commit ecee11fc33
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -46,6 +46,8 @@ class Tokenizer(nn.Module):
def compute_loss(self, batch: Batch, **kwargs: Any) -> LossWithIntermediateLosses:
assert self.lpips is not None
observations = self.preprocess_input(rearrange(batch['observations'], 'b t c h w -> (b t) c h w'))
# TODO: in the delta-IRIS paper (https://openreview.net/forum?id=o8IDoZggqO) they encode(x0, a0, x1) -> z1 and decode(x0, a0, z1). In esense the tokens only need to encode the change
# note they also do dynamics(x0, a0, z1) -> z2. decode(x1, a1, z2) -> x2
z, z_quantized, reconstructions = self(observations, should_preprocess=False, should_postprocess=False)
# Codebook loss. Notes:
+1
View File
@@ -47,6 +47,7 @@ class WorldModel(nn.Module):
)
# why have this? Well I worry that the transformer can't adapt, since so much is frozen
# TODO: If I get the dynamics model working, maybe try without it
self.post_embed = nn.Sequential(
nn.Linear(config.embed_dim, config.embed_dim),
nn.ReLU(),