To re-org Q-results

This commit is contained in:
D-X-Y
2021-03-06 06:13:22 -08:00
parent cc28e1589e
commit 511e2443d0
7 changed files with 172 additions and 40 deletions

View File

@@ -24,12 +24,12 @@ class PositionalEncoder(nn.Module):
else:
pe[pos, i] = math.cos(value)
pe = pe.unsqueeze(0)
self.dropout = nn.Dropout(p=dropout)
self.register_buffer('pe', pe)
def forward(self, x):
batch, seq, fdim = x.shape[:3]
embeddings = self.pe[:, :seq, :fdim]
import pdb; pdb.set_trace()
outs = self.dropout(x + embeddings)
return x + embeddings
return outs