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

CategoryEncoding generate output with wrong shape when output_mode='one_hot' and the last dim is 1 #19724

Open
AGFACBNNR opened this issue May 17, 2024 · 1 comment
Assignees
Labels

Comments

@AGFACBNNR
Copy link

As shown in this colab, when output_mode='one_hot' and the last dim is 1, as described in Keras 3 Doc,

If the last dimension is size 1, will encode on that dimension.

The compute_output_shape() generate a correct static shape, while the output actually is generated by appending a new dimension for the encoded output, which is different from the documents.

Currently the output is:
1715927195410

I've tried it on tensorflow and jax backend and got the same result.
The results in line 1 of output shows the symptom I described above.

@SuryanarayanaY
Copy link
Collaborator

Hi @AGFACBNNR ,

I have replicated the issue and observed the discrepancy wrt actual output shape and shape from compute_output_shape method. Attached gist for reference.

Need to dig more and comeback. Thanks!

Grvzard added a commit to Grvzard/keras that referenced this issue Jun 1, 2024
…Flow backend (keras-team#19724)

Make it consistent with the behavior of the NumPy backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants