Hi, I am writing a PyTorch program on cross-domain recommendations.
I would like to summarise my model as
input: users and items interacted, retrieve embeddings, pass it through the model, and get the output.
#Initialisation 
self.U = nn.Embedding(self.nUser, self.edim_u)

self.param = [self.U + other params]
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(self.params, lr=self.learning_rate)


And this is the error message
“optimizer can only optimize Tensors, but one of the params is torch.nn.modules.sparse.Embedding”.
Help please…