assert dim_model % nb_heads == 0
self.embedding = nn.Sequential(
- nn.Embedding(vocabulary_size, dim_model),
+ nn.Embedding(2 * vocabulary_size, dim_model),
nn.Dropout(dropout),
)
m.bias.zero_()
m.weight.fill_(1.0)
- def forward(self, x, mask=None):
+ def forward(self, x):
+ x = 2 * x[:, :, 0] + x[:, :, 1]
x = self.embedding(x)
x = self.positional_encoding(x)
x = self.trunk(x)
models = []
for i in range(args.nb_models):
- model = MyAttentionAE(
- # model = attae.AttentionAE(
+ # model = MyAttentionAE(
+ model = attae.AttentionAE(
vocabulary_size=vocabulary_size,
dim_model=args.dim_model,
dim_keys=args.dim_keys,
else:
log_string(f"nb_c_quizzes {c_quizzes.size(0)}")
+ # one_ae_epoch(model, quiz_machine, n_epoch, None)
+ # exit(0)
+
# --------------------------------------------------------------------
ranked_models = sorted(models, key=lambda m: float(m.test_accuracy))