naos-ku commited on
Commit
0045e7c
·
1 Parent(s): 4f9a51a

added ba_two_motifs subset, re-generated all subsets

Browse files
.gitignore CHANGED
@@ -5,4 +5,5 @@
5
  __pycache__/
6
 
7
  # Debugging
8
- fig/*/*.pdf
 
 
5
  __pycache__/
6
 
7
  # Debugging
8
+ fig/*/pos_graphs/*.pdf
9
+ fig/*/neg_graphs/*.pdf
README.md CHANGED
@@ -42,21 +42,31 @@ configs:
42
  path: data/tree_grid/val.jsonl
43
  - split: test
44
  path: data/tree_grid/test.jsonl
 
 
 
 
 
 
 
 
45
  ---
46
 
47
  # MotifQA
48
 
49
  ## Dataset Summary
50
 
51
- MotifQA is a synthetic graph question-answering benchmark focused on detecting the presence of a cetain motif inside small random graphs.
52
  Each example pairs a textual prompt with an answer sentence, a list of nodes highlighted as the motif (when present), and an explicit graph description(nodes and edges).
53
  In this QA dataset, all graphs are homogenous and undirected.
 
54
 
55
  ## Subsets
56
 
57
  - `ba_shapes` (default): Detect a five-node house motif inside Barabási–Albert graphs.
58
  - `tree_cycle`: Detect a 6-node cycle inside random binary trees.
59
  - `tree_grid`: Detect a 3×3 grid motif inside random binary trees.
 
60
 
61
  ## Dataset Structure
62
 
@@ -74,17 +84,23 @@ In this QA dataset, all graphs are homogenous and undirected.
74
 
75
  | Subset | Split | Total | Positive | Negative |
76
  | ---------- | ----- | ----- | -------- | -------- |
77
- | ba_shapes | Train | 1000 | 492 | 508 |
78
- | ba_shapes | Val | 500 | 255 | 245 |
79
- | ba_shapes | Test | 500 | 253 | 247 |
80
- | tree_cycle | Train | 1000 | 497 | 503 |
81
- | tree_cycle | Val | 500 | 246 | 254 |
82
- | tree_cycle | Test | 500 | 257 | 243 |
83
- | tree_grid | Train | 1000 | 489 | 511 |
84
- | tree_grid | Val | 500 | 268 | 232 |
85
- | tree_grid | Test | 500 | 243 | 257 |
86
-
87
- Positive and negative graphs are approximately balanced across splits.
 
 
 
 
 
 
88
 
89
  ### Node Count Distribution
90
 
@@ -96,6 +112,8 @@ Node counts depend on the underlying base generator and motif size:
96
  ![Tree cycle node counts](fig/tree_cycle/node_count_hist.svg)
97
  - `tree_grid` (Prüfer trees + 3×3 grid motif): 8–24 nodes.
98
  ![Tree grid node counts](fig/tree_grid/node_count_hist.svg)
 
 
99
 
100
  Observed frequencies across the full 2,000-example splits for each subset are shown in the per-subset histograms.
101
 
@@ -105,12 +123,12 @@ Observed frequencies across the full 2,000-example splits for each subset are sh
105
 
106
  All examples are synthetically generated using [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/) (2.7.0) primitives:
107
 
108
- - Positive samples start from certain base graphs whose node counts are drawn from a uniform distribution before a motif is injected, yielding final graphs with 8–20 nodes.
109
- - Negative samples use the same process with node counts drawn from `range(MIN_NODES, MAX_NODES + 1)` (default 8–20) and no motif.
110
 
111
  ### Generation Process
112
 
113
- 1. Create positive (`ExplainerDataset`) and negative (`NegativeGraphs`) graph pools.
114
  2. Randomly shuffle node indices via the custom `ShuffleNodes` transform to prevent positional bias.
115
  3. Convert graphs to text QA format:
116
  - Construct the prompt and answer sentence.
 
42
  path: data/tree_grid/val.jsonl
43
  - split: test
44
  path: data/tree_grid/test.jsonl
45
+ - config_name: ba_two_motifs
46
+ data_files:
47
+ - split: train
48
+ path: data/ba_two_motifs/train.jsonl
49
+ - split: validation
50
+ path: data/ba_two_motifs/val.jsonl
51
+ - split: test
52
+ path: data/ba_two_motifs/test.jsonl
53
  ---
54
 
55
  # MotifQA
56
 
57
  ## Dataset Summary
58
 
59
+ MotifQA is a synthetic graph question-answering benchmark focused on detecting graph motifs inside small random graphs.
60
  Each example pairs a textual prompt with an answer sentence, a list of nodes highlighted as the motif (when present), and an explicit graph description(nodes and edges).
61
  In this QA dataset, all graphs are homogenous and undirected.
62
+ Subsets cover both yes/no motif detection and motif-type classification (house vs 5-cycle).
63
 
64
  ## Subsets
65
 
66
  - `ba_shapes` (default): Detect a five-node house motif inside Barabási–Albert graphs.
67
  - `tree_cycle`: Detect a 6-node cycle inside random binary trees.
68
  - `tree_grid`: Detect a 3×3 grid motif inside random binary trees.
69
+ - `ba_two_motifs`: Classify whether a Barabási–Albert graph contains a house motif or a 5-cycle motif (every graph has exactly one of the two).
70
 
71
  ## Dataset Structure
72
 
 
84
 
85
  | Subset | Split | Total | Positive | Negative |
86
  | ---------- | ----- | ----- | -------- | -------- |
87
+ | ba_shapes | Train | 1000 | 511 | 489 |
88
+ | ba_shapes | Val | 500 | 246 | 254 |
89
+ | ba_shapes | Test | 500 | 243 | 257 |
90
+ | tree_cycle | Train | 1000 | 496 | 504 |
91
+ | tree_cycle | Val | 500 | 245 | 255 |
92
+ | tree_cycle | Test | 500 | 259 | 241 |
93
+ | tree_grid | Train | 1000 | 508 | 492 |
94
+ | tree_grid | Val | 500 | 242 | 258 |
95
+ | tree_grid | Test | 500 | 250 | 250 |
96
+
97
+ Detection subsets are approximately balanced across splits. The `ba_two_motifs` subset contains only motif-bearing graphs; label counts are:
98
+
99
+ | Subset | Split | Total | House | Cycle |
100
+ | ------------- | ----- | ----- | ----- | ----- |
101
+ | ba_two_motifs | Train | 1000 | 513 | 487 |
102
+ | ba_two_motifs | Val | 500 | 241 | 259 |
103
+ | ba_two_motifs | Test | 500 | 246 | 254 |
104
 
105
  ### Node Count Distribution
106
 
 
112
  ![Tree cycle node counts](fig/tree_cycle/node_count_hist.svg)
113
  - `tree_grid` (Prüfer trees + 3×3 grid motif): 8–24 nodes.
114
  ![Tree grid node counts](fig/tree_grid/node_count_hist.svg)
115
+ - `ba_two_motifs` (Barabási–Albert; house vs 5-cycle motifs): 8–20 nodes.
116
+ ![BA two motifs node counts](fig/ba_two_motifs/node_count_hist.svg)
117
 
118
  Observed frequencies across the full 2,000-example splits for each subset are shown in the per-subset histograms.
119
 
 
123
 
124
  All examples are synthetically generated using [PyTorch Geometric](https://pytorch-geometric.readthedocs.io/) (2.7.0) primitives:
125
 
126
+ - Detection subsets: positive samples start from certain base graphs whose node counts are drawn from a uniform distribution before a motif is injected, yielding final graphs with 8–20 nodes. Negative samples use the same process with node counts drawn from `range(MIN_NODES, MAX_NODES + 1)` (default 8–20) and no motif.
127
+ - `ba_two_motifs`: both classes contain motifs injected into Barabási–Albert graphs—house motifs vs 5-cycle motifs—with final graphs spanning 8–20 nodes.
128
 
129
  ### Generation Process
130
 
131
+ 1. Create class-specific graph pools (`ExplainerDataset` for motif-bearing graphs and `NegativeGraphs` for motif-free graphs, or two different `ExplainerDataset` instances for `ba_two_motifs`).
132
  2. Randomly shuffle node indices via the custom `ShuffleNodes` transform to prevent positional bias.
133
  3. Convert graphs to text QA format:
134
  - Construct the prompt and answer sentence.
data/ba_shapes/test.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/ba_shapes/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/ba_shapes/val.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/ba_two_motifs/test.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/ba_two_motifs/train.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/ba_two_motifs/val.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/tree_cycle/test.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tree_cycle/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tree_cycle/val.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tree_grid/test.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tree_grid/train.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
data/tree_grid/val.jsonl CHANGED
The diff for this file is too large to render. See raw diff
 
fig/ba_shapes/node_count_hist.svg CHANGED
fig/ba_two_motifs/node_count_hist.svg ADDED
fig/tree_cycle/node_count_hist.svg CHANGED
fig/tree_grid/node_count_hist.svg CHANGED