Closed juice500ml closed 4 years ago
I think torch can implement multi-length sequences in a single batch... I ran https://github.com/snap-stanford/GraphRNN this code before.
In this code,
Data Loader (pytorch) : https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/data.py#L574 Use an adjacency matrix as a sequence of input [row1, row2, row3, ... ]. One row( fixed length ) is an input of rnn model in one time, and the number of rows is the length of seqence.
Before training: https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/train.py#L452 Sort the sequences in a batch in order of the largest length.
Forward in the model: https://github.com/snap-stanford/GraphRNN/blob/1ef475d957414d7c0bf8c778a1d44cb52dd7829b/model.py#L314 Use pack_padded_sequence(sorted multi-length sequences, list of length of sequences)
Hope this helps even if I'm wrong...
https://en.wikipedia.org/wiki/Adjacency_matrix -> ctrl +F "isomorphic"
node5 of permuted graph does not have outgoing edge to OUTPUT node
Critical issues are solved in previous PRs. To avoid staleness & multi-length sequences is not critical now, I'm closing this issue and make another issue with multi-length sequences.
Critical issue! @ainch @Naruu @young917
Problems
Invalid graph 1 | 3 / \ 2 4 This fails, because 1-3-2 is not sorted.