You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**DecisionFocusedLearningBenchmarks.jl** provides a comprehensive collection of benchmark problems for evaluating decision-focused learning algorithms. The package offers:
35
+
**DecisionFocusedLearningBenchmarks.jl** provides a collection of benchmark problems for evaluating decision-focused learning algorithms. The package offers:
36
36
37
-
-**Standardized benchmark problems** spanning diverse application domains
38
-
-**Common interfaces** for creating datasets, statistical models, and optimization algorithms
39
-
-**Ready-to-use DFL policies**compatible with [InferOpt.jl](https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl) and the whole [JuliaDecisionFocusedLearning](https://github.com/JuliaDecisionFocusedLearning) ecosystem
40
-
-**Evaluation tools** for comparing algorithm performance
37
+
-**Collection of benchmark problems** spanning diverse applications
38
+
-**Common tools** for creating datasets, statistical models, and optimization algorithms
39
+
-**Generic interface**for building custom benchmarks
40
+
-Compatibility with [InferOpt.jl](https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl) and the whole [JuliaDecisionFocusedLearning](https://github.com/JuliaDecisionFocusedLearning) ecosystem
This guide covers everything you need to work with existing benchmarks in DecisionFocusedLearningBenchmarks.jl: generating datasets, assembling DFL pipeline components, applying algorithms, and evaluating results.
4
+
5
+
---
6
+
7
+
## What is a benchmark?
8
+
9
+
A benchmark bundles a problem family (an instance generator, a combinatorial solver, and a statistical model architecture) into a single object. It provides everything needed to run a Decision-Focused Learning experiment out of the box, without having to create each component from scratch.
10
+
Three abstract types cover the main settings:
11
+
-**`AbstractBenchmark`**: static problems (one instance, one decision)
12
+
-**`AbstractStochasticBenchmark{exogenous}`**: stochastic problems (type parameter indicates whether uncertainty is exogenous)
-**`generate_statistical_model`**: returns an untrained neural network that maps input features `x` to cost parameters `θ`.
31
+
-**`generate_maximizer`**: returns a callable `(θ; context...) -> y` that solves the combinatorial problem given cost parameters.
32
+
-**`generate_dataset`**: returns labeled training data as a `Vector{DataSample}`.
33
+
34
+
At inference time these two pieces compose naturally as an end-to-end policy:
35
+
36
+
```julia
37
+
θ =model(sample.x) # predict cost parameters
38
+
y =maximizer(θ; sample.context...) # solve the optimization problem
39
+
```
6
40
7
41
---
8
42
@@ -15,11 +49,10 @@ All data in the package is represented as [`DataSample`](@ref) objects.
15
49
|`x`| any | Input features (fed to the statistical model) |
16
50
|`θ`| any | Intermediate cost parameters |
17
51
|`y`| any | Output decision / solution |
18
-
|`context`|`NamedTuple`| Solver kwargs — spread into `maximizer(θ; sample.context...)`|
19
-
|`extra`|`NamedTuple`| Non-solver data (scenario, reward, step, …) — never passed to the solver |
52
+
|`context`|`NamedTuple`| Solver kwargs spread into `maximizer(θ; sample.context...)`|
53
+
|`extra`|`NamedTuple`| Non-solver data (scenario, reward, step, …), never passed to the solver |
20
54
21
-
Not all fields are populated in every sample. For convenience, named entries inside
22
-
`context` and `extra` can be accessed directly on the sample via property forwarding:
55
+
Not all fields are populated in every sample, depending on the setting. For convenience, named entries inside `context` and `extra` can be accessed directly on the sample via property forwarding:
23
56
24
57
```julia
25
58
sample.instance # looks up :instance in context first, then in extra
@@ -28,12 +61,11 @@ sample.scenario # looks up :scenario in context first, then in extra
28
61
29
62
---
30
63
31
-
## Generating datasets for training
64
+
## Benchmark type specifics
32
65
33
66
### Static benchmarks
34
67
35
-
For static benchmarks (`<:AbstractBenchmark`) the framework already computes the
36
-
ground-truth label `y`:
68
+
For static benchmarks (`<:AbstractBenchmark`), `generate_dataset` may compute a default ground-truth label `y` if the benchmark implements it:
37
69
38
70
```julia
39
71
bench =ArgmaxBenchmark()
@@ -43,15 +75,13 @@ dataset = generate_dataset(bench, 100; seed=0) # Vector{DataSample} with x, y,
43
75
You can override the labels by providing a `target_policy`:
For `AbstractStochasticBenchmark{true}` benchmarks the default call returns
54
-
*unlabeled* samples, each sample carries one scenario in `sample.extra.scenario`:
84
+
For `AbstractStochasticBenchmark{true}` benchmarks the default call returns *unlabeled* samples, each sample carries one scenario in `sample.extra.scenario`:
55
85
56
86
```julia
57
87
bench =StochasticVehicleSchedulingBenchmark()
@@ -85,20 +115,22 @@ Dynamic benchmarks use a two-step workflow:
85
115
```julia
86
116
bench =DynamicVehicleSchedulingBenchmark()
87
117
88
-
# Step 1 — create environments (reusable across experiments)
118
+
# Step 1: create environments (reusable across experiments)
89
119
envs =generate_environments(bench, 10; seed=0)
90
120
91
-
# Step 2 — roll out a policy to collect training trajectories
121
+
# Step 2: roll out a policy to collect training trajectories
92
122
policy =generate_baseline_policies(bench)[1] # e.g. lazy policy
0 commit comments