optimas-org / optimas

Optimization at scale, powered by libEnsemble
https://optimas.readthedocs.io
Other
22 stars 13 forks source link

Allow resuming an exploration and running in substeps #118

Closed AngelFP closed 11 months ago

AngelFP commented 11 months ago

This PR enables two new workflows addressing #107:

  1. Running an exploration in substeps:
# Create exploration.
exploration = Exploration(
    generator=gen,
    evaluator=ev,
    max_evals=30,
    sim_workers=2
)

# Run exploration in several steps until reaching 30 evaluations.
exploration.run(n_evals=3)
exploration.run(n_evals=4)
exploration.run(n_evals=10)
exploration.run(n_evals=5)
exploration.run()  # Run remaining evaluations.

This can be useful when running optimas interactively. It would allow the user, for example, to tune the hyperparameters of the generator between each run.

  1. Resuming from a previous exploration that was executed in the same exploration_dir_path.
# Create exploration.
exploration = Exploration(
    generator=gen,
    evaluator=ev,
    max_evals=40,
    sim_workers=2,
    resume=True
)

# Run exploration until the total number of evaluations
# (including those of the previous run) reaches 40.
exploration.run()

This allows us to seamlessly continue a previous exploration

This features are enabled by the new 'reuse_output_dir' and 'final_gen_send' options in libensemble v1.0.0.

Changes