ivanjaenm commited on
Commit
67e2a3e
·
verified ·
1 Parent(s): d02edce

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +86 -0
README.md CHANGED
@@ -73,3 +73,89 @@ configs:
73
  - split: test_ood
74
  path: data/test_ood-*
75
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  - split: test_ood
74
  path: data/test_ood-*
75
  ---
76
+
77
+ # ToR-OT v2 synthetic optimal-transport corpus
78
+
79
+ Discrete Kantorovich instances with exact sparse optimal plans, generated by
80
+ `python -m torot.data.generate` from the ToR-OT code release
81
+ ("Learning Optimal Transport Plans Via Autoregressive Token Regression", NeurIPS 2026).
82
+
83
+ Each record is one instance:
84
+
85
+ | field | description |
86
+ |---|---|
87
+ | `n`, `m` | number of source / target bins |
88
+ | `dim` | support dimension (1 or 2) |
89
+ | `cost_type` | one of `sqeuclidean`, `euclidean`, `canberra`, `sqrt_euclidean`, `cubic_euclidean`, `gaussian` |
90
+ | `coords_src`, `coords_tgt` | bin centres of a regular grid on [0,1]^dim, canonical order (2D: k x k grid, x-major) |
91
+ | `a`, `b` | marginals (float64, sum to 1); for the random splits drawn by the `marginals` sampler of the generation config (`simplex`: uniform on the probability simplex, Dirichlet(1,…,1); `normalized_uniform`: normalised i.i.d. U(0,1) weights) |
92
+ | `plan_rows`, `plan_cols`, `plan_vals` | COO of the optimal plan returned by POT's network simplex (`ot.emd`) |
93
+ | `ot_cost` | optimal cost with the max-normalised cost matrix |
94
+ | `family_src`, `family_tgt` | the marginal sampler (`simplex` or `normalized_uniform`), or the named density for the OOD evaluation split |
95
+ | `seed` | per-instance seed (instances are fully reproducible) |
96
+
97
+ The cost matrix is not stored; it is `torot.data.cost.cost_matrix(coords_src, coords_tgt, cost_type)`.
98
+
99
+ ## Cost types
100
+
101
+ `cost_type` holds the code name; the paper writes the costs as below. L2^p is the Euclidean distance to the power p
102
+ (in 1D, L2 = |x - y|, which on a line also equals L1 and L∞). Each cost matrix is divided by its largest entry.
103
+
104
+ | `cost_type` | paper | c(x, y) |
105
+ |---|---|---|
106
+ | `euclidean` | L2 | ‖x − y‖₂ |
107
+ | `sqrt_euclidean` | L2^(1/2) | ‖x − y‖₂^(1/2) |
108
+ | `sqeuclidean` | L2^2 | ‖x − y‖₂² |
109
+ | `cubic_euclidean` | L2^3 | ‖x − y‖₂³ |
110
+ | `canberra` | Canberra | Σ_d \|x_d − y_d\| / (\|x_d\| + \|y_d\|) |
111
+ | `gaussian` | Gaussian | 1 − exp(−‖x − y‖₂² / 2σ²), σ = 0.2 |
112
+
113
+ ## Splits
114
+
115
+ | split | instances |
116
+ |---|---|
117
+ | `train` | 2000000 |
118
+ | `val` | 2500 |
119
+ | `test_id` | 5000 |
120
+ | `test_extrap` | 5000 |
121
+ | `test_ood` | 588 |
122
+
123
+ ## Generation configuration
124
+
125
+ ```json
126
+ {
127
+ "n_min": 5,
128
+ "n_max": 100,
129
+ "extrap_n_min": 120,
130
+ "extrap_n_max": 200,
131
+ "equal_sizes": true,
132
+ "marginals": "simplex",
133
+ "cost_types": [
134
+ "sqeuclidean",
135
+ "euclidean",
136
+ "canberra",
137
+ "sqrt_euclidean",
138
+ "cubic_euclidean",
139
+ "gaussian"
140
+ ],
141
+ "ood_sizes": [
142
+ 30,
143
+ 100
144
+ ],
145
+ "dim": 2,
146
+ "side_min": 3,
147
+ "side_max": 10,
148
+ "extrap_side_min": 11,
149
+ "extrap_side_max": 14,
150
+ "ood_sides": [
151
+ 6,
152
+ 10
153
+ ]
154
+ }
155
+ ```
156
+
157
+ Command:
158
+
159
+ ```
160
+ python -m torot.data.generate --dim 2 --out_dir ./torot_data_2M_2d --repo_id ivanjaenm/torot_data_2M_2d --push --train 2000000 --val 2500 --test_id 5000 --test_extrap 5000 --seed 2 --workers 8
161
+ ```