code: def forward(self, state: rlt.FeatureData):
      q_values = self.q_network(state)
      imitator_outputs = self.imitator_network(state.float_features)
      imitator_probs = torch.nn.functional.softmax(
          imitator_outputs, dim=1
      )
      filter_values = (
          imitator_probs / imitator_probs.max(keepdim=True, dim=1)[0]
      )
      invalid_actions = (
          filter_values < self.bcq_drop_threshold
      ).float()
      invalid_action_penalty = (
          self.invalid_action_penalty * invalid_actions
      )
      constrained_q_values = q_values + invalid_action_penalty
      return constrained_q_values
  
file_path: ReAgent/reagent/models/bcq.py
imports: import torch
  from reagent.core import types
  from reagent.models.base import ModelBase
label_desc: Use image node_id 3 for calling the BatchConstrainedDQN obj's underlying member method code with example usage: obj.forward(state) and returns: constrained_q_values