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

Implementation of loss in the paper #4

Open
McHz1s opened this issue Jul 3, 2021 · 1 comment
Open

Implementation of loss in the paper #4

McHz1s opened this issue Jul 3, 2021 · 1 comment

Comments

@McHz1s
Copy link

McHz1s commented Jul 3, 2021

Hello!
Which loss in losses.py is proposed by the paper?
It seems Pathak is the one to be compared.

@HKervadec
Copy link
Member

Hello,

The one to use is NaivePenalty for the 2D case, and BatchNaivePenalty that was used for the 3D setting.

In our case the bounds were computed at the dataloader level from one of the class in bounds.py, though in the end they could come from anywhere.

This code was already quite flexible (in the sense you can bound any function, not just size), you could simplify it a bit if you stick to a sizeloss or something like that. The bounds tensor, inside the NaivePenalty function, has the following shape: B×K×D×2:

  • B is the batch size;
  • K is the number of classes (you can bound only a subset of them, with the idc parameter);
  • D is the dimensionality of the value to constraint, 1 for size, 2 for centroid, etc;
  • 2 is simply for lower and upper bounds.

Depending on your setting, you could modify that to simplify it a bit if it is not needed.

Let me know,

Hoel

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

2 participants