Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/retention.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _get_D(self, sequence_length):
m = torch.arange(sequence_length).unsqueeze(0)

# Broadcast self.gamma ** (n - m) with appropriate masking to set values where n < m to 0
D = (self.gamma ** (n - m)) * (n >= m).float() #this results in some NaN when n is much larger than m
D = (self.gamma ** (n - m)) * (n >= m).float() #this results in some NaN when m is much larger than n
# fill the NaN with 0
D[D != D] = 0

Expand Down