Skip to content

Instantly share code, notes, and snippets.

import glob
entries = []
for n,fname in enumerate(glob.glob('/Users/tom/Downloads/data/*/*.txt')):
f = open(fname)
s = f.readlines()
x = [g.split('\t') for g in ' '.join(s).strip().split('\n ----------\n')][:-1]
if n%1000 == 0:
print n,fname
for raw_entry in x:
@phreeza
phreeza / embeddings.tsv
Created January 27, 2017 11:47
arxiv embeddings
We can't make this file beautiful and searchable because it's too large.
0.871428 0.818533 0.616601 -0.896398 0.750342 -0.0670242 -0.985361 -0.901136 -0.799989 0.661025 0.896552 -0.999996 -0.815607 -0.999946 0.210674 -0.795743 -0.936592 0.984476 0.415128 -0.640509 0.934588 0.483844 0.399479 0.215688 -0.992214 0.324514 0.454484 -0.800055 -0.999993 0.788731 -0.28611 -0.0720174 0.0251022 0.588688 0.598253 0.857084 0.999794 -0.953029 -0.865772 -0.289119 0.999546 -0.709774 -0.415915 0.0922971 -0.997911 -0.108204 -0.999999 -0.414267 -0.799834 -0.0698598 0.572549 0.410644 -0.790586 0.293573 0.999865 -0.476083 -0.678337 -0.662886 -0.999999 -0.136961 0.70228 0.05713 -0.96455 -0.715666 0.996947 -0.777469 0.999629 0.887067 0.506511 -0.691616 0.676756 -0.918784 0.835962 0.451829 -0.801001 0.0379395 0.999999 -0.096177 -1.0 0.977844 -0.771265 0.999997 0.97939 0.19234 -0.641295 -0.0612696 0.916226 0.447681 -0.651528 -0.844617 -0.661612 0.413032 0.989486 -0.897041 -0.685231 -0.335238 0.302788 -0.710447 -0.42624 0.914872 -0.312054 0.156264 0.983085 0.925359 0.916282 0.283454 0.371099 0.0488607 0.3
{
"embeddings": [
{
"tensorName": "Arxiv Titles",
"tensorShape": [
10000,
256
],
"tensorPath": "https://gist.githubusercontent.com/phreeza/e6a8f136fcda76bb7820f788e87e8681/raw/967badf2f7794a32e862c4ee2a8a65b59b118fb8/embeddings.tsv",
"metadataPath": "https://gist.github.com/phreeza/e6a8f136fcda76bb7820f788e87e8681/raw/967badf2f7794a32e862c4ee2a8a65b59b118fb8/metadata.tsv"
import tensorflow as tf
node1 = tf.constant(3.0, tf.float32)
node2 = tf.constant(4.0) # also tf.float32 implicitly
with tf.Session() as sess:
W = tf.Variable([.3], tf.float32, name='W')
b = tf.Variable([-.3], tf.float32, name='b')
x = tf.placeholder(tf.float32, name='x')
with tf.name_scope("LinearModel"):