Skip to content

Commit

Permalink
Remove dropout at evaluation time on GPI-LS (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasAlegre authored Jan 25, 2024
1 parent 6688e0f commit 9afcb3a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions morl_baselines/multi_policy/gpi_pd/gpi_pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,10 +588,14 @@ def eval(self, obs: np.ndarray, w: np.ndarray) -> int:
"""Select an action for the given obs and weight vector."""
obs = th.as_tensor(obs).float().to(self.device)
w = th.as_tensor(w).float().to(self.device)
for q_net in self.q_nets:
q_net.eval()
if self.use_gpi:
action = self.gpi_action(obs, w, include_w=False)
else:
action = self.max_action(obs, w)
for q_net in self.q_nets:
q_net.train()
return action

def _act(self, obs: th.Tensor, w: th.Tensor) -> int:
Expand Down

0 comments on commit 9afcb3a

Please sign in to comment.