class_docstr: Knowledge Graph dataset class.
docstr: Creates KG dataset object for data loading.
  
  Args:
    data_path: Path to directory containing train/valid/test pickle files
      produced by process.py.
    debug: boolean indicating whether to use debug mode or not. If true, the
      dataset will only contain 1000 examples for debugging.
docstr_tok: ["Creates","KG","dataset","object","for","data","loading",".","Args",":","data_path",":","Path","to","directory","containing","train\/valid\/test","pickle","files","produced","by","process.py",".","debug",":","boolean","indicating","whether","to","use","debug","mode","or","not",".","If","true",",","the","dataset","will","only","contain","1000","examples","for","debugging","."]
code: def __init__(self, data_path, debug):
      """Creates KG dataset object for data loading.
  
      Args:
        data_path: Path to directory containing train/valid/test pickle files
          produced by process.py.
        debug: boolean indicating whether to use debug mode or not. If true, the
          dataset will only contain 1000 examples for debugging.
      """
      self.data_path = data_path
      self.debug = debug
      self.data = {}
      for split in ["train", "test", "valid"]:
          file_path = os.path.join(self.data_path, split + ".pickle")
          with open(file_path, "rb") as in_file:
              self.data[split] = pkl.load(in_file)
      filters_file = open(
          os.path.join(self.data_path, "to_skip.pickle"), "rb"
      )
      self.to_skip = pkl.load(filters_file)
      filters_file.close()
      max_axis = np.max(self.data["train"], axis=0)
      self.n_entities = int(max(max_axis[0], max_axis[2]) + 1)
      self.n_predicates = int(max_axis[1] + 1) * 2
  
file_path: neural-structured-learning/research/kg_hyp_emb/datasets/datasets.py
imports: import os
  import pickle
  import numpy
  import tensorflow
label_desc: Use image node_id 1 to create a new DatasetFn object from inherited base classes: object with example: obj = DatasetFn(data_path, debug)