I found a way to get the embeddings:-

For the dot product with bias model:-

To get the rating by user 1 to movie 32:- I do the following:-

`(sigmoid(np.dot(to_np(m.u(V(1))), to_np(m.m(V(32))).T) + to_np(m.ub(V(1))) + to_np(m.mb(V(32))))) * (max_rating-min_rating) + min_rating`

However, I am not able to use an apply on this so that i can predict ratings of all the users for all movies.

```
import math
def sigmoid(x):
return 1 / (1 + math.exp(-x))
def predict_values(row):
users,movies = row['userId'],row['movieId']
um = (m.u(V(row['userId']))* m.m(V(row['movieId']))).sum(1)
res = um + m.ub(V(users)).squeeze() + m.mb(V(movies)).squeeze()
res = F.sigmoid(res) * (max_rating-min_rating) + min_rating
return res.view(res.size()[0],1)
ratings2['pred'] = ratings2.apply(predict_values,axis=1)
```

Gives me an error:-

RuntimeError: (âExpected tensor for argument #1 âindicesâ to have scalar type Long; but got CUDAFloatTensor instead (while checking arguments for embedding)â, âoccurred at index 0â)