espnet2.enh.layers.tcn.check_nonlinear
Less than 1 minute
espnet2.enh.layers.tcn.check_nonlinear
espnet2.enh.layers.tcn.check_nonlinear(nolinear_type)
Check if the specified nonlinear type is supported.
This function validates the given nonlinear type against a set of predefined options. If the type is not supported, a ValueError is raised.
- Parameters:nonlinear_type (str) – The type of nonlinear function to check. It must be one of the following: “softmax”, “relu”.
- Raises:ValueError – If the provided nonlinear_type is not supported.
Examples
>>> check_nonlinear("relu") # No exception raised
>>> check_nonlinear("tanh") # Raises ValueError
ValueError: Unsupported nonlinear type