Gpt, Transformer, Pytorch, Multi Head Attention, Decoder.
sequence distribution = torch.exp(output[0, 0, :]) # Convert the output tensor to numpy array distribution = distribution.detach().numpy() # Now plot the distribution plt.figure(figsize=(12, 6)) plt.bar(np.arange(vocab_size), distribution) plt.xlabel("Word Index") plt.ylabel("Probability")