Created
December 1, 2018 11:43
-
-
Save DerekChia/22d755cd30953e8396b42912d2714a10 to your computer and use it in GitHub Desktop.
w2v_training_1
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
# 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