Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small tweak for Julia 1.12 world age change #128

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions test/test_stochastic/test_stochastic_algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ macro testmh(expression::String, max_depth=6)
return :(
@testset "mh $($expression)" begin
e = Meta.parse("x -> $($expression)")
problem, examples = create_problem(eval(e))
f = eval(e)
problem, examples = create_problem(f)
iterator = MHSearchIterator(grammar, :X, examples, mean_squared_error, max_depth=$max_depth)
solution, flag = synth(problem, iterator, max_time=MAX_RUNNING_TIME)
@test flag == optimal_program
Expand All @@ -30,7 +31,8 @@ macro testsa(expression::String,max_depth=6,init_temp = 2)
return :(
@testset "sa $($expression)" begin
e = Meta.parse("x -> $($expression)")
problem, examples = create_problem(eval(e))
f = eval(e)
problem, examples = create_problem(f)
iterator = SASearchIterator(grammar, :X, examples, mean_squared_error, initial_temperature=$init_temp, max_depth=$max_depth)

solution, flag = synth(problem, iterator, max_time=MAX_RUNNING_TIME)
Expand All @@ -43,7 +45,8 @@ macro testvlsn(expression::String, max_depth = 6, neighbourhood_depth = 2)
return :(
@testset "vl $($expression)" begin
e = Meta.parse("x -> $($expression)")
problem, examples = create_problem(eval(e))
f = eval(e)
problem, examples = create_problem(f)
iterator = VLSNSearchIterator(grammar, :X, examples, mean_squared_error, vlsn_neighbourhood_depth=$neighbourhood_depth, max_depth=$max_depth)

#@TODO overwrite evaluate function within synth to showcase how you may use that
Expand All @@ -68,15 +71,15 @@ end

end
end

@testset verbose = true "Very Large Scale Neighbourhood" begin
@testvlsn "x" 1
@testvlsn "2" 1
@testvlsn "4" 1
@testvlsn "10" 2

end

@testset verbose = true "Simulated Annealing" begin
@testsa "x * x + 4" 3
@testsa "x * (x + 5)" 3 2
Expand Down
Loading