Adversarial Decision-Equivalent Training / route_track.py

Failed on benchmark

Raw ⬇ ZIP
 1import numpy as np
 2
 3META = {
 4    "name": "budgeted_route_costs",
 5    "domain": "graph-decision",
 6    "description": "Two-route parallel graph: predict four edge costs from graph features; decisions are shortest route under budgeted edge delays."
 7}
 8
 9
10def get_dataset(seed, n_train, n_test):
11    def make(n, s):
12        rng = np.random.RandomState(s)
13        z = rng.uniform(0.25, 2.0, (n, 3)).astype(np.float32)
14        w, a, b = z.T
15        c = np.stack([
16            0.75*w + 0.30*a + 0.10*np.sin(2*w),
17            0.55*w + 0.25*b + 0.08*np.cos(1.7*w),
18            0.70*w + 0.28*b + 0.12*np.sin(1.3*w + a),
19            0.72*w + 0.30*a + 0.10*np.cos(1.1*w + b)
20        ], 1).astype(np.float32)
21        c += rng.normal(0, 0.035, c.shape).astype(np.float32)
22        return z, np.maximum(c, 0.03)
23    xtr, ytr = make(n_train, seed)
24    xte, yte = make(n_test, seed + 5000)
25    return {"xtr": xtr, "ytr": ytr, "xte": xte, "yte": yte,
26            "task": "regression", "metric": "mse", "out_dim": 4}