RaresBares commited on
Commit
a4149a4
·
verified ·
1 Parent(s): 39bba6e

Add files using upload-large-folder tool

Browse files
Files changed (2) hide show
  1. README.md +0 -1
  2. torch_dataset.py +4 -1
README.md CHANGED
@@ -2,7 +2,6 @@
2
  license: cc-by-4.0
3
  pretty_name: MATSim Zurich GNN surrogate dataset
4
  tags: [transportation, matsim, graph, gnn, traffic-simulation]
5
- size_categories: [1B<n<10B]
6
  ---
7
  # gnn_dataset — MATSim training data for a GNN surrogate (Zurich cutout)
8
 
 
2
  license: cc-by-4.0
3
  pretty_name: MATSim Zurich GNN surrogate dataset
4
  tags: [transportation, matsim, graph, gnn, traffic-simulation]
 
5
  ---
6
  # gnn_dataset — MATSim training data for a GNN surrogate (Zurich cutout)
7
 
torch_dataset.py CHANGED
@@ -57,7 +57,7 @@ class GNNScenarioDataset:
57
  """Indexable dataset; works as a torch.utils.data.Dataset (len/getitem)."""
58
 
59
  def __init__(self, root, ids=None, classes=None, targets="vc_ratio",
60
- car_only=True, baseline_id="base_s0", with_baseline=True,
61
  clip_congestion=50.0, cache=True, as_pyg=True, with_cells=True,
62
  cell_link_max_dist=None):
63
  self.root = root
@@ -90,6 +90,9 @@ class GNNScenarioDataset:
90
  self.classes = dict(zip(man.scenario_id, man["class"]))
91
  if not self.ids:
92
  raise ValueError("no scenarios selected")
 
 
 
93
 
94
  self._build_static()
95
  self._base_y = None
 
57
  """Indexable dataset; works as a torch.utils.data.Dataset (len/getitem)."""
58
 
59
  def __init__(self, root, ids=None, classes=None, targets="vc_ratio",
60
+ car_only=True, baseline_id=None, with_baseline=True,
61
  clip_congestion=50.0, cache=True, as_pyg=True, with_cells=True,
62
  cell_link_max_dist=None):
63
  self.root = root
 
90
  self.classes = dict(zip(man.scenario_id, man["class"]))
91
  if not self.ids:
92
  raise ValueError("no scenarios selected")
93
+ if baseline_id is None: # v1: base_s0, v2: base10_s0 (first class-0 scenario)
94
+ cands = sorted(d for d in os.listdir(self.data_dir) if d.startswith("base"))
95
+ self.baseline_id = "base_s0" if "base_s0" in cands else cands[0]
96
 
97
  self._build_static()
98
  self._base_y = None