class_docstr: Implemetation of skipgram model.
  
  Args:
      config: dict, some configure parameters.
      dataset: instance of Dataset class
      place: GPU or CPU place
class_docstr_tok: ["Implemetation","of","skipgram","model",".","Args",":","config",":","dict",",","some","configure","parameters",".","dataset",":","instance","of","Dataset","class","place",":","GPU","or","CPU","place"]
docstr: Build the skipgram model.
          
docstr_tok: ["Build","the","skipgram","model","."]
code: def forward(self):
      """Build the skipgram model."""
      initrange = 1.0 / self.config["embed_dim"]
      embed_init = fluid.initializer.UniformInitializer(
          low=-initrange, high=initrange
      )
      weight_init = fluid.initializer.TruncatedNormal(
          scale=1.0 / math.sqrt(self.config["embed_dim"])
      )
  
      embed_src = fl.embedding(
          input=self.train_inputs,
          size=[self.num_nodes, self.config["embed_dim"]],
          param_attr=fluid.ParamAttr(
              name="content", initializer=embed_init
          ),
      )
  
      weight_pos = fl.embedding(
          input=self.train_labels,
          size=[self.num_nodes, self.config["embed_dim"]],
          param_attr=fluid.ParamAttr(
              name="weight", initializer=weight_init
          ),
      )
  
      weight_negs = fl.embedding(
          input=self.train_negs,
          size=[self.num_nodes, self.config["embed_dim"]],
          param_attr=fluid.ParamAttr(
              name="weight", initializer=weight_init
          ),
      )
  
      pos_logits = fl.matmul(
          embed_src, weight_pos, transpose_y=True
      )  # [batch_size, 1, 1]
  
      pos_score = fl.squeeze(pos_logits, axes=[1])
      pos_score = fl.clip(pos_score, min=-10, max=10)
      pos_score = -self.neg_num * fl.logsigmoid(pos_score)
  
      neg_logits = fl.matmul(
          embed_src, weight_negs, transpose_y=True
      )  # [batch_size, 1, neg_num]
      neg_score = fl.squeeze(neg_logits, axes=[1])
      neg_score = fl.clip(neg_score, min=-10, max=10)
      neg_score = -1.0 * fl.logsigmoid(-1.0 * neg_score)
      neg_score = fl.reduce_sum(neg_score, dim=1, keep_dim=True)
  
      self.loss = (
          fl.reduce_mean(pos_score + neg_score) / self.neg_num / 2
      )
  
file_path: PGL/legacy/examples/metapath2vec/model.py
imports: import argparse
  import time
  import math
  import os
  import io
  from multiprocessing import Pool
  import logging
  import numpy
  import glob
  import pgl
  from pgl import data_loader
  from pgl.utils import op
  from pgl.utils.logger import log
  import paddle.fluid
  import paddle.fluid.layers
label_desc: Use image node_id 3 for calling the SkipgramModel obj's underlying member method code with example usage: obj.forward() without return types