Skip to content

Conversation

@twodawg
Copy link
Contributor

@twodawg twodawg commented Nov 23, 2024

Showing the probabilities of an answer. I find it useful. What do you think?

Showing the probabilities of an answer
Copy link
Owner

@zhongkaifu zhongkaifu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for my delayed review. It looks good to me. Thank you for this update.

// Fetch the corresponding probability for the predicted target index
float probAtTargetIdx = probs.GetWeightAt([0, (long)targetIdx[k]]);

nr.Output[0][k].Add($"{targetWords[k]} {probAtTargetIdx:F8}");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could add a new field for probability at target idx, such as:

public List<List<List>> Output; // (beam_size, batch_size, seq_len)
public List<List<List>> ProbAtOutputIdx; // (beam_size, batch_size, seq_len)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I figured you would have a good idea on adding something. I'll see about adding it.

@twodawg twodawg closed this Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants