IR2Vec
Loading...
Searching...
No Matches
OpenKE.module.loss.MarginLoss.MarginLoss Class Reference
Inheritance diagram for OpenKE.module.loss.MarginLoss.MarginLoss:
Collaboration diagram for OpenKE.module.loss.MarginLoss.MarginLoss:

Public Member Functions

 __init__ (self, adv_temperature=None, margin=6.0)
 
 get_weights (self, n_score)
 
 forward (self, p_score, n_score)
 
 predict (self, p_score, n_score)
 
- Public Member Functions inherited from OpenKE.module.loss.Loss.Loss
- Public Member Functions inherited from OpenKE.module.BaseModule.BaseModule
 load_checkpoint (self, path)
 
 save_checkpoint (self, path)
 
 load_parameters (self, path)
 
 save_parameters (self, path)
 
 get_parameters (self, mode="numpy", param_dict=None)
 
 set_parameters (self, parameters)
 

Public Attributes

 margin = nn.Parameter(torch.Tensor([margin]))
 
 adv_temperature = nn.Parameter(torch.Tensor([adv_temperature]))
 
bool adv_flag = True
 
- Public Attributes inherited from OpenKE.module.BaseModule.BaseModule
 zero_const = nn.Parameter(torch.Tensor([0]))
 
 pi_const = nn.Parameter(torch.Tensor([3.14159265358979323846]))
 

Constructor & Destructor Documentation

◆ __init__()

OpenKE.module.loss.MarginLoss.MarginLoss.__init__ ( self,
adv_temperature = None,
margin = 6.0 )

Reimplemented from OpenKE.module.loss.Loss.Loss.


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