Skip to content

Commit 1100ab4

Browse files
committed
fix: turn off progress bars in CI
1 parent 2545c2f commit 1100ab4

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

lib/DataDrivenLux/src/algorithms/reinforce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $(SIGNATURES)
1010
Uses the REINFORCE algorithm to search over the space of possible solutions to the
1111
symbolic regression problem.
1212
"""
13-
function Reinforce(reward = RelativeReward(false); populationsize = 100,
13+
function Reinforce(; reward = RelativeReward(false), populationsize = 100,
1414
functions = (sin, exp, cos, log, +, -, /, *), arities = (1, 1, 1, 1, 2, 2, 2, 2),
1515
n_layers = 1, skip = true, loss = aicc, keep = 0.1, use_protected = true,
1616
distributed = false, threaded = false, rng = Random.default_rng(),

lib/DataDrivenLux/test/candidate.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737
Y = sin.(2.0 * X)
3838
@variables x
3939
@parameters p [bounds = (1.0, 2.5), dist = Normal(1.75, 1.0)]
40-
basis = Basis([sin(p * x)], [x], parameters = [p])
40+
basis = Basis([sin(p * x)], [x], parameters = [p]) # NaNMath.sin causes issues
4141

4242
dataset = Dataset(X, Y)
4343
rng = StableRNG(2)

lib/DataDrivenLux/test/crossentropy_solve.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ alg = CrossEntropy(populationsize = 2_00, functions = (sin, exp, +), arities = (
3939
threaded = true, optim_options = Optim.Options(time_limit = 0.2))
4040

4141
res = solve(dummy_problem, b, alg,
42-
options = DataDrivenCommonOptions(maxiters = 1_000, progress = true, abstol = 0.0))
42+
options = DataDrivenCommonOptions(
43+
maxiters = 1_000, progress = parse(Bool, get(ENV, "CI", "false")), abstol = 0.0))
4344
@test rss(res) <= 1e-2
4445
@test aicc(res) <= -100.0
4546
@test r2(res) >= 0.95

lib/DataDrivenLux/test/randomsearch_solve.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ for (data, _interval) in zip((X, Y, 1:size(X, 2)),
3434
end
3535

3636
# We have 1 Choices in the first layer, 2 in the last
37-
alg = RandomSearch(populationsize = 10, functions = (sin, exp, *),
38-
arities = (1, 1, 2), rng = rng, n_layers = 2, loss = rss, keep = 2)
37+
alg = RandomSearch(;
38+
populationsize = 10, functions = (sin, exp, *), arities = (1, 1, 2), rng,
39+
n_layers = 2, loss = rss, keep = 2)
3940

4041
res = solve(dummy_problem, alg,
41-
options = DataDrivenCommonOptions(maxiters = 50, progress = true, abstol = 0.0))
42+
options = DataDrivenCommonOptions(
43+
maxiters = 50, progress = parse(Bool, get(ENV, "CI", "false")), abstol = 0.0))
4244
@test rss(res) <= 1e-2
4345
@test aicc(res) <= -100.0
4446
@test r2(res) >= 0.95

lib/DataDrivenLux/test/reinforce_solve.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ dummy_dataset = DataDrivenLux.Dataset(dummy_problem)
3434

3535
b = Basis([x; exp.(x)], x)
3636
# We have 1 Choices in the first layer, 2 in the last
37-
alg = Reinforce(
38-
populationsize = 200, functions = (sin, exp, +), arities = (1, 1, 2), rng = rng,
37+
alg = Reinforce(;
38+
populationsize = 200, functions = (sin, exp, +), arities = (1, 1, 2), rng,
3939
n_layers = 3, use_protected = true, loss = bic, keep = 10, threaded = true,
4040
optim_options = Optim.Options(time_limit = 0.2), optimiser = AdamW(1e-2))
4141

4242
res = solve(dummy_problem, b, alg,
43-
options = DataDrivenCommonOptions(maxiters = 1000, progress = true, abstol = 0.0))
43+
options = DataDrivenCommonOptions(
44+
maxiters = 1000, progress = parse(Bool, get(ENV, "CI", "false")), abstol = 0.0))
4445

4546
@test rss(res) <= 1e-2
4647
@test aicc(res) <= -100.0

0 commit comments

Comments
 (0)