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

Max_history parameter should be carried over to the featurizer definition in TEDPolicy #5786

Closed
akelad opened this issue May 7, 2020 · 9 comments · Fixed by #8292
Closed
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/ml/policies Issues focused around rasa's dialogue management policies area:rasa-oss/ml 👁 All issues related to machine learning type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR

Comments

@akelad
Copy link
Contributor

akelad commented May 7, 2020

If you have your configuration defined like this, with the featurizer defined explicitly:

  • name: TEDPolicy
    max_history: 5
    featurizer:
  • name: MaxHistoryTrackerFeaturizer
    state_featurizer:
  • name: LabelTokenizerSingleStateFeaturizer

The max_history parameter won't get carried over to the MaxHistoryTrackerFeaturizer. This is kind of strange behaviour, because if you specify the policy like this:

  • name: TEDPolicy
    max_history: 5

The policy loads up MaxHistoryTrackerFeaturizer internally with max_history: 5.

See forum post for source of confusion: https://forum.rasa.com/t/running-oom-in-tedpolicy-with-900-stories-1-10-0/28230/6

@akelad akelad added type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR area:rasa-oss 🎡 Anything related to the open source Rasa framework labels May 7, 2020
@chkoss
Copy link
Contributor

chkoss commented Jun 11, 2020

Exalate commented:

chkoss commented:

Is this rather an issue for @RasaHQ/production-squad or for research squad?

@wochinge
Copy link
Contributor

wochinge commented Jun 12, 2020

Exalate commented:

wochinge commented:

@Ghostvv Does it actually make sense to do this when we use Genie's featurizer for everything? If this should still be done, then I think we can handle this + I think it's even good if we can get our feet wet with easier issues like this one.

@Ghostvv
Copy link
Contributor

Ghostvv commented Jun 12, 2020

Exalate commented:

Ghostvv commented:

it still makes sense to do, we'll have max_history parameter anyhow

@alwx alwx added area:rasa-oss/ml 👁 All issues related to machine learning area:rasa-oss/ml/policies Issues focused around rasa's dialogue management policies labels Jan 29, 2021
@joaoCeilandia
Copy link
Contributor

joaoCeilandia commented Mar 20, 2021

Exalate commented:

joaoCeilandia commented:

Me and some friends where working on this issue and we found that this behavior happens because when creating a featurizer it is instantiated as a TrackerFeaturizer and when no featurizer is instantiated, it is created as a MaxHistoryTrackerFeaturizer. this code shows this:

So the only way to make max_history be inside the featurizer is by don't instantiating one.

we tought about make a change by our own to try to fix this but as we don't know what is wanted for this issue( e.g. if we could make a non-instanciated featurizer just became a TrackerFeaturizer or make a intanciated one became a MaxHistoryFeaturizer ), we came ask for some directioning.

@akelad @Ghostvv @wochinge @chkoss

@dakshvar22
Copy link
Contributor

dakshvar22 commented May 13, 2021

Exalate commented:

dakshvar22 commented:

@wochinge IMO, the fix here does not solve the problem correctly but is more of a hack. It passes the specified max_history parameter to the policy and relies on the policy to set the max_history of tracker. An easier and more full proof fix of this would be to do this inside get_featurizer_from_dict function in ensemble.py. The real issue is that get_featurizer_from_dict assumes that the dictionary (policy) passed to it contains information for all attributes including max_history. However, for that assumption to be correct from_dict function should add the max_history parameter if specified to the dictionary constructed here. This would simplify the constructor and load methods of policies. What do you think? Should I reopen this issue and put it in enable's inbox?

@wochinge
Copy link
Contributor

wochinge commented May 17, 2021

Exalate commented:

wochinge commented:

However, for that assumption to be correct from_dict function should add the max_history parameter if specified to the dictionary constructed here.

You mean using something like setdefault to avoid overriding any given max_history param? Makes absolutely sense for me 👍🏻

@wochinge wochinge reopened this May 17, 2021
@wochinge wochinge added type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. and removed type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR labels May 17, 2021
@dakshvar22
Copy link
Contributor

dakshvar22 commented May 25, 2021

Exalate commented:

dakshvar22 commented:

Also, please let research team know once the issue is closed as there are[ bits of code in policies|

# More context here - https://github.com/RasaHQ/rasa/issues/5786#issuecomment-840762751
] which will simplify once this is in place.

@stale
Copy link

stale bot commented Jan 9, 2022

Exalate commented:

stale[bot] commented:

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 9, 2022
@wochinge wochinge removed the stale label Jan 14, 2022
@rasabot-exalate rasabot-exalate added area:rasa-oss :ferris wheel: area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-oss/ml 👁 All issues related to machine learning and removed 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 area:rasa-oss/ml 👁 All issues related to machine learning area:rasa-oss :ferris wheel: labels Mar 17, 2022 — with Exalate Issue Sync
@m-vdb m-vdb added the type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR label Oct 7, 2022
@m-vdb m-vdb removed the priority:low label Dec 7, 2022
@sync-by-unito
Copy link

sync-by-unito bot commented Dec 19, 2022

➤ Maxime Verger commented:

💡 Heads up! We're moving issues to Jira: https://rasa-open-source.atlassian.net/browse/OSS.

From now on, this Jira board is the place where you can browse (without an account) and create issues (you'll need a free Jira account for that). This GitHub issue has already been migrated to Jira and will be closed on January 9th, 2023. Do not forget to subscribe to the corresponding Jira issue!

➡️ More information in the forum: https://forum.rasa.com/t/migration-of-rasa-oss-issues-to-jira/56569.

@m-vdb m-vdb closed this as completed Jan 9, 2023
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 area:rasa-oss/ml/policies Issues focused around rasa's dialogue management policies area:rasa-oss/ml 👁 All issues related to machine learning type:enhancement ✨ Additions of new features or changes to existing ones, should be doable in a single PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants