You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to train a DR4SR+ using SASRec.But this tensor has no gradient during training, so is something wrong? print(meta_loss.grad) print(meta_train_loss.grad)
self.meta_optimizer.step(
val_loss=meta_loss,
train_loss=meta_train_loss,
aux_params = list(self.meta_module.parameters()),
parameters = list(self.sub_model.parameters()),
return_grads = False,
)
The text was updated successfully, but these errors were encountered:
It is normal for meta_loss and meta_train_loss in DR4SR+ to have no gradients. This is because, in the bi-level optimization framework, DR4SR+ does not compute gradients through conventional gradient descent methods to update the model. Instead, it directly updates the parameters based on implicit gradient calculations. For more details, please refer to the step code in the MetaOptimizer:
Here, you will notice that we compute hyper_grads based on meta_loss and meta_train_loss, and then bind these hyper_grads to the parameters that need optimization:
I need to train a DR4SR+ using SASRec.But this tensor has no gradient during training, so is something wrong?
print(meta_loss.grad)
print(meta_train_loss.grad)
self.meta_optimizer.step(
val_loss=meta_loss,
train_loss=meta_train_loss,
aux_params = list(self.meta_module.parameters()),
parameters = list(self.sub_model.parameters()),
return_grads = False,
)
The text was updated successfully, but these errors were encountered: