benedekrozemberczki / pytorch_geometric_temporal

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)
MIT License
2.61k stars 367 forks source link

GRU #193

Closed ghost closed 1 year ago

ghost commented 2 years ago

Dear author, your DCRNN model uses GRU in the time dimension, but it seems that during the training process of the model, the Hidden state matrix is ​​0 in each time dimension. The Hidden state matrix of a time dimension is then input into the forward function of the model to implement feature propagation in the time dimension. In other words, your current forward function does not pass in the Hidden state matrix, so is there no feature propagation in the time dimension?

ghost commented 2 years ago

For example, in A3TGCN, should the forward function be written like this if H is None: H = torch.zeros(X.shape[0], X.shape[1]).to(X.device) H_accum = 0 probs = torch.nn.functional.softmax(self._attention, dim=0) for period in range(self.periods): H = self._base_tgcn(X[:, :, period], edge_index, edge_weight, H) H_accum = H_accum + probs[period] * H return H_accum