Closed KunlinY closed 4 years ago
You can get the item embedding fairly simply. Depending on the value of the embedding
and constrained_embedding
model parameters, you can have have:
(a) only out item embedding in Wy
(embedding=0, constrained_embedding=False
)
(b) in and out item embeddings in E
and Wy
respectively (embedding=X, constrained_embedding=False
, X>0)
(c) unified item embedding in Wy
(embedding=0, constrained_embedding=True
)
Select the variable you want to get the embedding from and get its value from the theano shared variable (e.g. Wy.get_value(borrow=False)
). To match this to the item IDs in your data you must use the itemidmap
variable of the model (translates item IDs from your train data to indexes).
Getting session embeddings is not supported in the public version at the moment. This functionality might be added from the internal version in the future.
After training, is it possible to output the embedding of session embedding and item embedding? Or could you tell me how to get those emebddings?