MCPcopy
hub / github.com/hanzhanggit/StackGAN / load_tables

Function load_tables

misc/skipthoughts.py:75–88  ·  view source on GitHub ↗

Load the tables

()

Source from the content-addressed store, hash-verified

73
74
75def load_tables():
76 """
77 Load the tables
78 """
79 words = []
80 utable = numpy.load(path_to_tables + 'utable.npy')
81 btable = numpy.load(path_to_tables + 'btable.npy')
82 f = open(path_to_tables + 'dictionary.txt', 'rb')
83 for line in f:
84 words.append(line.decode('utf-8').strip())
85 f.close()
86 utable = OrderedDict(zip(words, utable))
87 btable = OrderedDict(zip(words, btable))
88 return utable, btable
89
90
91def encode(model, X, use_norm=True, verbose=True, batch_size=128, use_eos=False):

Callers 1

load_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected