Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

AML Wrapper for ddm_predictor.py#58

Open
akzaidi wants to merge 14 commits into
mainfrom
alizaidi/aml_wrappers
Open

AML Wrapper for ddm_predictor.py#58
akzaidi wants to merge 14 commits into
mainfrom
alizaidi/aml_wrappers

Conversation

@akzaidi

@akzaidi akzaidi commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

Soundtrack

Description

Updates the ddm_predictor.py script to utilize Ray for training your policy rather than Bonsai.

Usage

  • Run using Ray-on-AML with: python ddm_predictor.py simulator.policy=ray-aml.
  • Run locally with Ray with: python ddm_predictor.py simulator.policy=ray-local.

Fixes # (issue): NA

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@akzaidi
akzaidi requested a review from thisisvergara June 16, 2023 16:30
@akzaidi

akzaidi commented Jun 16, 2023

Copy link
Copy Markdown
Contributor Author

@juanvergaramunoz - I'd like to make one more edit today that will make things a bit easier, which is to convert the DDM repo into a package that we can pip install. That will make things easier for ray-on-aml with installing the ddm scripts and ensures they are in the correct location when running the remote jobs. I still wanted to publish this so you can test this, but perhaps you can focus on the test local path before trying the longer running tests on AML?

@thisisvergara

thisisvergara commented Jul 6, 2023

Copy link
Copy Markdown
Contributor

@akzaidi, did you see the pytest failed? I think we need to setup numpy version to be >=1.16 & <1.20 -- and it seems currently we ask for 1.22.0

On a different note, if you are close to pushing the commit with the change you indicated above, I will hold my review. Otherwise, I will review what is already there.

@thisisvergara

thisisvergara commented Sep 5, 2023

Copy link
Copy Markdown
Contributor

Numpy error identified that causes verbose logging to the point of storage overflow. Adding the object type to the creation of the numpy input data array in L462 (X = np.array(input_array, dtype=object).reshape(1, -1)), removed the following verbose error:

ddm_predictor.py:462: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
   X = np.array(input_array).reshape(1, -1)

Removal of that message causes an output file size reduction of x9. Reducing the original output log file from 12GB to only 1.3GB

Additionally, removal of a print that indicated "No signal builder used" further reduced the output log file by another factor of x3.

thisisvergara and others added 6 commits September 4, 2023 21:52
- modified signal builder log from `print()` to `logger.info()`.
- add `object` type to creation of input data numpy array.
-- this change shrunk output log file size by an order of x9.
- modify script to use ray.tune.tuner instead of the algo object.
-- it will permit easier introduction of checkpoint saving.
- incorporate functionality to keep track of training reward evolution.
- use pretty_print
- add checkpoint functionality.
- define output folder to point to AML output folder.
- update Ray to 2.5 to use latest version of output folder definition.
- add instructions for training your rl agent using ray rllib.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants