Skip to content

Instantly share code, notes, and snippets.

@chricke
Created March 26, 2019 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chricke/290a25c6ccd00684c3ebfab1292394c6 to your computer and use it in GitHub Desktop.
Save chricke/290a25c6ccd00684c3ebfab1292394c6 to your computer and use it in GitHub Desktop.
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