sustainability-lab / ASTRA

"AI for Sustainability" Toolkit for Research and Analysis
1 stars 6 forks source link

Create acquisition functions #3

Open patel-zeel opened 1 year ago

patel-zeel commented 1 year ago

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

patel-zeel commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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