EscherNet / 6DoF /diffusers /models /activations.py
kxhit
update
5f093a6
raw
history blame
297 Bytes
from torch import nn
def get_activation(act_fn):
if act_fn in ["swish", "silu"]:
return nn.SiLU()
elif act_fn == "mish":
return nn.Mish()
elif act_fn == "gelu":
return nn.GELU()
else:
raise ValueError(f"Unsupported activation function: {act_fn}")