Skip to content

Commit 3499195

Browse files
committed
update documentation
1 parent cc6ae32 commit 3499195

File tree

6 files changed

+370
-64
lines changed

6 files changed

+370
-64
lines changed

README.md

Lines changed: 81 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,84 @@
66
[![Coverage](https://codecov.io/gh/JuliaDecisionFocusedLearning/DecisionFocusedLearningBenchmarks.jl/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JuliaDecisionFocusedLearning/DecisionFocusedLearningBenchmarks.jl)
77
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle)
88

9-
This repository contains a collection of benchmark problems for decision-focused learning algorithms.
10-
It provides a common interface for creating datasets, associated statistical models and combinatorial optimization maximizers for building decision-focused learning pipelines.
11-
They can be used for instance as benchmarks for tools in [InferOpt.jl](https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl), but can be used in any other context as well.
12-
13-
Currently, this package provides the following benchmark problems (many more to come!):
14-
- `SubsetSelectionBenchmark`: a minimalist subset selection problem.
15-
- `FixedSizeShortestPathBenchmark`: shortest path problem with on a graph with fixed size.
16-
- `WarcraftBenchmark`: shortest path problem on image maps
17-
- `PortfolioOptimizationBenchmark`: portfolio optimization problem.
18-
- `StochasticVehicleSchedulingBenchmark`: stochastic vehicle scheduling problem.
19-
20-
See the [documentation](https://JuliaDecisionFocusedLearning.github.io/DecisionFocusedLearningBenchmarks.jl/stable/) for more details.
9+
## What is Decision-Focused Learning?
10+
11+
Decision-focused learning (DFL) is a paradigm that integrates machine learning prediction with combinatorial optimization to make better decisions under uncertainty. Unlike traditional "predict-then-optimize" approaches that optimize prediction accuracy independently of downstream decision quality, DFL directly optimizes end-to-end decision performance.
12+
13+
A typical DFL algorithm involves training a parametrized policy that combines a statistical predictor with an optimization component:
14+
```math
15+
\xrightarrow[\text{Instance}]{x}
16+
\fbox{Statistical model $\varphi_w$}
17+
\xrightarrow[\text{Parameters}]{\theta}
18+
\fbox{CO algorithm $f$}
19+
\xrightarrow[\text{Solution}]{y}
20+
```
21+
22+
Where:
23+
- **Instance** $x$: input data (e.g., features, context)
24+
- **Statistical model** $\varphi_w$: machine learning predictor (e.g., neural network)
25+
- **Parameters** $\theta$: predicted parameters for the optimization problem
26+
- **CO algorithm** $f$: combinatorial optimization solver
27+
- **Solution** $y$: final decision/solution
28+
29+
## Package Overview
30+
31+
**DecisionFocusedLearningBenchmarks.jl** provides a comprehensive collection of benchmark problems for evaluating decision-focused learning algorithms. The package offers:
32+
33+
- **Standardized benchmark problems** spanning diverse application domains
34+
- **Common interfaces** for datasets, statistical models, and optimization components
35+
- **Ready-to-use pipelines** compatible with [InferOpt.jl](https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl) and the whole [JuliaDecisionFocusedLearning](https://github.com/JuliaDecisionFocusedLearning) ecosystem
36+
- **Evaluation tools** for comparing algorithm performance
37+
38+
## Benchmark Categories
39+
40+
The package organizes benchmarks into three main categories based on their problem structure:
41+
42+
### Static Benchmarks (`AbstractBenchmark`)
43+
Single-stage optimization problems with no randomness involved:
44+
- [`ArgmaxBenchmark`](@ref): argmax toy problem
45+
- [`Argmax2DBenchmark`](@ref): 2D argmax toy problem
46+
- [`RankingBenchmark`](@ref): ranking problem
47+
- [`SubsetSelectionBenchmark`](@ref): select optimal subset of items
48+
- [`PortfolioOptimizationBenchmark`](@ref): portfolio optimization problem
49+
- [`FixedSizeShortestPathBenchmark`](@ref): find shortest path on grid graphs with fixed size
50+
- [`WarcraftBenchmark`](@ref): shortest path on image maps
51+
52+
### Stochastic Benchmarks (`AbstractStochasticBenchmark`)
53+
Single-stage problems with random noise affecting the objective:
54+
- [`StochasticVehicleSchedulingBenchmark`](@ref): stochastic vehicle scheduling under delay uncertainty
55+
56+
### Dynamic Benchmarks (`AbstractDynamicBenchmark`)
57+
Multi-stage sequential decision-making problems:
58+
- [`DynamicVehicleSchedulingBenchmark`](@ref): multi-stage vehicle scheduling under customer uncertainty
59+
- [`DynamicAssortmentBenchmark`](@ref): sequential product assortment selection
60+
61+
## Getting Started
62+
63+
In a few lines of code, you can create benchmark instances, generate datasets, initialize learning components, and evaluate performance, using the same syntax across all benchmarks:
64+
65+
```julia
66+
using DecisionFocusedLearningBenchmarks
67+
68+
# Create a benchmark instance for the argmax problem
69+
benchmark = ArgmaxBenchmark()
70+
71+
# Generate training data
72+
dataset = generate_dataset(benchmark, 100)
73+
74+
# Initialize policy components
75+
model = generate_statistical_model(benchmark)
76+
maximizer = generate_maximizer(benchmark)
77+
78+
# Training algorithm you want to use
79+
# ... your training code here ...
80+
81+
# Evaluate performance
82+
gap = compute_gap(benchmark, dataset, model, maximizer)
83+
```
84+
85+
## Related Packages
86+
87+
This package is part of the [JuliaDecisionFocusedLearning](https://github.com/JuliaDecisionFocusedLearning) organization, and built to be compatible with other packages in the ecosystem:
88+
- **[InferOpt.jl](https://github.com/JuliaDecisionFocusedLearning/InferOpt.jl)**: differentiable optimization layers and losses for decision-focused learning
89+
- **[DecisionFocusedLearningAlgorithms.jl](https://github.com/JuliaDecisionFocusedLearning/DecisionFocusedLearningAlgorithms.jl)**: collection of generic black-box implementations of decision-focused learning algorithms

docs/make.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ tutorial_dir = joinpath(@__DIR__, "src", "tutorials")
99
benchmarks_dir = joinpath(@__DIR__, "src", "benchmarks")
1010
api_dir = joinpath(@__DIR__, "src", "api")
1111

12-
api_files = map(x -> joinpath("api", x), readdir(api_dir))
1312
tutorial_files = readdir(tutorial_dir)
1413
md_tutorial_files = [split(file, ".")[1] * ".md" for file in tutorial_files]
1514
benchmark_files = [joinpath("benchmarks", e) for e in readdir(benchmarks_dir)]
1615

17-
include_tutorial = true
16+
include_tutorial = false
1817

1918
if include_tutorial
2019
for file in tutorial_files
@@ -29,10 +28,13 @@ makedocs(;
2928
sitename="DecisionFocusedLearningBenchmarks.jl",
3029
format=Documenter.HTML(; size_threshold=typemax(Int)),
3130
pages=[
32-
"Home" => "index.md",
31+
"Home" => [
32+
"Getting started" => "index.md",
33+
"Understanding Benchmark Interfaces" => "benchmark_interfaces.md",
34+
],
3335
"Tutorials" => include_tutorial ? md_tutorial_files : [],
3436
"Benchmark problems list" => benchmark_files,
35-
"API reference" => "api/api.md",
37+
"API reference" => "api.md",
3638
],
3739
)
3840

docs/src/api/api.md renamed to docs/src/api.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,175 +2,131 @@
22

33
## Interface
44

5-
### Public
6-
75
```@autodocs
86
Modules = [DecisionFocusedLearningBenchmarks.Utils]
97
Private = false
108
```
119

12-
### Private
13-
1410
```@autodocs
1511
Modules = [DecisionFocusedLearningBenchmarks.Utils]
1612
Public = false
1713
```
1814

1915
## Argmax2D
2016

21-
### Public
22-
2317
```@autodocs
2418
Modules = [DecisionFocusedLearningBenchmarks.Argmax2D]
2519
Private = false
2620
```
2721

28-
### Private
29-
3022
```@autodocs
3123
Modules = [DecisionFocusedLearningBenchmarks.Argmax2D]
3224
Public = false
3325
```
3426

3527
## Argmax
3628

37-
### Public
38-
3929
```@autodocs
4030
Modules = [DecisionFocusedLearningBenchmarks.Argmax]
4131
Private = false
4232
```
4333

44-
### Private
45-
4634
```@autodocs
4735
Modules = [DecisionFocusedLearningBenchmarks.Argmax]
4836
Public = false
4937
```
5038

5139
## Dynamic Vehicle Scheduling
5240

53-
### Public
54-
5541
```@autodocs
5642
Modules = [DecisionFocusedLearningBenchmarks.DynamicVehicleScheduling]
5743
Private = false
5844
```
5945

60-
### Private
61-
6246
```@autodocs
6347
Modules = [DecisionFocusedLearningBenchmarks.DynamicVehicleScheduling]
6448
Public = false
6549
```
6650

6751
## Dynamic Assortment
6852

69-
### Public
70-
7153
```@autodocs
7254
Modules = [DecisionFocusedLearningBenchmarks.DynamicAssortment]
7355
Private = false
7456
```
7557

76-
### Private
77-
7858
```@autodocs
7959
Modules = [DecisionFocusedLearningBenchmarks.DynamicAssortment]
8060
Public = false
8161
```
8262

8363
## Fixed-size shortest path
8464

85-
### Public
86-
8765
```@autodocs
8866
Modules = [DecisionFocusedLearningBenchmarks.FixedSizeShortestPath]
8967
Private = false
9068
```
9169

92-
### Private
93-
9470
```@autodocs
9571
Modules = [DecisionFocusedLearningBenchmarks.FixedSizeShortestPath]
9672
Public = false
9773
```
9874

9975
## Portfolio Optimization
10076

101-
### Public
102-
10377
```@autodocs
10478
Modules = [DecisionFocusedLearningBenchmarks.PortfolioOptimization]
10579
Private = false
10680
```
10781

108-
### Private
109-
11082
```@autodocs
11183
Modules = [DecisionFocusedLearningBenchmarks.PortfolioOptimization]
11284
Public = false
11385
```
11486

11587
## Ranking
11688

117-
### Public
118-
11989
```@autodocs
12090
Modules = [DecisionFocusedLearningBenchmarks.Ranking]
12191
Private = false
12292
```
12393

124-
### Private
125-
12694
```@autodocs
12795
Modules = [DecisionFocusedLearningBenchmarks.Ranking]
12896
Public = false
12997
```
13098

13199
## Subset selection
132100

133-
### Public
134-
135101
```@autodocs
136102
Modules = [DecisionFocusedLearningBenchmarks.SubsetSelection]
137103
Private = false
138104
```
139105

140-
### Private
141-
142106
```@autodocs
143107
Modules = [DecisionFocusedLearningBenchmarks.SubsetSelection]
144108
Public = false
145109
```
146110

147111
## Stochastic Vehicle Scheduling
148112

149-
### Public
150-
151113
```@autodocs
152114
Modules = [DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling]
153115
Private = false
154116
```
155117

156-
### Private
157-
158118
```@autodocs
159119
Modules = [DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling]
160120
Public = false
161121
```
162122

163123
## Warcraft
164124

165-
### Public
166-
167125
```@autodocs
168126
Modules = [DecisionFocusedLearningBenchmarks.Warcraft]
169127
Private = false
170128
```
171129

172-
### Private
173-
174130
```@autodocs
175131
Modules = [DecisionFocusedLearningBenchmarks.Warcraft]
176132
Public = false

0 commit comments

Comments
 (0)