Skip to content

Instantly share code, notes, and snippets.

@chricke
Created March 26, 2019 09:41
Embed
What would you like to do?
Create embedding
def get_embed(input_data, vocab_size, embed_dim):
embedding = tf.Variable(tf.random_uniform((vocab_size, embed_dim), -1, 1))
embed = tf.nn.embedding_lookup(embedding, input_data)
return embed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment