During the first run, mems == None, and the model doesn't attend to any "read" tokens, as per:
|
if exists(read_memories): |
|
read_mem_length = mem_length |
|
read_memories = read_memories + self.read_memory_emb |
|
else: |
|
read_mem_length = 0 |
|
read_memories = x[:, 0:0] |
Why not attend to
read_memory_emb, and replace with
read_mem_length = mem_length
read_mems = repeat(self.read_memory_emb, 'm d -> b m d', b = batch)
if exists(read_memories):
read_mems += read_memories
During the first run,
mems == None, and the model doesn't attend to any "read" tokens, as per:recurrent-memory-transformer-pytorch/recurrent_memory_transformer_pytorch/recurrent_memory_transformer.py
Lines 350 to 355 in 3be7d43
Why not attend to
read_memory_emb, and replace with