class_docstr: Activation layer (specification key: `activation`).
  
  Args:
      nonlinearity ('crelu' | 'elu' | 'leaky-relu' | 'none' | 'relu' | 'selu' | 'sigmoid' |
          'softmax' | 'softplus' | 'softsign' | 'swish' | 'tanh'): Nonlinearity
          (<span style="color:#C00000"><b>required</b></span>).
      name (string): Layer name
          (<span style="color:#00C000"><b>default</b></span>: internally chosen).
      input_spec (specification): <span style="color:#00C000"><b>internal use</b></span>.
class_docstr_tok: ["Activation","layer","(","specification","key",":","`","activation","`",")",".","Args",":","nonlinearity","(","'crelu","'","|","'elu","'","|","'leaky-relu","'","|","'none","'","|","'relu","'","|","'selu","'","|","'sigmoid","'","|","'softmax","'","|","'softplus","'","|","'softsign","'","|","'swish","'","|","'tanh","'",")",":","Nonlinearity","(","<","span","style=","''","color",":","#","C00000","''",">","<","b",">","required","<","\/b",">","<","\/span",">",")",".","name","(","string",")",":","Layer","name","(","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","default","<","\/b",">","<","\/span",">",":","internally","chosen",")",".","input_spec","(","specification",")",":","<","span","style=","''","color",":","#","00C000","''",">","<","b",">","internal","use","<","\/b",">","<","\/span",">","."]
code: def apply(self, *, x):
      if self.nonlinearity == "crelu":
          x = tf.nn.crelu(features=x)
  
      elif self.nonlinearity == "elu":
          x = tf.nn.elu(features=x)
  
      elif self.nonlinearity == "leaky-relu":
          # TODO: make alpha public argument
          x = tf.nn.leaky_relu(features=x, alpha=0.2)
  
      elif self.nonlinearity == "none":
          pass
  
      elif self.nonlinearity == "relu":
          x = tf.nn.relu(features=x)
  
      elif self.nonlinearity == "selu":
          x = tf.nn.selu(features=x)
  
      elif self.nonlinearity == "sigmoid":
          x = tf.sigmoid(x=x)
  
      elif self.nonlinearity == "softmax":
          x = tf.nn.softmax(logits=x)
  
      elif self.nonlinearity == "softplus":
          x = tf.nn.softplus(features=x)
  
      elif self.nonlinearity == "softsign":
          x = tf.nn.softsign(features=x)
  
      elif self.nonlinearity == "swish":
          # https://arxiv.org/abs/1710.05941
          x = tf.sigmoid(x=x) * x
  
      elif self.nonlinearity == "tanh":
          x = tf.nn.tanh(x=x)
  
      return x
  
imports: import math
  import random
  import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  from tensorforce.core import parameter_modules, TensorSpec, tf_function, tf_util
  from tensorforce.core.layers import Layer, NondeterministicLayer
label_desc: Use image node_id 3 for calling the Activation obj's underlying member method code with example usage: obj.apply() and returns: x