code: def str2actfunc(act_func):
      
      if act_func == 'sigmoid':
          return tf.nn.sigmoid
  
      elif act_func == 'tanh':
          return tf.nn.tanh
  
      elif act_func == 'relu':
          return tf.nn.relu
docs: Convert activation function name to tf function.