Skip to content

Commit ab34a16

Browse files
committed
cleanup
1 parent 7b5c4d1 commit ab34a16

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

src/PortfolioOptimization/PortfolioOptimization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Initialize a linear model for `bench` using `Flux`.
120120
"""
121121
function Utils.generate_statistical_model(bench::PortfolioOptimizationBenchmark)
122122
(; p, d) = bench
123-
return Chain(Dense(p, d))
123+
return Dense(p, d)
124124
end
125125

126126
export PortfolioOptimizationBenchmark

test/portfolio_optimization.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
11
@testitem "Portfolio Optimization" begin
22
using DecisionFocusedLearningBenchmarks
3-
using InferOpt
4-
using Flux
5-
using Zygote
63

74
b = PortfolioOptimizationBenchmark()
85

96
dataset = generate_dataset(b, 100)
107
model = generate_statistical_model(b)
118
maximizer = generate_maximizer(b)
12-
13-
# train_dataset, test_dataset = dataset[1:50], dataset[50:100]
14-
# X_train = train_dataset.features
15-
# Y_train = train_dataset.solutions
16-
17-
# perturbed_maximizer = PerturbedAdditive(maximizer; ε=0.1, nb_samples=1)
18-
# loss = FenchelYoungLoss(perturbed_maximizer)
19-
20-
# starting_gap = compute_gap(b, test_dataset, model, maximizer)
21-
22-
# opt_state = Flux.setup(Adam(), model)
23-
# loss_history = Float64[]
24-
# for epoch in 1:50
25-
# val, grads = Flux.withgradient(model) do m
26-
# sum(loss(m(x), y) for (x, y) in zip(X_train, Y_train)) / length(train_dataset)
27-
# end
28-
# Flux.update!(opt_state, model, grads[1])
29-
# push!(loss_history, val)
30-
# end
31-
32-
# final_gap = compute_gap(b, test_dataset, model, maximizer)
33-
34-
# @test loss_history[end] < loss_history[1]
35-
# @test final_gap < starting_gap / 10
369
end

test/subset_selection.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
@testitem "Subset selection" begin
22
using DecisionFocusedLearningBenchmarks
3-
using InferOpt
4-
using Flux
5-
using UnicodePlots
6-
using Zygote
73

84
n = 25
95
k = 5

0 commit comments

Comments
 (0)