MCPcopy Create free account
hub / github.com/HKUDS/DCCF / mini_batch

Method mini_batch

utility/load_data.py:95–102  ·  view source on GitHub ↗
(self, batch_idx)

Source from the content-addressed store, hash-verified

93 return len(self.train_data)
94
95 def mini_batch(self, batch_idx):
96 st = batch_idx * self.batch_size
97 ed = min((batch_idx + 1) * self.batch_size, len(self.train_data))
98 batch_data = self.train_data[st: ed]
99 users = batch_data[:, 0]
100 pos_items = batch_data[:, 1]
101 neg_items = batch_data[:, 2]
102 return users, pos_items, neg_items
103
104 def get_num_users_items(self):
105 return self.n_users, self.n_items

Callers 1

DCCF_PyTorch.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected