class_docstr: Negative sampling based skip-gram
class_docstr_tok: ["Negative","sampling","based","skip-gram"]
docstr: Write embedding to local file. For future use.
  
  Parameter
  ---------
  dataset DeepwalkDataset : the dataset
  file_name str : the file name
docstr_tok: ["Write","embedding","to","local","file",".","For","future","use",".","Parameter","--","--","--","--","-","dataset","DeepwalkDataset",":","the","dataset","file_name","str",":","the","file","name"]
code: def save_embedding_txt(self, dataset, file_name):
      """Write embedding to local file. For future use.
  
      Parameter
      ---------
      dataset DeepwalkDataset : the dataset
      file_name str : the file name
      """
      embedding = self.u_embeddings.weight.cpu().data.numpy()
      if self.norm:
          embedding /= np.sqrt(
              np.sum(embedding * embedding, 1)
          ).reshape(-1, 1)
      with open(file_name, "w") as f:
          f.write("%d %d\n" % (self.emb_size, self.emb_dimension))
          for wid in range(self.emb_size):
              e = " ".join(map(lambda x: str(x), embedding[wid]))
              f.write("%s %s\n" % (str(dataset.id2node[wid]), e))
  
imports: import random
  import numpy
  import torch
  import torch.multiprocessing
  import torch.nn
  import torch.nn.functional
  from torch.multiprocessing import Queue
  from torch.nn import init
label_desc: Use image node_id 14 for calling the SkipGramModel obj's underlying member method code with example usage: obj.save_embedding_txt(dataset, file_name) without return types