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

Implement Weights & Biases logger #182

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open

Implement Weights & Biases logger #182

wants to merge 34 commits into from

Conversation

AngelFP
Copy link
Member

@AngelFP AngelFP commented Feb 27, 2024

This PR implements a new WandBLogger class that can be added to and Exploration to track the evolution of all parameters, objectives and other analyzed parameters to Weights & Biases (https://wandb.ai).

Changes

  • Implemented new base Logger class, and WandBLogger.
  • Add logger argument to Exploration.
  • Add a new data property to Trial, which returns a dict with all parameters and values.
  • When running with threading, do not force the generator to be updated with the one from persis_info. This is only needed when running with multiprocessing, as a workaround to not being able to pass the gen to libE by reference.
  • When not running with threading, remove logger from generator before passing it back to the manager. This prevents a RuntimeError. Since this only needs to be done when sending back, a new _prepare_to_send_back method has been added to the gen.
  • Add the new class to the API reference.
  • Create new user guide entry about how to log to W&B.
  • Added test that will log to W&B (currently, to my user account).

See example:
image

AngelFP and others added 25 commits February 23, 2024 16:49
Other changes:
- Include `comms` in `persis_info` to detect if gen ir running o a thread.
- Update generator after calling `libE` only if not running with `threads`.
It is not needed to do it in that case, because the memory is shared.
- Fix bug in `attach_evaluations` when the fields in the data contain arrays.
- Add `completed_trials` property to `Generator`.
- Log trials in `Generator`.
- Do not run `_prepare_to_send` when the generator runs on a thread.
- Implement `_prepare_to_send_back`, which clears the logger before sending back the generator to the manager.
@AngelFP AngelFP changed the title [WIP] Implement Weights & Biases logger Implement Weights & Biases logger Mar 8, 2024
@AngelFP AngelFP added the enhancement New feature or request label Mar 8, 2024
@shuds13
Copy link
Collaborator

shuds13 commented May 30, 2024

I have run this on a standalone system and it worked fine. On my laptop it causes a my laptop to crash, but that may be a general issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants