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

Make one hot encoder serialisable #880

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

uri-granta
Copy link
Collaborator

@uri-granta uri-granta commented Oct 11, 2024

Related issue(s)/PRs:

Summary

Quick fix to allow one hot encoders to be serialised. Further investigation will happen as part of #304.

(Note that second change to tf.debugging in encoder doesn't seem to be necessary for the serialisation to work, but is included for consistency.)

Fully backwards compatible: yes / no

PR checklist

  • The quality checks are all passing
  • The bug case / new feature is covered by tests
  • Any new features are well-documented (in docstrings or notebooks)

Copy link

@qiq208 qiq208 left a comment

Choose a reason for hiding this comment

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

awesome, thanks!!

@avullo
Copy link
Collaborator

avullo commented Oct 11, 2024

Awesome 2. Out of curiosity, why tf debugging work?

@uri-granta uri-granta merged commit dbb7d46 into develop Oct 11, 2024
12 checks passed
@uri-granta uri-granta deleted the uri/hotfix/make_one_hot_encoder_serialisable branch October 11, 2024 10:08
@uri-granta
Copy link
Collaborator Author

The problem is that raise gets called when you compile the function, not when you run it. Meanwhile tf.debugging.assert is similar to tf.print in that it's intended for runtime. That said, I still haven't found a clear description of the best practice re exceptions (will investigate as part of #304).

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.

3 participants