Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SeqClassification.cs #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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.

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