MCPcopy Create free account
hub / github.com/MetaSLAM/SphereVLAD / __call__

Method __call__

dataloader/data_augmentation.py:243–253  ·  view source on GitHub ↗
(self, e)

Source from the content-addressed store, hash-verified

241 self.r_max = float(r)
242
243 def __call__(self, e):
244 n = len(e)
245 if self.r_min is None:
246 r = self.r_max
247 else:
248 # Randomly select removal ratio
249 r = random.uniform(self.r_min, self.r_max)
250
251 mask = np.random.choice(range(n), size=int(n*r), replace=False) # select elements to remove
252 e[mask] = torch.zeros_like(e[mask])
253 return e
254
255
256class RemoveRandomBlock:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected