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

Class MeanMapper

src/patchcore/common.py:163–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162
163class MeanMapper(torch.nn.Module):
164 def __init__(self, preprocessing_dim):
165 super(MeanMapper, self).__init__()
166 self.preprocessing_dim = preprocessing_dim
167
168 def forward(self, features):
169 features = features.reshape(len(features), 1, -1)
170 return F.adaptive_avg_pool1d(features, self.preprocessing_dim).squeeze(1)
171
172
173class Aggregator(torch.nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected