[rllib] Allow Torch policies access to full action input dict in extra_action_out_fn (#4894)

* fix torch extra out

* preserve setitem

* fix docs
This commit is contained in:
Eric Liang
2019-06-01 16:58:49 +08:00
committed by GitHub
parent 1c073e92e4
commit 9aa1cd613d
5 changed files with 34 additions and 13 deletions
+1 -1
View File
@@ -413,7 +413,7 @@ Now, building on the TF examples above, let's look at how the `A3C torch policy
.. code-block:: python
def model_value_predictions(policy, model_out):
def model_value_predictions(policy, input_dict, state_batches, model_out):
return {SampleBatch.VF_PREDS: model_out[2].cpu().numpy()}
``postprocess_fn`` and ``mixins``: Similar to the PPO example, we need access to the value function during postprocessing (i.e., ``add_advantages`` below calls ``policy._value()``. The value function is exposed through a mixin class that defines the method: