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

EPIG implementation #270

Merged
merged 4 commits into from May 18, 2024
Merged

Conversation

reeshipaul
Copy link
Contributor

@reeshipaul reeshipaul commented Jul 19, 2023

Summary:

Issue #259

Features:

Checklist:

  • Your code is documented (To validate this, add your module to tests/documentation_test.py).
  • Your code is tested with unit tests.
  • You moved your Issue to the PR state.

@reeshipaul reeshipaul changed the title EPIG implementation [WIP] EPIG implementation Jul 19, 2023
Copy link
Member

@Dref360 Dref360 left a comment

Choose a reason for hiding this comment

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

This is an awesome start! Feel free to ignore my comments for now, I just wanted to not forget them.

"""
logprobs = torch.clone(probs) #  [*N, Cl]
logprobs[probs > 0] = torch.log(probs[probs > 0]) #  [*N, Cl]
return -torch.sum((probs * logprobs), dim=-1) # [*N,]
Copy link
Member

Choose a reason for hiding this comment

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

This can all be cut to return -torch.sum(torch.xlogy(probs, probs), dim=-1)

Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice!

baal/active/active_loop.py Outdated Show resolved Hide resolved
baal/active/heuristics/heuristics.py Outdated Show resolved Hide resolved
baal/active/heuristics/heuristics.py Outdated Show resolved Hide resolved
@Dref360
Copy link
Member

Dref360 commented May 4, 2024

With @fbickfordsmith latest AISTAT paper link I think we should really more this PR forward. I refactored a bit and assuming the equations in EPIG are correct I think we can merge that pretty soon.

Freddie, if your energy takes you there, could you review the code of EPIG? In particular the compute_score function which receives both unlabelled probabilities and training probabilities. It returns the EPIG score for all unlabelled items.

@Dref360 Dref360 changed the title [WIP] EPIG implementation EPIG implementation May 4, 2024
@fbickfordsmith
Copy link
Contributor

Great that you're moving this forward! Happy to support. I'm at ICLR this week so can't look at the code for a while, but I've added this to my to-do list.

@fbickfordsmith
Copy link
Contributor

Nice work @Dref360 @reeshipaul! Looks good overall.

I have some minor suggestions. Probably easiest if I push some changes for you to look at.

What's the best way to do that? If @reeshipaul gives me push access to https://github.com/reeshipaul/baal then I could create a branch there. Open to alternatives too.

@Dref360
Copy link
Member

Dref360 commented May 14, 2024

In case @reeshipaul doesn't answer back, feel free to submit comments with suggestion.
If by the end of the week we don't hear back, I'll merge this branch in a feature branch and you can fork baal-org/baal directly.

@Dref360 Dref360 self-assigned this May 16, 2024
@Dref360 Dref360 changed the base branch from master to features/epig_release May 18, 2024 17:22
@Dref360 Dref360 merged commit 0cd798a into baal-org:features/epig_release May 18, 2024
2 checks passed
@Dref360
Copy link
Member

Dref360 commented May 18, 2024

@fbickfordsmith this has been merged into baal-org:features/epig_release, please submit a PR against it with your changes.

@Dref360 Dref360 mentioned this pull request May 18, 2024
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.

None yet

3 participants