class_docstr: Actor that acts according to the Q-function.
class_docstr_tok: ["Actor","that","acts","according","to","the","Q-function","."]
code: def act(self, obs):
      with torch.no_grad(), evaluating(self.model):
          action_value = (
              self._evaluate_model_and_update_recurrent_states([obs])
          )
          greedy_action = (
              action_value.greedy_actions.detach().cpu().numpy()[0]
          )
      if self.training:
          action = self.explorer.select_action(
              self.t, lambda: greedy_action, action_value=action_value
          )
          self.last_state = obs
          self.last_action = action
      else:
          action = greedy_action
      return action
  
file_path: pfrl/pfrl/agents/state_q_function_actor.py
imports: from logging import getLogger
  import torch
  from pfrl import agent
  from pfrl.utils import evaluating
  from pfrl.utils.batch_states import batch_states
  from pfrl.utils.recurrent import get_recurrent_state_at, one_step_forward, recurrent_state_as_numpy
label_desc: Use image node_id 5 for calling the StateQFunctionActor obj's underlying member method code with example usage: obj.act(obs) and returns: action