Greedy Coreset sampling base class.
(
self,
percentage: float,
device: torch.device,
dimension_to_project_features_to=128,
)
| 38 | |
| 39 | class GreedyCoresetSampler(BaseSampler): |
| 40 | def __init__( |
| 41 | self, |
| 42 | percentage: float, |
| 43 | device: torch.device, |
| 44 | dimension_to_project_features_to=128, |
| 45 | ): |
| 46 | """Greedy Coreset sampling base class.""" |
| 47 | super().__init__(percentage) |
| 48 | |
| 49 | self.device = device |
| 50 | self.dimension_to_project_features_to = dimension_to_project_features_to |
| 51 | |
| 52 | def _reduce_features(self, features): |
| 53 | if features.shape[1] == self.dimension_to_project_features_to: |