Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Add training date and time to policy metadata when persisting Fixes #1104 #1108

Merged
merged 5 commits into from
Oct 2, 2018

Conversation

MetcalfeTom
Copy link
Contributor

@MetcalfeTom MetcalfeTom commented Oct 1, 2018

  • fixes #1104

Proposed changes:

  • Added date to _persist_metadata() function of base policy ensemble

Status (please check what you already did):

  • made PR ready for code review
  • updated the changelog

@MetcalfeTom MetcalfeTom requested a review from ricwo October 1, 2018 20:15
@MetcalfeTom MetcalfeTom changed the title Add training date and time to policy metadata upon persisting. Fixes #1104 Add training date and time to policy metadata when persisting Fixes #1104 Oct 1, 2018
Copy link
Contributor

@ricwo ricwo left a comment

Choose a reason for hiding this comment

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

left two comments / suggestions. looks good otherwise 👍

@@ -123,7 +126,8 @@ def _persist_metadata(self, path, dump_flattened_stories=False):
"python": ".".join([str(s) for s in sys.version_info[:3]]),
"max_histories": self._max_histories(),
"ensemble_name": self.__module__ + "." + self.__class__.__name__,
"policy_names": policy_names
"policy_names": policy_names,
"trained_at": self.date_trained
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just use the timestamp at persistence time as this happens right after actual training? in some sense the persist() method completes the training. in that case we wouldn't need the self.date_trained attribute

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'm not sure. I agree that persist completes the training but having it inside the training function ensures that the time is logged as it is described (in case the script in question doesn't follow .train() with .persist() immediately after).

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, but that's very much a special case. either way works, really

rasa_core/policies/ensemble.py Outdated Show resolved Hide resolved
@MetcalfeTom MetcalfeTom merged commit f22a888 into master Oct 2, 2018
@MetcalfeTom MetcalfeTom deleted the date-in-persist-metadata branch October 2, 2018 11:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants