Fixed-size shortest path
Public
DecisionFocusedLearningBenchmarks.FixedSizeShortestPath.FixedSizeShortestPathBenchmark
— Typestruct FixedSizeShortestPathBenchmark <: AbstractBenchmark
Benchmark problem for the shortest path problem. In this benchmark, all graphs are acyclic directed grids, all of the same size grid_size
. Features are given at instance level (one dimensional vector of length p
for each graph).
Data is generated using the process described in: https://arxiv.org/abs/2307.13565.
Fields
graph::Graphs.SimpleGraphs.SimpleDiGraph{Int64}
: grid graph instancegrid_size::Tuple{Int64, Int64}
: grid size of graphsp::Int64
: size of feature vectorsdeg::Int64
: degree of formula between features and true weightsν::Float32
: multiplicative noise for true weights sampled between [1-ν, 1+ν], should be between 0 and 1
DecisionFocusedLearningBenchmarks.FixedSizeShortestPath.FixedSizeShortestPathBenchmark
— MethodFixedSizeShortestPathBenchmark(
;
grid_size,
p,
deg,
ν
) -> FixedSizeShortestPathBenchmark
Constructor for FixedSizeShortestPathBenchmark
.
DecisionFocusedLearningBenchmarks.Utils.generate_dataset
— Functiongenerate_dataset(
bench::FixedSizeShortestPathBenchmark;
...
) -> Vector
generate_dataset(
bench::FixedSizeShortestPathBenchmark,
dataset_size::Int64;
seed,
type
) -> Vector
Generate dataset for the shortest path problem.
DecisionFocusedLearningBenchmarks.Utils.generate_maximizer
— Methodgenerate_maximizer(
bench::FixedSizeShortestPathBenchmark;
use_dijkstra
) -> DecisionFocusedLearningBenchmarks.FixedSizeShortestPath.var"#shortest_path_maximizer#8"{DecisionFocusedLearningBenchmarks.FixedSizeShortestPath.var"#shortest_path_maximizer#5#9"{typeof(Graphs.dijkstra_shortest_paths), Vector{Int64}, Vector{Int64}, Int64, Int64, Graphs.SimpleGraphs.SimpleDiGraph{Int64}}}
Outputs a function that computes the longest path on the grid graph, given edge weights θ as input.
maximizer = generate_maximizer(bench)
maximizer(θ)
DecisionFocusedLearningBenchmarks.Utils.generate_statistical_model
— Methodgenerate_statistical_model(
bench::FixedSizeShortestPathBenchmark
) -> Flux.Chain{T} where T<:Tuple{Flux.Dense{typeof(identity), Matrix{Float32}}}
Initialize a linear model for bench
using Flux
.