Skip to content

Instantly share code, notes, and snippets.

@DerekChia
Created December 1, 2018 11:43
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 DerekChia/22d755cd30953e8396b42912d2714a10 to your computer and use it in GitHub Desktop.
Save DerekChia/22d755cd30953e8396b42912d2714a10 to your computer and use it in GitHub Desktop.
w2v_training_1
# Training
w2v.train(training_data)
class word2vec():
def train(self, training_data):
# Initialising weight matrices
# Both s1 and s2 should be randomly initialised but for this demo, we pre-determine the arrays (getW1 and getW2)
# getW1 - shape (9x10) and getW2 - shape (10x9)
self.w1 = np.array(getW1)
self.w2 = np.array(getW2)
# self.w1 = np.random.uniform(-1, 1, (self.v_count, self.n))
# self.w2 = np.random.uniform(-1, 1, (self.n, self.v_count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment