# Customise policy to only do forward/backward pass for certain observations

**URL:** <https://discuss.ray.io/t/customise-policy-to-only-do-forward-backward-pass-for-certain-observations/4247>\
**Category:** RLlib\
**Created:** [November 25, 2021, 10:42am UTC](https://discuss.ray.io/t/customise-policy-to-only-do-forward-backward-pass-for-certain-observations/4247 "2021-11-25T10:42:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bmanczak](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/bmanczak/32/1802_2.png) [@bmanczak](https://discuss.ray.io/u/bmanczak)\
**Post date:** [December 9, 2021, 9:11am UTC](https://discuss.ray.io/t/customise-policy-to-only-do-forward-backward-pass-for-certain-observations/4247/3 "2021-12-09T09:11:07Z")

</div>

Hi!

Thanks for the reply.  
That’s what I ended up doing and it works.  
However, as far as I understand, this still requires forward/backward pass, causing an overhead. I tried to solve the issue by customising the `compute_single_action` in the PPO trainer ([post](https://discuss.ray.io/t/controlling-compute-actions-during-training/4260)) but that did not work.

---

_[View the full topic](https://discuss.ray.io/t/customise-policy-to-only-do-forward-backward-pass-for-certain-observations/4247)._
