|
@@ -91,16 +91,17 @@ class DecagonLayer(Layer): |
|
|
def build(self):
|
|
|
def build(self):
|
|
|
self.next_layer_repr = defaultdict(list)
|
|
|
self.next_layer_repr = defaultdict(list)
|
|
|
|
|
|
|
|
|
for (nt_row, nt_col), rel in self.data.relation_types.items():
|
|
|
|
|
|
conv = SparseDropoutGraphConvActivation(self.input_dim[nt_col],
|
|
|
|
|
|
self.output_dim[nt_row], rel.adjacency_matrix,
|
|
|
|
|
|
self.keep_prob, self.rel_activation)
|
|
|
|
|
|
self.next_layer_repr[nt_row].append((conv, nt_col))
|
|
|
|
|
|
|
|
|
|
|
|
conv = SparseDropoutGraphConvActivation(self.input_dim[nt_row],
|
|
|
|
|
|
self.output_dim[nt_col], rel.adjacency_matrix.transpose(0, 1),
|
|
|
|
|
|
self.keep_prob, self.rel_activation)
|
|
|
|
|
|
self.next_layer_repr[nt_col].append((conv, nt_row))
|
|
|
|
|
|
|
|
|
for (nt_row, nt_col), relation_types in self.data.relation_types.items():
|
|
|
|
|
|
for rel in relation_types:
|
|
|
|
|
|
conv = SparseDropoutGraphConvActivation(self.input_dim[nt_col],
|
|
|
|
|
|
self.output_dim[nt_row], rel.adjacency_matrix,
|
|
|
|
|
|
self.keep_prob, self.rel_activation)
|
|
|
|
|
|
self.next_layer_repr[nt_row].append((conv, nt_col))
|
|
|
|
|
|
|
|
|
|
|
|
conv = SparseDropoutGraphConvActivation(self.input_dim[nt_row],
|
|
|
|
|
|
self.output_dim[nt_col], rel.adjacency_matrix.transpose(0, 1),
|
|
|
|
|
|
self.keep_prob, self.rel_activation)
|
|
|
|
|
|
self.next_layer_repr[nt_col].append((conv, nt_row))
|
|
|
|
|
|
|
|
|
def __call__(self):
|
|
|
def __call__(self):
|
|
|
prev_layer_repr = self.previous_layer()
|
|
|
prev_layer_repr = self.previous_layer()
|
|
|