class_docstr: Bernoulli distribution, for binary boolean actions (specification key: `bernoulli`).
  
  Args:
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
      action_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
      input_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
class_docstr_tok: ["Bernoulli","distribution",",","for","binary","boolean","actions","(","specification","key",":","`","bernoulli","`",")",".","Args",":","name","(","string",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","action_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","0000C0","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def parametrize(self, *, x, conditions):
      one = tf_util.constant(value=1.0, dtype="float")
      epsilon = tf_util.constant(value=util.epsilon, dtype="float")
      shape = (-1,) + self.action_spec.shape
  
      # Logit
      logit = self.logit.apply(x=x)
      if self.input_spec.rank == 1:
          logit = tf.reshape(tensor=logit, shape=shape)
  
      # States value
      state_value = logit
  
      # Sigmoid for corresponding probability
      probability = tf.sigmoid(x=logit)
  
      # "Normalized" logits
      true_logit = tf.math.log(x=(probability + epsilon))
      false_logit = tf.math.log(x=(one - probability + epsilon))
  
      return TensorDict(
          true_logit=true_logit,
          false_logit=false_logit,
          probability=probability,
          state_value=state_value,
      )
  
file_path: tensorforce/tensorforce/core/distributions/bernoulli.py
imports: import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import layer_modules, TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util
  from tensorforce.core.distributions import Distribution
label_desc: Use image node_id 4 for calling the Bernoulli obj's underlying member method code with example usage: obj.parametrize() and returns: TensorDict