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

fix(psharold): unsqueeze action_args in PDQN when shape is 1 #599

Merged
merged 2 commits into from
Mar 2, 2023

Conversation

PSHarold
Copy link
Contributor

@PSHarold PSHarold commented Mar 2, 2023

Description

When action_args_shape is 1, the code below throws an exception. Here, action_args should be of size (B, 1), not (B, ).
image
image
image
image
image

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 Mar 2, 2023

Codecov Report

Merging #599 (9ed0a23) into main (1e6f503) will decrease coverage by 0.23%.
The diff coverage is 97.50%.

@@            Coverage Diff             @@
##             main     #599      +/-   ##
==========================================
- Coverage   83.53%   83.31%   -0.23%     
==========================================
  Files         564      564              
  Lines       46201    46154      -47     
==========================================
- Hits        38596    38454     -142     
- Misses       7605     7700      +95     
Flag Coverage Δ
unittests 83.31% <97.50%> (-0.23%) ⬇️

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

Impacted Files Coverage Δ
ding/torch_utils/__init__.py 100.00% <ø> (ø)
ding/torch_utils/data_helper.py 78.29% <92.85%> (+0.83%) ⬆️
ding/model/template/pdqn.py 92.53% <100.00%> (+0.22%) ⬆️
ding/model/template/tests/test_pdqn.py 78.72% <100.00%> (+1.45%) ⬆️
ding/torch_utils/tests/test_data_helper.py 77.96% <100.00%> (+2.35%) ⬆️
...r/collector/battle_interaction_serial_evaluator.py 93.79% <100.00%> (+0.04%) ⬆️
...g/worker/collector/interaction_serial_evaluator.py 81.57% <100.00%> (+0.12%) ⬆️
ding/framework/message_queue/tests/test_nng.py 42.30% <0.00%> (-57.70%) ⬇️
ding/worker/collector/marine_parallel_collector.py 69.90% <0.00%> (-19.96%) ⬇️
ding/model/template/atoc.py 86.31% <0.00%> (-8.95%) ⬇️
... and 64 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

else:
for i, s in enumerate(act_shape):
assert dis_outputs['logit'][i].shape == (B, s)
for action_args_shape in (1, 5):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please modify multi-argument unittest like this demo

@PaParaZz1
Copy link
Member

Thanks for your contribution. BTW, please modify the name of this PR like other pull requests.

@PaParaZz1 PaParaZz1 added bug Something isn't working algo Add new algorithm or improve old one labels Mar 2, 2023
@PSHarold PSHarold changed the title Fix: unsqueeze action_args in PDQN when shape is 1 fix(psharold): unsqueeze action_args in PDQN when shape is 1 Mar 2, 2023
@PaParaZz1 PaParaZz1 merged commit 8c33420 into opendilab:main Mar 2, 2023
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 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants