class_docstr: Policy object that implements a DQN policy, using a feed forward neural network.
  
  :param sess: (TensorFlow session) The current TensorFlow session
  :param ob_space: (Gym Space) The observation space of the environment
  :param ac_space: (Gym Space) The action space of the environment
  :param n_env: (int) The number of environments to run
  :param n_steps: (int) The number of steps to run for each environment
  :param n_batch: (int) The number of batch to run (n_envs * n_steps)
  :param reuse: (bool) If the policy is reusable or not
  :param layers: ([int]) The size of the Neural network for the policy (if None, default to [64, 64])
  :param cnn_extractor: (function (TensorFlow Tensor, ``**kwargs``): (TensorFlow Tensor)) the CNN feature extraction
  :param feature_extraction: (str) The feature extraction type ("cnn" or "mlp")
  :param obs_phs: (TensorFlow Tensor, TensorFlow Tensor) a tuple containing an override for observation placeholder
      and the processed observation placeholder respectively
  :param layer_norm: (bool) enable layer normalisation
  :param dueling: (bool) if true double the output MLP to compute a baseline for action scores
  :param act_fun: (tf.func) the activation function to use in the neural network.
  :param kwargs: (dict) Extra keyword arguments for the nature CNN feature extraction
class_docstr_tok: ["Policy","object","that","implements","a","DQN","policy",",","using","a","feed","forward","neural","network",".",":","param","sess",":","(","TensorFlow","session",")","The","current","TensorFlow","session",":","param","ob_space",":","(","Gym","Space",")","The","observation","space","of","the","environment",":","param","ac_space",":","(","Gym","Space",")","The","action","space","of","the","environment",":","param","n_env",":","(","int",")","The","number","of","environments","to","run",":","param","n_steps",":","(","int",")","The","number","of","steps","to","run","for","each","environment",":","param","n_batch",":","(","int",")","The","number","of","batch","to","run","(","n_envs","*","n_steps",")",":","param","reuse",":","(","bool",")","If","the","policy","is","reusable","or","not",":","param","layers",":","(","[","int","]",")","The","size","of","the","Neural","network","for","the","policy","(","if","None",",","default","to","[","64",",","64","]",")",":","param","cnn_extractor",":","(","function","(","TensorFlow","Tensor",",","``","*","*","kwargs","``",")",":","(","TensorFlow","Tensor",")",")","the","CNN","feature","extraction",":","param","feature_extraction",":","(","str",")","The","feature","extraction","type","(","``","cnn","''","or","``","mlp","''",")",":","param","obs_phs",":","(","TensorFlow","Tensor",",","TensorFlow","Tensor",")","a","tuple","containing","an","override","for","observation","placeholder","and","the","processed","observation","placeholder","respectively",":","param","layer_norm",":","(","bool",")","enable","layer","normalisation",":","param","dueling",":","(","bool",")","if","true","double","the","output","MLP","to","compute","a","baseline","for","action","scores",":","param","act_fun",":","(","tf.func",")","the","activation","function","to","use","in","the","neural","network",".",":","param","kwargs",":","(","dict",")","Extra","keyword","arguments","for","the","nature","CNN","feature","extraction"]
code: def __init__(
      self,
      sess,
      ob_space,
      ac_space,
      n_env,
      n_steps,
      n_batch,
      reuse=False,
      layers=None,
      cnn_extractor=nature_cnn,
      feature_extraction="cnn",
      obs_phs=None,
      layer_norm=False,
      dueling=True,
      act_fun=tf.nn.relu,
      **kwargs,
  ):
      super(FeedForwardPolicy, self).__init__(
          sess,
          ob_space,
          ac_space,
          n_env,
          n_steps,
          n_batch,
          dueling=dueling,
          reuse=reuse,
          scale=(feature_extraction == "cnn"),
          obs_phs=obs_phs,
      )
  
      self._kwargs_check(feature_extraction, kwargs)
  
      if layers is None:
          layers = [64, 64]
  
      with tf.variable_scope("model", reuse=reuse):
          with tf.variable_scope("action_value"):
              if feature_extraction == "cnn":
                  extracted_features = cnn_extractor(
                      self.processed_obs, **kwargs
                  )
                  action_out = extracted_features
              else:
                  extracted_features = tf.layers.flatten(
                      self.processed_obs
                  )
                  action_out = extracted_features
                  for layer_size in layers:
                      action_out = tf_layers.fully_connected(
                          action_out,
                          num_outputs=layer_size,
                          activation_fn=None,
                      )
                      if layer_norm:
                          action_out = tf_layers.layer_norm(
                              action_out, center=True, scale=True
                          )
                      action_out = act_fun(action_out)
  
              action_scores = tf_layers.fully_connected(
                  action_out,
                  num_outputs=self.n_actions,
                  activation_fn=None,
              )
  
          if self.dueling:
              with tf.variable_scope("state_value"):
                  state_out = extracted_features
                  for layer_size in layers:
                      state_out = tf_layers.fully_connected(
                          state_out,
                          num_outputs=layer_size,
                          activation_fn=None,
                      )
                      if layer_norm:
                          state_out = tf_layers.layer_norm(
                              state_out, center=True, scale=True
                          )
                      state_out = act_fun(state_out)
                  state_score = tf_layers.fully_connected(
                      state_out, num_outputs=1, activation_fn=None
                  )
              action_scores_mean = tf.reduce_mean(action_scores, axis=1)
              action_scores_centered = action_scores - tf.expand_dims(
                  action_scores_mean, axis=1
              )
              q_out = state_score + action_scores_centered
          else:
              q_out = action_scores
  
      self.q_values = q_out
      self._setup_init()
  
imports: import tensorflow
  import tensorflow.contrib.layers
  import numpy
  from gym.spaces import Discrete
  from stable_baselines.common.policies import BasePolicy, nature_cnn, register_policy
label_desc: Use image node_id 1 to create a new FeedForwardPolicy object from inherited base classes: DQNPolicy with example: obj = FeedForwardPolicy(sess, ob_space, ac_space, n_env, n_steps, n_batch, reuse, layers, cnn_extractor, feature_extraction, obs_phs, layer_norm, dueling, act_fun)