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