|
9 | 9 | from torch import nn
|
10 | 10 |
|
11 | 11 | from ..nbase import ERModel
|
| 12 | +from ...constants import DEFAULT_DROPOUT_HPO_RANGE, DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE |
12 | 13 | from ...nn.message_passing import Decomposition, RGCNRepresentation
|
13 | 14 | from ...nn.modules import Interaction
|
14 | 15 | from ...nn.representation import Representation
|
@@ -62,18 +63,17 @@ class RGCN(
|
62 | 63 | github: https://github.com/MichSchli/RelationPrediction
|
63 | 64 | """
|
64 | 65 |
|
65 |
| - #: The default strategy for optimizing the model"s hyper-parameters |
| 66 | + #: The default strategy for optimizing the model's hyper-parameters |
66 | 67 | hpo_default = dict(
|
67 |
| - embedding_dim=dict(type=int, low=32, high=512, q=32), |
| 68 | + embedding_dim=DEFAULT_EMBEDDING_HPO_EMBEDDING_DIM_RANGE, |
68 | 69 | num_layers=dict(type=int, low=1, high=5, q=1),
|
69 | 70 | use_bias=dict(type="bool"),
|
70 |
| - use_batch_norm=dict(type="bool"), |
71 |
| - activation_cls=dict(type="categorical", choices=[nn.ReLU, nn.LeakyReLU]), |
| 71 | + activation=dict(type="categorical", choices=[nn.ReLU, nn.LeakyReLU]), |
72 | 72 | interaction=dict(type="categorical", choices=["distmult", "complex", "ermlp"]),
|
73 |
| - edge_dropout=dict(type=float, low=0.0, high=0.9), |
74 |
| - self_loop_dropout=dict(type=float, low=0.0, high=0.9), |
| 73 | + edge_dropout=DEFAULT_DROPOUT_HPO_RANGE, |
| 74 | + self_loop_dropout=DEFAULT_DROPOUT_HPO_RANGE, |
75 | 75 | edge_weighting=dict(type="categorical", choices=["inverse_in_degree", "inverse_out_degree", "symmetric"]),
|
76 |
| - decomposition=dict(type="categorical", choices=["bases", "blocks"]), |
| 76 | + decomposition=dict(type="categorical", choices=["bases", "block"]), |
77 | 77 | # TODO: Decomposition kwargs
|
78 | 78 | # num_bases=dict(type=int, low=2, high=100, q=1),
|
79 | 79 | # num_blocks=dict(type=int, low=2, high=20, q=1),
|
|
0 commit comments