[Feature Request] ProbabilisticActor in a Composite Action Space Environment #2167
Closed
1 task done
Labels
enhancement
New feature or request
Motivation
Using PPO tutorial and #1473 issue as a guide, I created an environment with a composite action space.
I also created a module using
ProbabilisticActor
based on the #1473.However, the values sampled by distribution_class were not written to
action
entries.(In the PPO tutorial and no composite action space version of #1473, which does not use a composite action space, the values are written to action.)
when action space is not composite.
then, I get
action
entries.when action space is composite, in #1473.
then, I don't get
action
entries !Solution
I would like to obtain the following results (The output tensordict contains an
action
entry)Could you provide guidance on how to correctly write the sampled values into the
action
key when usingProbabilisticActor
in a composite action space?Alternatives
A possible symptomatic remedy would be to create a TensorDictModule that moves the
normal
andcateg
keys under theaction
key after using the ProbabilisticActor.Or, Including the
action
key in module output_keys and the distribution_map of ProbabilisticActor solves the problem, but causes inconvenience when using PPOLoss.This may be due to the fact that out_keys is not taken into account when
out_tensors
in theforward
method ofProbabilisticTensorModule
is an instance ofTensorDictBase
.(tensordict/nn/probabilistic.py line 379)
Additional context
I could not determine if this is an issue or a specification, but I decided to post it.
I apologize for my poor English.
Checklist
The text was updated successfully, but these errors were encountered: