Comments (2)
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.
Closing due to inactivity. If anyone would like to work on this, feel free to re-open!
from flax.
Related Issues (20)
- Error when calling `Module.tabulate` on normalization wrappers like `WeightNorm` and `SpectralNorm`
- Orbax checkpoint for LogicallyPartitioned params HOT 2
- For some reason these imports are elided on read the docs HOT 1
- Using variable declared at a broader scope in a function is bad form HOT 1
- Add `BatchRenorm` layer to `linen.normalization`
- GroupedConv distributed training failure
- In `MultiHeadAttention`, let `num_heads=1` by default
- Documentation/notebook errors HOT 2
- Remove `tree_map` deprecation filter after Flax upgrades minimum Python version to 3.10
- Unpickled modules with constructor arguments cannot be initialized
- Improve SEO for docs pages HOT 2
- Add ability to easily change documentation version
- Problem while using checkpoints.restore_checkpoint with gradio HOT 1
- nnx static fields not part of static tree structure HOT 1
- nn.remat_scan doesn't work with nn.with_partitioning HOT 1
- No way to call nnx.State.from_flat_path HOT 5
- Tutorial request HOT 2
- with_partitioning has surprising behavior with MultiHeadAttention and DenseGeneral HOT 1
- nnx.graph.split infinite recursion when used in a thread HOT 3
- Documentation links 404 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flax.