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

feature(pu): add td3_vae algorithm #152

Merged
merged 35 commits into from
Jan 5, 2022
Merged

feature(pu): add td3_vae algorithm #152

merged 35 commits into from
Jan 5, 2022

Conversation

puyuan1996
Copy link
Collaborator

Description

Add the td3_vae algorithm, train the vae encoder-decoder to encode the original continuous action into the latent action space, and test it in env lunarlander-cont.

Related Issue

TODO

Check List

  • merge the latest version source branch/repo, and resolve all the conflicts
  • pass style check
  • pass all the tests

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #152 (11cac8f) into main (118cc67) will decrease coverage by 0.35%.
The diff coverage is 35.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
- Coverage   84.73%   84.37%   -0.36%     
==========================================
  Files         430      436       +6     
  Lines       33019    33619     +600     
==========================================
+ Hits        27979    28367     +388     
- Misses       5040     5252     +212     
Flag Coverage Δ
unittests 84.37% <35.77%> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
ding/policy/il.py 77.77% <ø> (ø)
ding/entry/serial_entry_td3_vae.py 13.00% <13.00%> (ø)
ding/policy/td3_vae.py 13.27% <13.27%> (ø)
ding/model/template/vae.py 93.25% <93.25%> (ø)
ding/entry/__init__.py 100.00% <100.00%> (ø)
ding/model/template/__init__.py 100.00% <100.00%> (ø)
ding/model/template/tests/test_vae.py 100.00% <100.00%> (ø)
ding/policy/__init__.py 100.00% <100.00%> (ø)
ding/policy/command_mode_policy_instance.py 94.18% <100.00%> (+0.13%) ⬆️
ding/utils/type_helper.py 100.00% <100.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 118cc67...11cac8f. Read the comment docs.

ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
ding/worker/collector/sample_serial_collector.py Outdated Show resolved Hide resolved
dizoo/box2d/lunarlander/envs/lunarlander_env.py Outdated Show resolved Hide resolved
dizoo/smac/config/smac_5m6m_masac_config.py Outdated Show resolved Hide resolved
ding/model/template/vae.py Outdated Show resolved Hide resolved
@puyuan1996 puyuan1996 changed the title WIP: feature(pu): add td3_vae algorithm feature(pu): add td3_vae algorithm Dec 30, 2021
@PaParaZz1 PaParaZz1 added this to the Environment Generalization milestone Dec 30, 2021
@PaParaZz1 PaParaZz1 added the algo Add new algorithm or improve old one label Dec 30, 2021
@PaParaZz1 PaParaZz1 merged commit b21b598 into main Jan 5, 2022
@PaParaZz1 PaParaZz1 deleted the dev-td3-vae branch January 5, 2022 06:37
puyuan1996 added a commit to puyuan1996/DI-engine that referenced this pull request Apr 18, 2022
* feature(pu): add td3_vae

* fix(pu): fix log typo

* polish(pu): vae and rl update alternately

* polish(pu):polish td3_vae config

* test(pu): delete noise and change the data for updating vae

* fix(pu): use latent action relabel

* polish(pu):polish td3_vae config

* feature(pu): add lunarlander continuous env(ci skip)

* polish(pu):polish config

* feature(pu): add ddpg lunarlander_cont config

* feature(pu): add noise in original action in collect phase and add representation shift correction

* fix(pu): using decode_with_obs to use the obs_encoding generating from current obs

* feature(pu): representaion shift correction for each transition

* feature(pu): add latent space constraint and tanh operation to sample z in vae

* polish(pu): polish config

* polish(pu): polish as review

* polish(pu):polish td3_vae config

* polish(pu): polish vae structure, use add not concat between the embeddings of obs and action, use tanh after sample z and after the reconstruction_action head

* polish(pu):polish kl weight and prediction weight

* polish(pu):polish td3_vae using the best setting

* style(pu): yapf format

* polish(pu):polish config

* fix(pu): fix bug when collector_env_num>1, the self._traj_buffer is not empty and will leave over the data in random collect phase

* polish(pu): update the current best config

* polish(pu): polish config

* polish(pu):polish as review

* polish(pu):revert unwanted changes

* polish(pu): polish vae obs encoding

* polish(pu): return dict-type result and update comment format in vae

* feature(pu): add save vae_model state_dict

* polish(pu): add test_vae and yapf format

Co-authored-by: niuyazhe <niuyazhe@sensetime.com>
SolenoidWGT pushed a commit to SolenoidWGT/DI-engine that referenced this pull request Aug 22, 2023
* style(internlm): fix lint error

* feat(utils/logger.py): support uniscale logger

* fix(utils/logger.py): fix import circular error

* feat(train.py): support dashboard metric panel and fix ci train config

* fix(ci_scripts/train/slurm_train.sh): fix ci train error

* fix(ci_scripts/train/torchrun.sh): fix ci train error

* fix(ci_scripts/train): restore ci update

* fix(config.json): delete alert webhook

* feat(train.py): optimize func init logger

* feat(config.json): delete config.json

---------

Co-authored-by: 黄婷 <huangting3@CN0014010744M.local>
Co-authored-by: huangting.p <huangting@sensetime.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
algo Add new algorithm or improve old one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants