Is there a way we can enforce non-negativity constrains in embeddings?
In Keras, one could do like using the keras.constraints.non_neg
from keras.constraints import non_neg
movie_input = keras.layers.Input(shape=[1],name='Item')
movie_embedding = keras.layers.Embedding(n_movies + 1, n_latent_factors, name='NonNegMovie-Embedding', embeddings_constraint=non_neg())(movie_input)

I’m trying to rewrite in PyTorch, a blogpost I wrote on non-neg. matrix factorization in Keras. 24