Transformers, Pytorch, Machine Learning, Deep Dives, Data Science.
outputs[:, :step] probs = self.transformer.decode(y, encoder_output) output = torch.argmax(probs, dim=-1) # Uncomment if you want to see step by step predicitons # print(f"Knowing {y} we output {output[:, -1]}") if output[:, -1].detach().numpy() in (eos_idx, sos_idx): break outputs[:, step] =