Update.
authorFrançois Fleuret <francois@fleuret.org>
Sat, 6 Jan 2024 13:49:59 +0000 (14:49 +0100)
committerFrançois Fleuret <francois@fleuret.org>
Sat, 6 Jan 2024 13:49:59 +0000 (14:49 +0100)
mygpt.py

index 9bacaff..c061eb4 100755 (executable)
--- a/mygpt.py
+++ b/mygpt.py
@@ -545,6 +545,8 @@ class Caterpillar(nn.Module):
             torch.einsum("ntc,hec->nhet", X, self.w_G) + self.b_G[None, :, :, None]
         ).sigmoid()
 
+        G = F.dropout(G, self.attention_dropout, self.training)
+
         V = torch.einsum("ntc,hdc->nhtd", X, self.w_V)
         K = torch.einsum("ntc,hdc->nhtd", X, self.w_K)