Skip to content

Commit

Permalink
reduce number of generations in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mcw92 committed Aug 15, 2024
1 parent 66bc773 commit a0681a8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/test_cmaes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_cmaes_basic(cma_adapter: CMAAdapter, mpi_tmp_path: pathlib.Path) -> Non
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
checkpoint_path=mpi_tmp_path,
)
# Run optimization and print summary of results.
Expand Down
14 changes: 7 additions & 7 deletions tests/test_island.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_islands(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
migration_probability=0.9,
pollination=pollination,
Expand Down Expand Up @@ -109,7 +109,7 @@ def test_checkpointing_isolated(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
migration_probability=0.0,
checkpoint_path=mpi_tmp_path,
Expand All @@ -126,7 +126,7 @@ def test_checkpointing_isolated(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
migration_probability=0.0,
checkpoint_path=mpi_tmp_path,
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_checkpointing(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
migration_probability=0.9,
pollination=pollination,
Expand All @@ -188,7 +188,7 @@ def test_checkpointing(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
migration_probability=0.9,
pollination=pollination,
Expand Down Expand Up @@ -233,7 +233,7 @@ def test_checkpointing_unequal_populations(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
island_sizes=np.array([3, 5]),
migration_probability=0.9,
Expand All @@ -252,7 +252,7 @@ def test_checkpointing_unequal_populations(
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
num_islands=2,
island_sizes=np.array([3, 5]),
migration_probability=0.9,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multi_rank_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_multi_rank_workers(mpi_tmp_path: pathlib.Path) -> None:
loss_fn=parallel_sphere, # Loss function to be minimized
propagator=propagator, # Propagator, i.e., evolutionary operator to be used
rng=rng, # Separate random number generator for Propulate optimization
generations=100, # Overall number of generations
generations=10, # Overall number of generations
num_islands=2, # Number of islands
migration_probability=0.9, # Migration probability
pollination=False, # Whether to use pollination or migration
Expand Down
2 changes: 1 addition & 1 deletion tests/test_nm.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_cmaes(
loss_fn=function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
checkpoint_path=mpi_tmp_path,
)
# Run optimization and print summary of results.
Expand Down
6 changes: 3 additions & 3 deletions tests/test_propulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_propulator(function_name: str, mpi_tmp_path: pathlib.Path) -> None:
loss_fn=benchmark_function,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
checkpoint_path=mpi_tmp_path,
) # Set up propulator performing actual optimization.
propulator.propulate() # Run optimization and print summary of results.
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_propulator_checkpointing(mpi_tmp_path: pathlib.Path) -> None:
propulator = Propulator(
loss_fn=benchmark_function,
propagator=propagator,
generations=100,
generations=10,
checkpoint_path=mpi_tmp_path,
rng=rng,
) # Set up propulator performing actual optimization.
Expand All @@ -107,7 +107,7 @@ def test_propulator_checkpointing(mpi_tmp_path: pathlib.Path) -> None:
propulator = Propulator(
loss_fn=benchmark_function,
propagator=propagator,
generations=20,
generations=5,
checkpoint_path=mpi_tmp_path,
rng=rng,
) # Set up new propulator starting from checkpoint.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pso.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_pso(pso_propagator: Propagator, mpi_tmp_path: pathlib.Path) -> None:
loss_fn=sphere,
propagator=propagator,
rng=rng,
generations=100,
generations=10,
checkpoint_path=mpi_tmp_path,
)

Expand Down

0 comments on commit a0681a8

Please sign in to comment.