Skip to content

Conversation

@vmoens
Copy link
Collaborator

@vmoens vmoens commented Dec 15, 2022

Description

Some cosmetic improvements to GAE, TDL and TD.
Gathers the in_keys and out_keys automatically, and allows to use the modules without tensordict.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 15, 2022
@vmoens vmoens added the enhancement New feature or request label Dec 15, 2022
# Conflicts:
#	test/test_cost.py
#	torchrl/objectives/value/advantages.py
The module supports non-tensordict (i.e. unpacked tensordict) inputs too:
Examples:
>>> value_net = SafeModule(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @tcbegley this is something a bit more interesting than TensorDictModule
This module is a regular nn.Module that reads from a tensordict.
You may have a some crazy combination of keys that your value network needs to read, but you'd still be able to use regular tensors with this.

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #746 (fe71960) into main (9d50995) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #746      +/-   ##
==========================================
- Coverage   88.74%   88.74%   -0.01%     
==========================================
  Files         123      123              
  Lines       20786    20810      +24     
==========================================
+ Hits        18447    18468      +21     
- Misses       2339     2342       +3     
Flag Coverage Δ
habitat-gpu 25.17% <21.42%> (-0.02%) ⬇️
linux-brax 29.57% <21.42%> (-0.02%) ⬇️
linux-cpu 85.26% <100.00%> (+0.01%) ⬆️
linux-gpu 86.18% <100.00%> (+<0.01%) ⬆️
linux-jumanji 30.31% <21.42%> (-0.02%) ⬇️
linux-outdeps-gpu 72.02% <100.00%> (+0.03%) ⬆️
linux-stable-cpu 85.12% <100.00%> (+0.01%) ⬆️
linux-stable-gpu 85.82% <100.00%> (+<0.01%) ⬆️
linux_examples-gpu 43.13% <21.42%> (-0.04%) ⬇️
macos-cpu 84.94% <100.00%> (+0.01%) ⬆️
olddeps-gpu 75.91% <100.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
test/test_cost.py 96.28% <100.00%> (+0.01%) ⬆️
torchrl/objectives/value/advantages.py 89.65% <100.00%> (+1.04%) ⬆️
torchrl/envs/vec_env.py 68.61% <0.00%> (-0.51%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vmoens vmoens merged commit 2b18311 into main Dec 15, 2022
@vmoens vmoens deleted the fix_gae2 branch December 15, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants