Multi-Objective-NAS / self-supervised-nas

Official implementation of the paper "Pretraining Neural Architecture Search Controllers with Locality-based Self-Supervised Learning" (NeurIPSW 2020)
5 stars 0 forks source link

Critical bug in same-class generation #8

Closed juice500ml closed 3 years ago

juice500ml commented 3 years ago

Critical issue! @ainch @Naruu @young917

Problems

Invalid graph 1 | 3 / \ 2 4 This fails, because 1-3-2 is not sorted.


-   - ex) `1-2-3-4`: There is no way to make another sorted path.
- Currently, NAS-Bench-101 only accepts upper triangular matrix, to ensure that the input matrix is DAG.
- Therefore, only using isomorphic graphs are **impossible**!
- We should implement edit-distance=1, 2, 3 cases.
- But, number of nodes may change when we edit the graph.
- We are **not** sure about whether pytorch.nn.LSTM model can accept multiple length sequences in a single batch.
  - ex) Batch 1: `[ seq1, seq2, seq3 ] = [  [1,2,3],  [1,2],  [1]  ]`
  - Limiting number of nodes = 7 is *cheating* btw. We should solve this anyways.
- Training seemed okay previously, because SemiNAS implementation of `convert_arch_to_seq` ignores lower triangle.
  - Embedder (LSTM) was simply getting blank sequences (except ops).
  - https://github.com/Multi-Objective-NAS/SemiNAS/blob/fc8d530c496d92362a3c3f28589261f3d9cf203e/nas_bench/utils.py#L114-L115

## TODOs
- [ ] Check if torch implements multi-length sequences in a single batch
  - Reference. https://pytorch.org/docs/stable/generated/torch.nn.utils.rnn.pack_sequence.html#torch.nn.utils.rnn.pack_sequence
- [x] Implement generating k-edit graphs
- [x] Implement adjacency matrix --> upper triangular adjacency matrix
young917 commented 3 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,

Hope this helps even if I'm wrong...

Naruu commented 3 years ago

https://en.wikipedia.org/wiki/Adjacency_matrix -> ctrl +F "isomorphic"

스크린샷 2020-08-23 오전 11 39 56

original

스크린샷 2020-08-23 오후 12 34 00

permuted graph

스크린샷 2020-08-23 오후 12 34 04

node5 of permuted graph does not have outgoing edge to OUTPUT node

juice500ml commented 3 years ago

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.