Skip to content

New libe_specs for saving history file #1103

Closed
@AngelFP

Description

@AngelFP

There are a couple of features that would be very useful regarding how the history is saved.

  1. Saving the history file when the run is completed. Currently it is saved every k_sims or k_gens, but the last few iterations are missing if, for example, sim_max is not a multiple of k_sims. This could be implemented by forcing a save on _final_receive_and_kill. Currently, a workaround is to use this function from the tools, but the name of the file follows a different format and leads to always having 2 history files per run (plus a .picke file).
  2. Choose whether the date information should be added to the name of the history file. Having this enabled by default results in many history files being created in optimas when a single exploration is run in several steps or resumed (Allow resuming an exploration and running in substeps optimas-org/optimas#118). This is because the _save_every_k method is not able to delete the old files, which were created in previous calls to libE.
  3. As a "nice to have", it would be convenient to have some control on the name of the history file.

Below is an example of how these options could be controlled by the user.

libe_specs['save_history_on_completion'] = True
libe_specs['save_history_with_date'] = False   # To save as `libE_history_after_sim_{}.npy`
libe_specs['history_file_prefix'] = 'exploration_history'  # Would allow us to customize it to  `exploration_history_after_sim_{}.npy` in optimas.

Let me know what you think.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions