Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the constrain_similarities warning in the CI Tests #8144

Closed
Imod7 opened this issue Mar 9, 2021 · 3 comments
Closed

Reduce the constrain_similarities warning in the CI Tests #8144

Imod7 opened this issue Mar 9, 2021 · 3 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.

Comments

@Imod7
Copy link
Contributor

Imod7 commented Mar 9, 2021

Python version: Python 3.6 Python 3.7 Python 3.8

Operating system (windows, osx, ...): Ubuntu Windows

Issue: This Issue is part of the effort to close the Issue#7738 hence to reduce the amount of warnings that are raised when running all tests in the CI. From a first investigation, it seems that this warning ( UserWarning: constrain_similarities is set to False. It is recommended to set it to True... ) for which the current Issue was opened, had 160 occurrences but in a latest CI run it appears in only 76 tests.

Warning (including full traceback):

2021-03-09T05:38:55.1847117Z rasa/utils/train_utils.py:451: 76 tests with warnings 2021-03-09T05:38:55.1848852Z /home/runner/work/rasa/rasa/rasa/utils/train_utils.py:451: UserWarning: constrain_similarities is set to False. It is recommended to set it to True when using cross-entropy loss. It will be set to True by default, Rasa Open Source 3.0.0 onwards.

Possible Solutions:

  • The default value for the constant variable CONSTRAIN_SIMILARITIES is set to False so maybe setting it to True eliminates the warning.
  • However, it needs to be checked what might be affected in other parts of the code or in general functionality from applying this change.

Command or request that led to error:

  • The warning can be found in any of the following CI tests log files :
    • 1_Run Tests (ubuntu-latest, 3.6, test-non-training).txt
    • 3_Run Tests (ubuntu-latest, 3.7, test-non-training).txt
    • 5_Run Tests (ubuntu-latest, 3.8, test-non-training).txt
    • 10_Run Tests (windows-latest, 3.7, test-training).txt
  • Also, the warning can be reproduced when running one of the tests below:

pytest tests/core/policies/test_ted_policy.py::TestTEDPolicyMargin::test_normalization pytest tests/core/policies/test_ted_policy.py::TestTEDPolicyMargin::test_prediction_on_empty_tracker pytest tests/nlu/classifiers/test_diet_classifier.py::test_check_labels_features_exist pytest tests/nlu/test_evaluation.py::test_response_selector_present

Definition of Done:

  • The constrain_similarities warning appears in only the cases where it is explicitly tested for False.
  • In all the cases that the constrain_similarities takes a default value then this should be the recommended one.
@Imod7 Imod7 added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. and removed type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Mar 9, 2021
@Imod7 Imod7 changed the title Eliminate the constrain_similarities warning in the CI Tests Reduce the constrain_similarities warning in the CI Tests Mar 10, 2021
@iurisevero
Copy link
Contributor

iurisevero commented Apr 6, 2021

Exalate commented:

iurisevero commented:

Hey there, I worked a little on this issue and it looks like changing the default value of constrain_similarities to true at TEDPolicy, DietClassifier, and Response Selector fixed it.

All UserWarning: constrain_similarities is set to False. It is recommended to set it to True... warnings have gone and the CI passed, so I don't think it broke anything.

@rgstephens
Copy link
Contributor

rgstephens commented May 14, 2021

Exalate commented:

rgstephens commented:

Under 2.6.1 this warning is being thrown even when constrain_similarities isn't set.

Does this mean the default is set to false?

@Imod7
Copy link
Contributor Author

Imod7 commented May 14, 2021

Exalate commented:

Imod7 commented:

Yes! The default is set to False and for the time being this cannot be changed until Rasa 3.0 because as the research team mentioned this would require also changes in the default loss function.

@rasabot-exalate rasabot-exalate added area:rasa-oss and removed type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. area:rasa-oss 🎡 Anything related to the open source Rasa framework labels Mar 15, 2022 — with Exalate Issue Sync
@m-vdb m-vdb added type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. area:rasa-oss 🎡 Anything related to the open source Rasa framework and removed type:maintenance labels Mar 16, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss :ferris wheel: area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. and removed type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style. area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance labels Mar 17, 2022 — with Exalate Issue Sync
@m-vdb m-vdb closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:maintenance 🔧 Improvements to tooling, testing, deployments, infrastructure, code style.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants