MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / interleave_offsets

Method interleave_offsets

models/fixmatch/fixmatch.py:296–304  ·  view source on GitHub ↗
(self, batch, nu)

Source from the content-addressed store, hash-verified

294 self.print_fn('model loaded')
295
296 def interleave_offsets(self, batch, nu):
297 groups = [batch // (nu + 1)] * (nu + 1)
298 for x in range(batch - sum(groups)):
299 groups[-x - 1] += 1
300 offsets = [0]
301 for g in groups:
302 offsets.append(offsets[-1] + g)
303 assert offsets[-1] == batch
304 return offsets
305
306 def interleave(self, xy, batch):
307 nu = len(xy) - 1

Callers 1

interleaveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected