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

get_iid_Pi #4

Open
milhidaka opened this issue Sep 7, 2022 · 0 comments
Open

get_iid_Pi #4

milhidaka opened this issue Sep 7, 2022 · 0 comments

Comments

@milhidaka
Copy link

Hi,
I have found a problem that may be a minor bug and would like to report it.

iid_Pi = iid_Pi / torch.sum(iid_Pi, dim=0)

The result iid_Pi is used in get_U_sets_Multiclass function to split bag_sizes[i] into classnum classes (thetas=iid_Pi) .

n_this = int(bag_sizes[i] * thetas[i][cls])

However, torch.sum(thetas[i]) is not 1. I think it is unnatural.

iid_Pi = iid_Pi / torch.sum(iid_Pi, dim=1, keepdim=True)

may be correct?

In practice, this problem is minor because the deviation from 1 is small when given the arguments used in the experiment.

torch.sum(get_iid_Pi(5, 10, 10), dim=1)
tensor([0.9961, 0.9798, 1.0240, 0.9745, 0.9325, 1.0388, 1.0151, 1.0014, 0.9772,
        1.0606], dtype=torch.float64)
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

No branches or pull requests

1 participant