Skip to content

Commit

Permalink
Update AMF.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiangnan authored Oct 11, 2018
1 parent fee12e4 commit 61a4ee2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _get_train_batch(i):
# negtive k
gtItem = _dataset.testRatings[user][1]
j = np.random.randint(_dataset.num_items)
while j in _dataset.trainList[_user_input[_index[idx]]] or j == gtItem:
while j in _dataset.trainList[_user_input[_index[idx]]]:
j = np.random.randint(_dataset.num_items)
item_neg_batch.append(j)
return np.array(user_batch)[:, None], np.array(item_batch)[:, None], \
Expand Down Expand Up @@ -529,4 +529,4 @@ def init_logging(args, time_stamp):
print "Initialize AMF"

# start training
training(AMF, dataset, args, epoch_start=args.adv_epoch, epoch_end=args.epochs, time_stamp=time_stamp)
training(AMF, dataset, args, epoch_start=args.adv_epoch, epoch_end=args.epochs, time_stamp=time_stamp)

0 comments on commit 61a4ee2

Please sign in to comment.