dim: (int) dimension of embeddings
//embeddings = np.zeros([len(vocab), dim])
limit = np.sqrt(3 / dim)
embeddings = np.random.uniform(-limit, limit, size=(len(vocab), dim))
if not glove_filename:
return embeddings
with open(glove_filename) as f:
After Change
glove_filename: a path to a glove file
dim: (int) dimension of embeddings
embeddings = np.zeros([len(vocab), dim])
//limit = np.sqrt(3 / dim)
//embeddings = np.random.uniform(-limit, limit, size=(len(vocab), dim))
if not glove_filename: