def get_activation(name):
 try:
  return globals()[name]
 except:
  raise ValueError('Invalid activation function.')

def get_activation ( name ) : try : return globals ( ) [ name ] except : raise ValueError ( 'Invalid activation function.' )
return activation function by name .