From d18ded333efa275340b21faa596ce98188a1d758 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Mon, 29 Apr 2024 14:09:48 +0200 Subject: [PATCH] CriticFactoryReuseActor: Fix the case where we want to reuse an actor's preprocessing network for the critic (must be applied before concatenating the actions) --- tianshou/highlevel/module/critic.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tianshou/highlevel/module/critic.py b/tianshou/highlevel/module/critic.py index f1984e4..4eacef1 100644 --- a/tianshou/highlevel/module/critic.py +++ b/tianshou/highlevel/module/critic.py @@ -197,7 +197,11 @@ class CriticFactoryReuseActor(CriticFactory): last_size=last_size, ).to(device) elif envs.get_type().is_continuous(): - return continuous.Critic(actor.get_preprocess_net(), device=device).to(device) + return continuous.Critic( + actor.get_preprocess_net(), + device=device, + apply_preprocess_net_to_obs_only=True, + ).to(device) else: raise ValueError