Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: fix the running error of DiffRec when noise_scale=0 #1915

Merged
merged 3 commits into from
Nov 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading