Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/evolvegcnh_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def forward(self, x, edge_index, edge_weight):

model.train()

for epoch in range(epochs):
for _ in range(epochs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 66-66 refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

optimizer.zero_grad()
x, edge_index = create_mock_data(node_count, edge_per_node, node_features)
edge_weight = create_mock_edge_weight(edge_index)
Expand Down
2 changes: 1 addition & 1 deletion examples/evolvegcno_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def forward(self, x, edge_index, edge_weight):

model.train()

for epoch in range(epochs):
for _ in range(epochs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 64-64 refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

optimizer.zero_grad()
x, edge_index = create_mock_data(node_count, edge_per_node, node_features)
edge_weight = create_mock_edge_weight(edge_index)
Expand Down
2 changes: 1 addition & 1 deletion examples/gclstm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def forward(self, x, edge_index, edge_weight):

model.train()

for epoch in range(epochs):
for _ in range(epochs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 62-62 refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

optimizer.zero_grad()
x, edge_index = create_mock_data(node_count, edge_per_node, node_features)
edge_weight = create_mock_edge_weight(edge_index)
Expand Down
2 changes: 1 addition & 1 deletion examples/gconvgru_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def forward(self, x, edge_index, edge_weight):

model.train()

for epoch in range(epochs):
for _ in range(epochs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 63-63 refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

optimizer.zero_grad()
x, edge_index = create_mock_data(node_count, edge_per_node, node_features)
edge_weight = create_mock_edge_weight(edge_index)
Expand Down
2 changes: 1 addition & 1 deletion examples/gconvlstm_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def forward(self, x, edge_index, edge_weight):

model.train()

for epoch in range(epochs):
for _ in range(epochs):
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 62-62 refactored with the following changes:

  • Replace unused for index with underscore (for-index-underscore)

optimizer.zero_grad()
x, edge_index = create_mock_data(node_count, edge_per_node, node_features)
edge_weight = create_mock_edge_weight(edge_index)
Expand Down
3 changes: 1 addition & 2 deletions torch_geometric_temporal/nn/recurrent/evolvegcno.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ def forward(self, X: torch.FloatTensor, edge_index: torch.LongTensor,
W = self.conv_layer.weight[None, :, :]
W, _ = self.recurrent_layer(W)
self.conv_layer.weight = torch.nn.Parameter(W.squeeze())
X = self.conv_layer(X, edge_index, edge_weight)
return X
return self.conv_layer(X, edge_index, edge_weight)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function EvolveGCNO.forward refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)

6 changes: 2 additions & 4 deletions torch_geometric_temporal/nn/recurrent/gc_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ def _calculate_cell_state(self, X, edge_index, edge_weight, H, C, I, F):
T = T + self.conv_c(H, edge_index, edge_weight)
T = T + self.b_c
T = torch.tanh(T)
C = F*C + I*T
return C
return F*C + I*T
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GCLSTM._calculate_cell_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)


def _calculate_output_gate(self, X, edge_index, edge_weight, H, C):
O = torch.matmul(X, self.W_o)
Expand All @@ -160,8 +159,7 @@ def _calculate_output_gate(self, X, edge_index, edge_weight, H, C):


def _calculate_hidden_state(self, O, C):
H = O * torch.tanh(C)
return H
return O * torch.tanh(C)
Comment on lines -163 to +162
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GCLSTM._calculate_hidden_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)



def forward(self, X: torch.FloatTensor, edge_index: torch.LongTensor, edge_weight: torch.FloatTensor=None,
Expand Down
3 changes: 1 addition & 2 deletions torch_geometric_temporal/nn/recurrent/gconv_gru.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ def _calculate_candidate_state(self, X, edge_index, edge_weight, H, R):


def _calculate_hidden_state(self, Z, H, H_tilde):
H = Z*H + (1-Z)*H_tilde
return H
return Z*H + (1-Z)*H_tilde
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GConvGRU._calculate_hidden_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)



def forward(self, X: torch.FloatTensor, edge_index: torch.LongTensor,
Expand Down
6 changes: 2 additions & 4 deletions torch_geometric_temporal/nn/recurrent/gconv_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,7 @@ def _calculate_cell_state(self, X, edge_index, edge_weight, H, C, I, F):
T = T + self.conv_h_c(H, edge_index, edge_weight)
T = T + self.b_c
T = torch.tanh(T)
C = F*C + I*T
return C
return F*C + I*T
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GConvLSTM._calculate_cell_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)


def _calculate_output_gate(self, X, edge_index, edge_weight, H, C):
O = self.conv_x_o(X, edge_index, edge_weight)
Expand All @@ -185,8 +184,7 @@ def _calculate_output_gate(self, X, edge_index, edge_weight, H, C):


def _calculate_hidden_state(self, O, C):
H = O * torch.tanh(C)
return H
return O * torch.tanh(C)
Comment on lines -188 to +187
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function GConvLSTM._calculate_hidden_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)



def forward(self, X: torch.FloatTensor, edge_index: torch.LongTensor, edge_weight: torch.FloatTensor=None,
Expand Down
6 changes: 2 additions & 4 deletions torch_geometric_temporal/nn/recurrent/lrgcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ def _calculate_cell_state(self, X, edge_index, edge_type, H, C, I, F):
T = self.conv_x_c(X, edge_index, edge_type)
T = T + self.conv_h_c(H, edge_index, edge_type)
T = torch.tanh(T)
C = F*C + I*T
return C
return F*C + I*T
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LRGCN._calculate_cell_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)



def _calculate_output_gate(self, X, edge_index, edge_type, H, C):
Expand All @@ -127,8 +126,7 @@ def _calculate_output_gate(self, X, edge_index, edge_type, H, C):


def _calculate_hidden_state(self, O, C):
H = O * torch.tanh(C)
return H
return O * torch.tanh(C)
Comment on lines -130 to +129
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LRGCN._calculate_hidden_state refactored with the following changes:

  • Inline variable that is immediately returned (inline-immediately-returned-variable)



def forward(self, X: torch.FloatTensor, edge_index: torch.LongTensor, edge_type: torch.LongTensor,
Expand Down