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

New libe_specs for saving history file #1103

Closed
AngelFP opened this issue Sep 26, 2023 · 2 comments
Closed

New libe_specs for saving history file #1103

AngelFP opened this issue Sep 26, 2023 · 2 comments
Assignees
Projects

Comments

@AngelFP
Copy link
Contributor

AngelFP commented Sep 26, 2023

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.

@jlnav jlnav self-assigned this Oct 23, 2023
@jlnav jlnav added this to In progress in libE Kanban Oct 23, 2023
@jlnav
Copy link
Member

jlnav commented Nov 1, 2023

Hey @AngelFP !

We got around to internally discussing the defaults in #1141 . Just noting here we decided the following:

  • save_H_on_completion will be False by default, but if a _save_every_k option is also set, will be flipped on to True.
  • persis_info will also be dumped when save_H_on_completion is set.

@AngelFP
Copy link
Contributor Author

AngelFP commented Nov 1, 2023

Hi @jlnav, thanks for the update. The first one looks like a good default to me. With respect to the second point, I'm not sure. The setting says save_H, so the fact that it also saves persis_info might not be clear to the user. For the particular case of optimas, we don't need the persis_info file, so I would in principle avoid saving it to simplify the output.

Just being a bit nitpicky, it's great to have these options already :D

@shuds13 shuds13 mentioned this issue Nov 2, 2023
6 tasks
@shuds13 shuds13 closed this as completed Nov 9, 2023
@shuds13 shuds13 moved this from In progress to In review/testing in libE Kanban Nov 9, 2023
@shuds13 shuds13 moved this from In review/testing to Done in libE Kanban Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants