|
| __init__ (self, ent_tot, rel_tot, dim=100, p_norm=1, norm_flag=True, margin=None, epsilon=None) |
|
| forward (self, data) |
|
| regularization (self, data) |
|
| predict (self, data) |
|
| 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) |
|
|
| dim = dim |
|
| margin = margin |
|
| epsilon = epsilon |
|
| norm_flag = norm_flag |
|
| p_norm = p_norm |
|
| ent_embeddings = nn.Embedding(self.ent_tot, self.dim) |
|
| rel_embeddings = nn.Embedding(self.rel_tot, self.dim) |
|
| embedding_range |
|
bool | margin = False |
|
bool | margin_flag = True |
|
| ent_tot = ent_tot |
|
| rel_tot = rel_tot |
|
| zero_const = nn.Parameter(torch.Tensor([0])) |
|
| pi_const = nn.Parameter(torch.Tensor([3.14159265358979323846])) |
|
|
| _calc (self, h, t, r, mode) |
|
◆ __init__()
OpenKE.module.model.TransE.TransE.__init__ |
( |
| self, |
|
|
| ent_tot, |
|
|
| rel_tot, |
|
|
| dim = 100, |
|
|
| p_norm = 1, |
|
|
| norm_flag = True, |
|
|
| margin = None, |
|
|
| epsilon = None ) |
◆ forward()
OpenKE.module.model.TransE.TransE.forward |
( |
| self, |
|
|
| data ) |
◆ predict()
OpenKE.module.model.TransE.TransE.predict |
( |
| self, |
|
|
| data ) |
◆ embedding_range
OpenKE.module.model.TransE.TransE.embedding_range |
Initial value:= nn.Parameter(
torch.Tensor([(self.margin + self.epsilon) / self.dim]),
requires_grad=False,
)
The documentation for this class was generated from the following file:
- seed_embeddings/OpenKE/module/model/TransE.py