MCPcopy Create free account
hub / github.com/Standard-Intelligence/hertz-dev / get_activation

Function get_activation

utils/blocks.py:59–63  ·  view source on GitHub ↗
(nonlinear_activation, nonlinear_activation_params={})

Source from the content-addressed store, hash-verified

57
58
59def get_activation(nonlinear_activation, nonlinear_activation_params={}):
60 if hasattr(nn, nonlinear_activation):
61 return getattr(nn, nonlinear_activation)(**nonlinear_activation_params)
62 else:
63 raise NotImplementedError(f"Activation {nonlinear_activation} not found in torch.nn")
64
65
66def exists(v):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected