Skip to content

Commit 805a22b

Browse files
committed
bugfix
1 parent d32b1e8 commit 805a22b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/PortfolioOptimization/PortfolioOptimization.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ function Utils.generate_sample(
9191
bench::PortfolioOptimizationBenchmark, rng::AbstractRNG; type::Type=Float32
9292
)
9393
(; d, p, deg, ν, L, f) = bench
94-
features = randn(rng, type, p, d)
94+
features = randn(rng, type, p)
9595
B = rand(rng, Bernoulli(0.5), d, p)
9696
= (0.05 / type(sqrt(p)) .* B * features .+ 0.1^(1 / deg)) .^ deg
9797
costs =.+ L * f .+ 0.01 * ν * randn(rng, type, d)
9898

9999
maximizer = Utils.generate_maximizer(bench)
100100
solution = maximizer(costs)
101101

102-
return DataSample(; x=features, θ_true=, y_true=solution)
102+
return DataSample(; x=features, θ_true=costs, y_true=solution)
103103
end
104104

105105
"""

src/Utils/policy.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Evaluate the policy on the environment and return the total reward and a dataset
7070
By default, the environment is reset before running the policy.
7171
"""
7272
function evaluate_policy!(
73-
policy, env::AbstractEnvironment, episodes::Int=1; seed=get_seed(env), kwargs...
73+
policy, env::AbstractEnvironment, episodes::Int; seed=get_seed(env), kwargs...
7474
)
7575
reset!(env; reset_rng=true, seed)
7676
total_reward = 0.0

0 commit comments

Comments
 (0)