HI, everyone,
In lesson 4,
user_in = Input(shape=(1,), dtype='int64', name='user_in')
u = Embedding(n_users, n_factors, input_length=1, W_regularizer=l2(1e-4))(user_in)
movie_in = Input(shape=(1,), dtype='int64', name='movie_in')
m = Embedding(n_movies, n_factors, input_length=1, W_regularizer=l2(1e-4))(movie_in)
Above code has defined the matrix factor, I have try this code to initial the weights,
user_in = Input(shape=(1,), dtype='int32', name='user_in')
c = Embedding(n_users, n_factors, input_length=1, weights=df_hist_data.values, W_regularizer=l2(1e-4))(user_in)
but I got error out like this:
ValueError: You called `set_weights(weights)` on layer "embedding_89" with a weight list of length 4521, but the layer was expecting 1 weights. Provided weights: [[ 1.00000000e-03 1.00000000e+01 5.00000000e+...
So, I think the problem is the input layer
and input_length
parameter. But I still can’t figure out the right way to initialize the weights matrix for the user. Is there anybody know how to do that? Thanks lot.