MCPcopy Create free account
hub / github.com/amazon-science/patchcore-inspection / __init__

Method __init__

src/patchcore/sampler.py:40–50  ·  view source on GitHub ↗

Greedy Coreset sampling base class.

(
        self,
        percentage: float,
        device: torch.device,
        dimension_to_project_features_to=128,
    )

Source from the content-addressed store, hash-verified

38
39class 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:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected