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

Fix epoch override for TEDPolicy #9182

Merged
merged 9 commits into from
Jul 22, 2021
Merged

Fix epoch override for TEDPolicy #9182

merged 9 commits into from
Jul 22, 2021

Conversation

dakshvar22
Copy link
Contributor

@dakshvar22 dakshvar22 commented Jul 21, 2021

Proposed changes:

  • Fixes a bug where epoch_override was being used even when policy was being loaded in non-finetune mode. Because of this wrong warnings get generated which confuse users.

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@dakshvar22 dakshvar22 requested review from a team, aeshky and ka-bu and removed request for a team and aeshky July 21, 2021 09:44
@dakshvar22 dakshvar22 linked an issue Jul 21, 2021 that may be closed by this pull request
2 tasks
Copy link
Contributor

@ka-bu ka-bu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me - just some minor suggestions on the tests

tests/core/policies/test_ted_policy.py Outdated Show resolved Hide resolved
20,
TEDPolicy.defaults[EPOCHS],
), # trained_policy uses default epochs during training
(False, TEDPolicy.defaults[EPOCHS], TEDPolicy.defaults[EPOCHS]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(False, TEDPolicy.defaults[EPOCHS], TEDPolicy.defaults[EPOCHS]),
(True, TEDPolicy.defaults[EPOCHS]+1, TEDPolicy.defaults[EPOCHS]+1),

And why are the first two cases with "True" and 2/1 special?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to have a test case with the default value of epoch_override in the load function, i.e. 1. I've now changed it to TEDPolicy.defaults[EPOCHS].
2 was just an arbitrary number other than the default but I've now changed it to TEDPolicy.defaults[EPOCHS] + 1

Do you think the extra test case with the default value of the function is unnecessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I think we could remove: (False, TEDPolicy.defaults[EPOCHS], TEDPolicy.defaults[EPOCHS],), because I'm not sure what this would test and because (False, TEDPolicy.defaults[EPOCHS]+1, TEDPolicy.defaults[EPOCHS],), already tests that the override value is ignored.
  • And I think we could remove (True, TEDPolicy.defaults[EPOCHS], TEDPolicy.defaults[EPOCHS]), because it would just test that the epoch is overwritten with the (identical) epoch_overwrite value (so it would also pass if the function did not override anything :D) while (True, TEDPolicy.defaults[EPOCHS] + 1, TEDPolicy.defaults[EPOCHS] + 1), tests exactly that, no?
  • Regarding the default values, I think that the above should suffice as test (we can't test all n \in N here and 1/2 are/should be no special cases really regarding the overwrite), no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've convinced me. Removed 👍

@dakshvar22 dakshvar22 requested a review from ka-bu July 22, 2021 08:01
@dakshvar22 dakshvar22 enabled auto-merge (squash) July 22, 2021 09:38
@dakshvar22 dakshvar22 merged commit 0101319 into 2.8.x Jul 22, 2021
@dakshvar22 dakshvar22 deleted the fix_epoch_override branch July 22, 2021 09:55
aeshky added a commit that referenced this pull request Aug 6, 2021
* Add ability to point to a certificate in endpoints.yml (#9118)

* Add cert file functionality to Endpoint

* Apply suggestions from code review

types

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* update changelog

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* Fix epoch override for TEDPolicy (#9182)

* bump rasa-sdk dep and min compat version

* fix bug add tests

* add changelog

* change test cases

* remove test cases

* prepared release of version 2.8.1 (#9183)

* update rasa-sdk

* prepared release of version 2.8.1

* update lock

* Make UnexpecTEDIntentPolicy compatible with E2E data (#9203)

* bump rasa-sdk dep and min compat version

* add test and code

* add changelog and refactor method

* add test

* more test cases

* use applied_events

* 2.8.x: Remove experimental feature warning for story validation and entity roles and groups (#9237)

* I removed the experimental feature designation from the docs.

* I removed the entity roles and groups experimental feature warning message from the code, and tested it using 'rasa train' on a minimal example.

* I removed the unused import: rasa.shared.utils.common

* Adding change log files for issues 8791 and 8024.

* Rewording change logs to make it clear that the behaviour of the features remains unchanged.

* prepared release of version 2.8.2 (#9262)

* prepared release of version 2.8.2

* Updated the date of release.

* install yarn dependency in cloned repository, in docs publication workflow

* silence yarn warning

* Fix typo in push_docs_to_branch.sh

* Generated a new poetry lock file

Co-authored-by: Joe Juzl <joejuzl@gmail.com>
Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
Co-authored-by: Daksh Varshneya <d.varshneya@rasa.com>
Co-authored-by: m-vdb <m.verger@rasa.com>
ErickGiffoni pushed a commit to FGA-GCES/rasa that referenced this pull request Aug 31, 2021
* Add ability to point to a certificate in endpoints.yml (RasaHQ#9118)

* Add cert file functionality to Endpoint

* Apply suggestions from code review

types

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* update changelog

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* Fix epoch override for TEDPolicy (RasaHQ#9182)

* bump rasa-sdk dep and min compat version

* fix bug add tests

* add changelog

* change test cases

* remove test cases

* prepared release of version 2.8.1 (RasaHQ#9183)

* update rasa-sdk

* prepared release of version 2.8.1

* update lock

* Make UnexpecTEDIntentPolicy compatible with E2E data (RasaHQ#9203)

* bump rasa-sdk dep and min compat version

* add test and code

* add changelog and refactor method

* add test

* more test cases

* use applied_events

* 2.8.x: Remove experimental feature warning for story validation and entity roles and groups (RasaHQ#9237)

* I removed the experimental feature designation from the docs.

* I removed the entity roles and groups experimental feature warning message from the code, and tested it using 'rasa train' on a minimal example.

* I removed the unused import: rasa.shared.utils.common

* Adding change log files for issues 8791 and 8024.

* Rewording change logs to make it clear that the behaviour of the features remains unchanged.

* prepared release of version 2.8.2 (RasaHQ#9262)

* prepared release of version 2.8.2

* Updated the date of release.

* install yarn dependency in cloned repository, in docs publication workflow

* silence yarn warning

* Fix typo in push_docs_to_branch.sh

* Generated a new poetry lock file

Co-authored-by: Joe Juzl <joejuzl@gmail.com>
Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
Co-authored-by: Daksh Varshneya <d.varshneya@rasa.com>
Co-authored-by: m-vdb <m.verger@rasa.com>
ErickGiffoni pushed a commit to FGA-GCES/rasa that referenced this pull request Sep 9, 2021
* Add ability to point to a certificate in endpoints.yml (RasaHQ#9118)

* Add cert file functionality to Endpoint

* Apply suggestions from code review

types

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* update changelog

Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>

* Fix epoch override for TEDPolicy (RasaHQ#9182)

* bump rasa-sdk dep and min compat version

* fix bug add tests

* add changelog

* change test cases

* remove test cases

* prepared release of version 2.8.1 (RasaHQ#9183)

* update rasa-sdk

* prepared release of version 2.8.1

* update lock

* Make UnexpecTEDIntentPolicy compatible with E2E data (RasaHQ#9203)

* bump rasa-sdk dep and min compat version

* add test and code

* add changelog and refactor method

* add test

* more test cases

* use applied_events

* 2.8.x: Remove experimental feature warning for story validation and entity roles and groups (RasaHQ#9237)

* I removed the experimental feature designation from the docs.

* I removed the entity roles and groups experimental feature warning message from the code, and tested it using 'rasa train' on a minimal example.

* I removed the unused import: rasa.shared.utils.common

* Adding change log files for issues 8791 and 8024.

* Rewording change logs to make it clear that the behaviour of the features remains unchanged.

* prepared release of version 2.8.2 (RasaHQ#9262)

* prepared release of version 2.8.2

* Updated the date of release.

* install yarn dependency in cloned repository, in docs publication workflow

* silence yarn warning

* Fix typo in push_docs_to_branch.sh

* Generated a new poetry lock file

Co-authored-by: Joe Juzl <joejuzl@gmail.com>
Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
Co-authored-by: Daksh Varshneya <d.varshneya@rasa.com>
Co-authored-by: m-vdb <m.verger@rasa.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate possibly incorrect epoch value in _check_evaluation_setting
2 participants