t_next = dist.sample()
all_n = torch.arange(t_next.size(0))
- seq_logproba += logits[all_n, t_next].sum(dim=-1)
+
+ seq_logproba += logits[all_n, t_next]
input[:, s] = ar_mask[:, s] * t_next + (1 - ar_mask[:, s]) * input[:, s]
backward_nb_total = correct[n_backward].size(0)
self.logger(
- f"forward_accuracy {log_prefix} {n_epoch} {model.id=} {forward_nb_correct} / {forward_nb_total}"
+ f"{log_prefix}_forward_accuracy {n_epoch} model {model.id} nb_correct {forward_nb_correct} / {forward_nb_total} ({forward_nb_correct*100/forward_nb_total} %)"
)
self.logger(
- f"backward_accuracy {log_prefix} {n_epoch} {model.id=} {backward_nb_correct} / {backward_nb_total}"
+ f"{log_prefix}_backward_accuracy {n_epoch} model {model.id} nb_correct {backward_nb_correct} / {backward_nb_total} ({backward_nb_correct*100/backward_nb_total} %)"
)
return result, correct
nb_correct = 0
+ seq_logproba[...] = 0.0
+
for model in models_for_validation:
result = c_quizzes.clone()
- seq_logproba[...] = 0.0
-
ar_mask = self.make_ar_mask(result)
masked_inplace_autoregression(