Closed tathagatv closed 2 years ago
The problem may be caused by the gru module. I recommend for changing the gru module (lines 196 and 287) in graphembeddingnetwork.py first. Line 35 in graphembeddingnetwork.py ("def _build_model" in "class GraphEncoder") and configure.py may also need to be changed but I'm not very sure. There may exist other solutions by changing the "node_update_type='gru'" to "mlp" in configure.py.
@Lin-Yijie, changing gru
to mlp
didn't help. I found the following issues in the code which I believe are responsible for the problem:
edge_outputs = self.MLP2(edge_features)
instead of edge_outputs = self.MLP2(node_features)
.self._edge_hidden_sizes[0] + 1
, it should instead be self._edge_output_dim + 2*self._node_state_dim
. We need to additionally define self._edge_output_dim
as the size of edge_outputs
which is generated by GraphEncoder
. The 2*self._node_state_dim
comes due to line 110 of graphembeddingnetwork.py, where we are appending the node_features
.The model is working fine after these changes.
Thanks~ Could you please pull your recent code graphembeddingnetwork.py to this Repository? Thanks a lot for your help!
I'm trying to use this model with some node and edge features. Lines 229-230 in dataset.py of the _pack_batch function set node and edge feature dimensions as 1. If I increase this size to any number >1, I'm getting runtime errors. The following was obtained on changing the node and feature dimensions to 2, by changing the dimension in lines 229-230 of dataset.py :
RuntimeError: Function AddmmBackward returned an invalid gradient at index 1 - got [1604, 65] but expected shape compatible with [1604, 66]
. Experimenting with some other values for the dimension, I realized that the difference in dimension 1 of these error tensors is equal tofeature_dimension-1
. Can some model changes be suggested in order to allow higher feature dimensions?