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

Qlib RL framework (stage 2) - trainer #1125

Merged
merged 34 commits into from
Jun 28, 2022
Merged

Conversation

ultmaster
Copy link
Collaborator

Description

This PR introduces a trainer implementation that is used to train a policy in Qlib RL framework.

This includes the following components:

  1. TrainingVessel: a bundle containing all elements, logic in the training.
  2. Trainer: implements a loop to drive the vessel.

The designs mimicks pytorch-lightning. The key difference is that it's tailored for RL paradigm, in which data comes from online collects.

The trainer relies on the full implementation of logger to be 100% powered. The logger will be refactored and implemented in the next stage.

Motivation and Context

It's an immediate follow-up of #1076.

How Has This Been Tested?

  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py under upper directory of qlib.
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate):

  1. Pipeline test:
  2. Your own tests:

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

qlib/rl/trainer/trainer.py Show resolved Hide resolved
qlib/rl/trainer/vessel.py Outdated Show resolved Hide resolved
qlib/rl/trainer/trainer.py Outdated Show resolved Hide resolved
qlib/rl/trainer/trainer.py Show resolved Hide resolved
qlib/rl/order_execution/reward.py Show resolved Hide resolved
qlib/rl/trainer/callbacks.py Show resolved Hide resolved
qlib/rl/trainer/callbacks.py Outdated Show resolved Hide resolved
@you-n-g
Copy link
Collaborator

you-n-g commented Jun 28, 2022

Please merge main branch to run the new version of CI

@you-n-g
Copy link
Collaborator

you-n-g commented Jun 28, 2022

It looks great now!

@you-n-g you-n-g merged commit 25ecb11 into microsoft:main Jun 28, 2022
@you-n-g you-n-g added the enhancement New feature or request label Dec 9, 2022
qianyun210603 pushed a commit to qianyun210603/qlib that referenced this pull request Mar 23, 2023
* checkpoint

(cherry picked from commit 1a8e0bd)

* Not a workable version

(cherry picked from commit 3498e18)

* vessel

* ckpt

* .

* vessel

* .

* .

* checkpoint callback

* .

* cleanup

* logger

* .

* test

* .

* add test

* .

* .

* .

* .

* New reward

* Add train API

* fix mypy

* fix lint

* More comment

* 3.7 compat

* fix test

* fix test

* .

* Resolve comments

* fix typehint
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.

None yet

2 participants