Skip to content

kefirski/pytorch_GloVe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch Global Vectors for Word Representation

Global Vectors for Word Representation implemented in PyTorch.

NEG Loss Equation

Usage

glove = GloVe(co_oc_matrix, embed_size)
    
optimizer = Adagrad(glove.parameters(), 0.05)
    
for i in range(num_iterations):
    ''' 
    input and target are [batch_size] shaped arrays of int type
    '''
    input, target = next_batch(batch_size)
        
    loss = glove(input, target)
    
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()
    
word_embeddings = glove.embeddings()        

Releases

No releases published

Packages

No packages published

Languages