SelfAdversarialLoss¶
-
class
ampligraph.latent_features.
SelfAdversarialLoss
(eta, hyperparam_dict={'alpha': 0.5, 'margin': 3}, verbose=False)¶ Self adversarial sampling loss.
Introduced in [SDNT19].\[\mathcal{L} = -log \sigma(\gamma - d_r (h,t)) - \sum_{i=1}^{n} p(h_{i}^{'}, r, t_{i}^{'} ) \ log \ \sigma(d_r (h_{i}^{'},t_{i}^{'}) - \gamma)\]where \(\gamma\) is the margin, and \(p(h_{i}^{'}, r, t_{i}^{'} )\) is the sampling proportion
Methods
__init__
(eta[, hyperparam_dict, verbose])Initialize Loss -
__init__
(eta, hyperparam_dict={'alpha': 0.5, 'margin': 3}, verbose=False)¶ Initialize Loss
Parameters: - eta (int) – number of negatives
- hyperparam_dict (dict) –
dictionary of hyperparams.
- margin: float. Margin to be used in adversarial loss computation (default:3)
- alpha : float. Temperature of sampling (default:0.5)
-