Skip to content

Instantly share code, notes, and snippets.

@alexeygrigorev
alexeygrigorev / tensorflow-w2v-gd.py
Created March 21, 2016 16:04
Word2Vec with Tensorflow on GPU
graph = tf.Graph()
with graph.as_default():
with graph.device('/gpu:0'):
# input data
train_dataset = tf.placeholder(tf.int32, shape=[batch_size])
train_labels = tf.placeholder(tf.int32, shape=[batch_size, 1])
valid_dataset = tf.constant(valid_examples, dtype=tf.int32)
# variables