Giter VIP home page Giter VIP logo

Comments (6)

SuryanarayanaY avatar SuryanarayanaY commented on April 28, 2024

Hi @AGFACBNNR ,

Thanks for reporting. I have checked and acknowledge the reported behaviour. The code works fine with Keras2 but has inconsistent behaviour with Keras3. Attached keras2-gist and keras3-gist for reference.

As per documentation the inputs should be:

inputs: A 1D or 2D tensor of integer inputs.

The behaviour as follows:

# rank-0 Tensor & output_mode='multi_hot'   --> Different results wrt Keras2 & 3
# rank-1 Tensor & output_mode='multi_hot'   --> Same results wrt Keras2 & 3
# rank-2 Tensor & output_mode='multi_hot'   --> Same results wrt Keras2 & 3

# rank-0 Tensor & output_mode='one_hot'     --> Different results wrt Keras2 & 3
# rank-1 Tensor & output_mode='one_hot'     --> Different results wrt Keras2 & 3
# rank-2 Tensor & output_mode='one_hot'     --> Same results wrt Keras2 & 3

IMO, This behaviour of Keras3 should be consistent with keras2. Looking for probable fix.

from tensorflow.

SuryanarayanaY avatar SuryanarayanaY commented on April 28, 2024

Update: Since Keras3 supports multi backend the Keras3(TF backend) behaviour is different wrt Keras2(TF backend) but inline with Torch and Jax.

But there is issue with compute_output_shape method with below cases which is not same as actual output shape:

# rank-0 Tensor input & output_mode='multi_hot'
# rank-0 Tensor input & output_mode='one_hot'
# rank-1 Tensor input & output_mode='one_hot'

I am going to propose a fix for same. Thanks!

from tensorflow.

SuryanarayanaY avatar SuryanarayanaY commented on April 28, 2024

Shall be addressed in Keras PR-19388

from tensorflow.

SuryanarayanaY avatar SuryanarayanaY commented on April 28, 2024

Hi @AGFACBNNR ,

The proposed PR got merged into master. Could you please test in Keras-nightly and let us know. Thanks!

from tensorflow.

AGFACBNNR avatar AGFACBNNR commented on April 28, 2024

I've tested it in Keras-nightly. Thanks a lot.

from tensorflow.

google-ml-butler avatar google-ml-butler commented on April 28, 2024

Are you satisfied with the resolution of your issue?
Yes
No

from tensorflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.