(self, batch_idx)
| 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 |