Skip to content

Commit

Permalink
Merge pull request #810 from wangzhen38/mind_seed_fix
Browse files Browse the repository at this point in the history
[SEED FIX]fix seed of mind
  • Loading branch information
frankwhzhang authored Jul 13, 2022
2 parents 7f8fc47 + 7662bd4 commit 46bdc5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/recall/mind/mind_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from paddle.io import IterableDataset
import random

random.seed(12345)
#random.seed(12345)


class RecDataset(IterableDataset):
Expand Down Expand Up @@ -53,7 +53,7 @@ def init(self):
self.items = list(self.items)

def __iter__(self):
# random.seed(12345)
random.seed(12345)
while True:
user_id_list = random.sample(self.users, self.batch_size)
if self.count >= self.batches_per_epoch * self.batch_size:
Expand All @@ -63,7 +63,7 @@ def __iter__(self):
item_list = self.graph[user_id]
if len(item_list) <= 4:
continue
# random.seed(12345)
random.seed(12345)
k = random.choice(range(4, len(item_list)))
item_id = item_list[k]

Expand Down
1 change: 1 addition & 0 deletions test_tipc/configs/dnn/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ epoch:50
--profiler_options="batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile"
run_mode:PSGPU
fp_items:null
device_num:N1C8

0 comments on commit 46bdc5d

Please sign in to comment.