MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _get_activation_fn

Function _get_activation_fn

detrsmpl/core/post_processing/speed_up/deciwatch.py:706–716  ·  view source on GitHub ↗

Return an activation function given a string.

(activation)

Source from the content-addressed store, hash-verified

704
705
706def _get_activation_fn(activation):
707 """Return an activation function given a string."""
708 if activation == 'relu':
709 return F.relu
710 if activation == 'gelu':
711 return F.gelu
712 if activation == 'glu':
713 return F.glu
714 if activation == 'leaky_relu':
715 return F.leaky_relu
716 raise RuntimeError(F'activation should be relu/gelu, not {activation}.')

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected