def test_confidence_loss_settings(component_config: Dict[Text, Any], raises_exception: bool): component_config[SIMILARITY_TYPE] = INNER if raises_exception: with pytest.raises(InvalidConfigException): train_utils._check_confidence_setting(component_config) else: train_utils._check_confidence_setting(component_config)
def test_confidence_similarity_settings(component_config: Dict[Text, Any], raises_exception: bool): component_config[LOSS_TYPE] = SOFTMAX if raises_exception: with pytest.raises(InvalidConfigException): train_utils._check_confidence_setting(component_config) else: train_utils._check_confidence_setting(component_config)
def test_confidence_renormalization_settings(component_config: Dict[Text, Any], raises_exception: bool): component_config[LOSS_TYPE] = CROSS_ENTROPY if raises_exception: with pytest.raises(InvalidConfigException): train_utils._check_confidence_setting(component_config) else: train_utils._check_confidence_setting(component_config)
def test_warn_deprecated_model_confidences(): component_config = {MODEL_CONFIDENCE: LINEAR_NORM} with pytest.warns(FutureWarning): train_utils._check_confidence_setting(component_config)