xnn.common.models.ops.make_activation#
- xnn.common.models.ops.make_activation(activation)[source]#
Return a fresh activation module from a name or a module instance.
The one activation factory of the model families (the per-element networks of ANI / HDNNP, the voxel convolution networks of the
cnnfamily).- Parameters:
activation (str or torch.nn.Module) – One of
"silu","celu"(ANI, alpha=0.1),"gaussian"(original ANI-1),"tanh","relu","sigmoid","ssp"(the exact shifted softplus of SchNet / PhysNet),"softplus"(Softplus),"scaled_tanh"(ScaledTanh),"square"or"linear"(the identity); or annn.Moduleused as-is.- Returns:
A fresh activation module.
- Return type:
- Raises:
ValueError – If
activationis an unknown name.