espnet2.diar.layers.tcn_nomask.check_nonlinear
Less than 1 minute
espnet2.diar.layers.tcn_nomask.check_nonlinear
espnet2.diar.layers.tcn_nomask.check_nonlinear(nolinear_type)
Check if the specified nonlinear type is supported.
This function verifies that the provided nonlinear type is one of the accepted types. If the type is not supported, it raises a ValueError.
- Parameters:nonlinear_type (str) – The type of nonlinear function to check. Accepted values are “softmax” and “relu”.
- Raises:ValueError – If the nonlinear_type is not one of the supported types.
Examples
>>> check_nonlinear("softmax") # No exception raised
>>> check_nonlinear("relu") # No exception raised
>>> check_nonlinear("sigmoid") # Raises ValueError: Unsupported nonlinear type