Created
March 13, 2018 18:47
-
-
Save dipanjanS/a820a598b2d93c2d57e2dd8319936095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for epoch in range(1, 6): | |
loss = 0 | |
for i, elem in enumerate(skip_grams): | |
pair_first_elem = np.array(list(zip(*elem[0]))[0], dtype='int32') | |
pair_second_elem = np.array(list(zip(*elem[0]))[1], dtype='int32') | |
labels = np.array(elem[1], dtype='int32') | |
X = [pair_first_elem, pair_second_elem] | |
Y = labels | |
if i % 10000 == 0: | |
print('Processed {} (skip_first, skip_second, relevance) pairs'.format(i)) | |
loss += model.train_on_batch(X,Y) | |
print('Epoch:', epoch, 'Loss:', loss) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment