IR2Vec
Loading...
Searching...
No Matches
OpenKE.data.TrainDataLoader.TrainDataLoader Class Reference
Inheritance diagram for OpenKE.data.TrainDataLoader.TrainDataLoader:
Collaboration diagram for OpenKE.data.TrainDataLoader.TrainDataLoader:

Public Member Functions

 __init__ (self, in_path="./", tri_file=None, ent_file=None, rel_file=None, batch_size=None, nbatches=None, threads=8, sampling_mode="normal", bern_flag=False, filter_flag=True, neg_ent=1, neg_rel=0)
 
 read (self)
 
 sampling (self)
 
 sampling_head (self)
 
 sampling_tail (self)
 
 cross_sampling (self)
 
 set_work_threads (self, work_threads)
 
 set_in_path (self, in_path)
 
 set_nbatches (self, nbatches)
 
 set_batch_size (self, batch_size)
 
 set_ent_neg_rate (self, rate)
 
 set_rel_neg_rate (self, rate)
 
 set_bern_flag (self, bern)
 
 set_filter_flag (self, filter)
 
 get_batch_size (self)
 
 get_ent_tot (self)
 
 get_rel_tot (self)
 
 get_triple_tot (self)
 
 __iter__ (self)
 
 __len__ (self)
 

Public Attributes

 lib = ctypes.cdll.LoadLibrary(base_file)
 
 in_path = in_path
 
str tri_file = tri_file
 
str ent_file = ent_file
 
str rel_file = rel_file
 
 work_threads = threads
 
 nbatches = nbatches
 
 batch_size = batch_size
 
 bern = bern_flag
 
 filter = filter_flag
 
 negative_ent = neg_ent
 
 negative_rel = neg_rel
 
str sampling_mode = sampling_mode
 
int cross_sampling_flag = 0
 
 relTotal = self.lib.getRelationTotal()
 
 entTotal = self.lib.getEntityTotal()
 
 tripleTotal = self.lib.getTrainTotal()
 
 batch_seq_size
 
 batch_h = np.zeros(self.batch_seq_size, dtype=np.int64)
 
 batch_t = np.zeros(self.batch_seq_size, dtype=np.int64)
 
 batch_r = np.zeros(self.batch_seq_size, dtype=np.int64)
 
 batch_y = np.zeros(self.batch_seq_size, dtype=np.float32)
 
 batch_h_addr = self.batch_h.__array_interface__["data"][0]
 
 batch_t_addr = self.batch_t.__array_interface__["data"][0]
 
 batch_r_addr = self.batch_r.__array_interface__["data"][0]
 
 batch_y_addr = self.batch_y.__array_interface__["data"][0]
 
 sampling
 
 cross_sampling
 

Member Data Documentation

◆ batch_seq_size

OpenKE.data.TrainDataLoader.TrainDataLoader.batch_seq_size
Initial value:
= self.batch_size * (
1 + self.negative_ent + self.negative_rel
)

The documentation for this class was generated from the following file: