skipgram/train.py
def save_embeddings(self, epoch):
    """ Save the embeddings of the model as a dict with the words as keys and
    the embeddings as values. The file should be named
    'epoch_{epoch}', in the 'run_id' folder. """
    folder = f'skipgram/embeddings/{self.run_id}'
    if not os.path.exists(folder):
      os.mkdir(folder)
    if not os.path.exists(f'{folder}/entries.json'):
      json.dump(self.dataset.vocab.entries, open(
        f'{folder}/entries.json', 'w', encoding='utf-8'
      ))
    torch.save(self.model.state_dict(), f'{folder}/epoch_{epoch}.pt')
 Save the embeddings of the model as a dict with the words as keys and
    the embeddings as values. The file should be named
    'epoch_{epoch}', in the 'run_id' folder. 
Save the embeddings of the model as a dict with the words as keys and
the embeddings as values. The file should be named
'epoch_{epoch}', in the 'run_id' folder.
Save the embeddings of the model as a dict with the words as keys and the embeddings as values . The file should be named ' epoch_ { epoch } ' in the ' run_id ' folder .
def save_embeddings(self, epoch):
    folder = f'skipgram/embeddings/{self.run_id}'
    if not os.path.exists(folder):
      os.mkdir(folder)
    if not os.path.exists(f'{folder}/entries.json'):
      json.dump(self.dataset.vocab.entries, open(
        f'{folder}/entries.json', 'w', encoding='utf-8'
      ))
    torch.save(self.model.state_dict(), f'{folder}/epoch_{epoch}.pt')
def save_embeddings ( self , epoch ) : folder = f'skipgram/embeddings/{self.run_id}' if not os . path . exists ( folder ) : os . mkdir ( folder ) if not os . path . exists ( f'{folder}/entries.json' ) : json . dump ( self . dataset . vocab . entries , open ( f'{folder}/entries.json' , 'w' , encoding = 'utf-8' ) ) torch . save ( self . model . state_dict ( ) , f'{folder}/epoch_{epoch}.pt' )
Save the embeddings of the model as a dict with the words as keys and
the embeddings as values.
Save the embeddings of the model as a dict with the words as keys and the embeddings as values .
""" Save the embeddings of the model as a dict with the words as keys and
    the embeddings as values. The file should be named
    'epoch_{epoch}', in the 'run_id' folder. """
self
epoch