IR2Vec
Loading...
Searching...
No Matches
OpenKE.config.Trainer.Trainer Class Reference
Inheritance diagram for OpenKE.config.Trainer.Trainer:
Collaboration diagram for OpenKE.config.Trainer.Trainer:

Public Member Functions

 __init__ (self, model=None, data_loader=None, train_times=1000, alpha=0.5, use_gpu=False, opt_method="sgd", save_steps=None, checkpoint_dir=None, index_dir=None, analogy_file="analogies.txt")
 
 load_entity_names (self, index_dir)
 
 train_one_step (self, data)
 
 getEntityDict (self, ent_embeddings)
 
 run (self, link_prediction=False, test_dataloader=None, model=None, is_analogy=False, ray=True, freq=10)
 
 set_model (self, model)
 
 to_var (self, x, use_gpu)
 
 set_use_gpu (self, use_gpu)
 
 set_alpha (self, alpha)
 
 set_lr_decay (self, lr_decay)
 
 set_weight_decay (self, weight_decay)
 
 set_opt_method (self, opt_method)
 
 set_train_times (self, train_times)
 
 set_save_steps (self, save_steps, checkpoint_dir=None)
 
 set_checkpoint_dir (self, checkpoint_dir)
 

Public Attributes

int work_threads = 8
 
 train_times = train_times
 
 index_dir = index_dir
 
str opt_method = opt_method
 
 optimizer = None
 
int lr_decay = 0
 
int weight_decay = 0
 
 alpha = alpha
 
 model = model
 
 data_loader = data_loader
 
 use_gpu = use_gpu
 
int save_steps = save_steps
 
 checkpoint_dir = checkpoint_dir
 
 entity_names = self.load_entity_names(index_dir)
 
 analogies = analogy.AnalogyScorer(analogy_file=analogy_file)
 
float optimizer = 0.0
 

Member Function Documentation

◆ getEntityDict()

OpenKE.config.Trainer.Trainer.getEntityDict ( self,
ent_embeddings )
Reads the entity embeddings and returns an dictionary
mapping entity names to their corresponding embeddings.

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