MCPcopy Create free account
hub / github.com/K-Quant/HiDy / iter_batch

Method iter_batch

application/SMP/utils/dataloader.py:61–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

59 return len(self.daily_count)
60
61 def iter_batch(self):
62 if self.batch_size <= 0:
63 yield from self.iter_daily_shuffle()
64 return
65
66 indices = np.arange(len(self.df_label))
67 np.random.shuffle(indices)
68
69 for i in range(len(indices))[::self.batch_size]:
70 if len(indices) - i < self.batch_size:
71 break
72 yield i, indices[i:i + self.batch_size] # NOTE: advanced indexing will cause copy
73
74 def iter_daily_shuffle(self):
75 indices = np.arange(len(self.daily_count))

Callers

nothing calls this directly

Calls 1

iter_daily_shuffleMethod · 0.95

Tested by

no test coverage detected