I\'m a beginner in Keras and just write a toy example. It reports a TypeError. The code and error are as follows:
Code:
I think @today's answer is very clear. However, not complete. The key thing here is that, if your input doesn't contain num_features, you have to make a Embedding layer next to the input.
So if you use:
inputs = keras.Input(shape=(3,))
embedding = Embedding(voc_size, embed_dim, ..)
X = embedding(inputs)
it also works.