docstr: Run filters which where defined for being applied right before using the state for inference.
  
  :param state: The state to run the filters on
  :param update_filter_internal_state: Should update the filter's internal state - should not update when evaluating
  :return: The filtered state
docstr_tok: ["Run","filters","which","where","defined","for","being","applied","right","before","using","the","state","for","inference",".",":","param","state",":","The","state","to","run","the","filters","on",":","param","update_filter_internal_state",":","Should","update","the","filter","'s","internal","state","-","should","not","update","when","evaluating",":","return",":","The","filtered","state"]
code: def run_pre_network_filter_for_inference(
      self, state: StateType, update_filter_internal_state: bool = True
  ) -> StateType:
      """
      Run filters which where defined for being applied right before using the state for inference.
  
      :param state: The state to run the filters on
      :param update_filter_internal_state: Should update the filter's internal state - should not update when evaluating
      :return: The filtered state
      """
      dummy_env_response = EnvResponse(
          next_state=state, reward=0, game_over=False
      )
  
      # TODO actually we only want to run the observation filters. No point in running the reward filters as the
      #  filtered reward is being ignored anyway (and it might unncecessarily affect the reward filters' internal
      #  state).
      return self.pre_network_filter.filter(
          dummy_env_response,
          update_internal_state=update_filter_internal_state,
      )[0].next_state
  
imports: import copy
  import random
  from collections import OrderedDict
  from typing import Dict, List, Union, Tuple
  import numpy
  from six.moves import range
  from rl_coach.agents.agent_interface import AgentInterface
  from rl_coach.architectures.network_wrapper import NetworkWrapper
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, DistributedTaskParameters, Frameworks
  from rl_coach.core_types import RunPhase, PredictionType, EnvironmentEpisodes, ActionType, Batch, Episode, StateType
  from rl_coach.core_types import Transition, ActionInfo, TrainingSteps, EnvironmentSteps, EnvResponse
  from rl_coach.logger import screen, Logger, EpisodeLogger
  from rl_coach.memories.episodic.episodic_experience_replay import EpisodicExperienceReplay
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition, VectorObservationSpace, GoalsSpace, AttentionActionSpace
  from rl_coach.utils import Signal, force_list
  from rl_coach.utils import dynamic_import_and_instantiate_module_from_params
  from rl_coach.memories.backend.memory_impl import get_memory_backend
  from rl_coach.core_types import TimeTypes
  from rl_coach.off_policy_evaluators.ope_manager import OpeManager
  from rl_coach.core_types import PickledReplayBuffer, CsvDataset
label_desc: Use image node_id 29 for calling the Agent obj's underlying member method code with example usage: obj.run_pre_network_filter_for_inference(state, update_filter_internal_state) and returns: self