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

Add loss attribute for backward compatibility #813

Merged
merged 2 commits into from
Aug 30, 2023

Conversation

haifeng-jin
Copy link
Collaborator

@haifeng-jin haifeng-jin requested a review from fchollet August 29, 2023 20:53
@@ -18,6 +18,7 @@ def __init__(self):
self._run_eagerly = False
self._jit_compile = None
self.compiled = False
self.loss = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be None no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

None is the signature default so it's much more sensible than an empty dicts (loss can be a dict but it's not a common case).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to None.

@haifeng-jin haifeng-jin requested a review from fchollet August 29, 2023 23:02
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@fchollet fchollet merged commit 15f1b33 into keras-team:main Aug 30, 2023
@haifeng-jin haifeng-jin deleted the bug3 branch September 14, 2023 22:55
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.

2 participants