Skip to content
Open
Show file tree
Hide file tree
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ print(f"[{attn_type.upper()}] Generated shape: {out.shape}")
A = model.recurrent.injection.get_A()
rho = torch.linalg.eigvals(A).abs().max().item()
print(
f"[{attn_type.upper()}] Spectral radius ρ(A) = {rho:.4f} (must be < 1)"
f"[{attn_type.upper()}] Spectral radius ρ(A): {rho:.4f} (must be < 1)"
)
```

Expand Down
1 change: 1 addition & 0 deletions examples/moda_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
labels = torch.randint(0, cfg.vocab_size, (B, T), device=device)

logits, loss = model(input_ids, labels)
assert not torch.isnan(loss), "Loss is NaN!"
assert logits.shape == (B, T, cfg.vocab_size)
print(f"Logits shape : {logits.shape}")
print(f"Loss (LM + balance): {loss.item():.4f}")
Expand Down