Lambda Layer In Keras With Keras.backend.one_hot Gives Typeerror
I'm trying to train a character level CNN using Keras. I take as input a single word. I have already transformed the words into lists of indices, but when I try to feed it into one
Solution 1:
I would suggest a cleaner solution that would achieve the same result, how about:
k_model.add(Embedding(num_classes, num_classes,
embeddings_initializer='identity',
trainable=False,
name='onehot'))
You are essentially embedding things, it would make more sense to use one with fixed weights. It also gives you the flexibility to make the embedding trainable in the future.
Post a Comment for "Lambda Layer In Keras With Keras.backend.one_hot Gives Typeerror"