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

Create acquisition functions #3

Open
2 of 12 tasks
patel-zeel opened this issue Oct 27, 2023 · 3 comments
Open
2 of 12 tasks

Create acquisition functions #3

patel-zeel opened this issue Oct 27, 2023 · 3 comments

Comments

@patel-zeel
Copy link
Member

patel-zeel commented Oct 27, 2023

Refer to this paper for most functions below.

Create a separate file for each of these strategies in astra/torch/al/acquisitions folder. See for example, https://github.com/sustainability-lab/ASTRA/blob/main/astra/torch/al/acquisitions/random.py

Your acquisition function should inherit from all base classes it supports. For example, Entropy class should inherit from MCAcquisition and EnsembleAcquisition:

from astra.torch.al.acquisitions.base import MCAcquisition, EnsembleAcquisition

def EntropyAcquisition(MCAcquisition, EnsembleAcquisition):
    ...

All of you should

  • Create the acquisition implementation files.
  • Add appropriate tests for them in astra/tests directory in relevant folders.
  • Add a small notebook showing a minimum working active learning example using your acquisition.
@patel-zeel
Copy link
Member Author

I have added DeterministicStrategy now. Acquisitions such as Entropy should check if the input is 3d (mc_dim, pool_dim, n_classes) and take mean over the first dimension. If input is 2d (pool_dim, n_classes), simply compute the acquisition and return the scores.

@aditiagarwal-02
Copy link

aditiagarwal-02 commented Oct 28, 2023

Since MC BALD and BALD have been assigned differently, BALD will only inherit from DeterministicStratergy? Basically, should we have two separate files for BALD and MC BALD?

@patel-zeel
Copy link
Member Author

@aditiagarwal-02 No, you can inherit from all relevant classes at once. I have updated the assignment accordingly.

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