Skip to content

Commit

Permalink
Merge pull request #1915 from BishopLiu/master
Browse files Browse the repository at this point in the history
FIX: fix the running error of DiffRec when noise_scale=0
  • Loading branch information
BishopLiu authored Nov 15, 2023
2 parents 7fd8e76 + 3e7e630 commit ac60ad9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recbole/model/general_recommender/diffrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def __init__(self, config, dataset):
self.emb_size = config["embedding_size"]
self.norm = config["norm"] # True or False
self.reweight = config["reweight"] # reweight the loss for different timesteps
if self.noise_scale == 0.0:
self.reweight = False
self.sampling_noise = config[
"sampling_noise"
] # whether sample noise during predict
Expand Down Expand Up @@ -151,7 +153,7 @@ def __init__(self, config, dataset):
self.betas <= 1
).all(), "betas out of range"

self.calculate_for_diffusion()
self.calculate_for_diffusion()

def build_histroy_items(self, dataset):
r"""
Expand Down

0 comments on commit ac60ad9

Please sign in to comment.