Giter Site home page Giter Site logo

Comments (2)

levskaya avatar levskaya commented on May 21, 2024

Yeah, currently the model forcibly casts vocab data as int32 type. We could be more strict and issue a warning instead (there is a type check in the embedding layer).

Out of vocab is trickier - we can't raise exceptions easily (or at all) on accelerators, so out-of-bounds access silently clamps. There is discussion in JAX to instead emit NaNs for out-of-bounds access which would error-out harder.
eg.

jnp.take(jnp.array([[1.0,0.0,0.0],[0.0,1.0,0.0],[0.0,0.0,1.0]]), 
         jnp.array([0,1,2,3,4]), 
         axis=0)
# DeviceArray([[1., 0., 0.],
#              [0., 1., 0.],
#              [0., 0., 1.],
#              [0., 0., 1.],
#              [0., 0., 1.]], dtype=float32)

Thanks for raising the issue vis-a-vis the updated TFDS API - this loader dates back to before the new api existed, I've filed a separate issue #138 to review and update this in all of our examples.

I'll investigate the final issue, but I somewhat doubt it makes much difference given that the tfds datasets are set up as a lazy streams, rather than actually loading much on construction.

from flax.

marcvanzee avatar marcvanzee commented on May 21, 2024

Closing due to inactivity. If anyone would like to work on this, feel free to re-open!

from flax.

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.