jaxtyping
diffrax
jaxtyping | diffrax | |
---|---|---|
8 | 23 | |
1,305 | 1,519 | |
5.1% | 4.3% | |
8.2 | 8.5 | |
1 day ago | 12 days ago | |
Python | Python | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
jaxtyping
-
Python type hints may not be not for me in practice
You want runtime typechecking.
See either beartype [1] or typeguard [2]. And if you're doing any kind of array-based programming (JAX or not), then jaxtyping [3].
[1] https://github.com/beartype/beartype/
[2] https://github.com/agronholm/typeguard
[3] https://github.com/patrick-kidger/jaxtyping
-
Writing Python like it's Rust
Try using [jaxtyping](https://github.com/google/jaxtyping).
It also supports numpy/pytorch/etc.
-
Writing Python like it’s Rust
Since you mention ML use-cases, you might like jaxtyping.
-
Scientific computing in JAX
jaxtyping: rich shape & dtype annotations for arrays and tensors (also supports PyTorch/TensorFlow/NumPy);
-
[D] Have their been any attempts to create a programming language specifically for machine learning?
Heads-up that my newer jaxtyping project now exists.
-
Returning to snake's nest after a long journey, any major advances in python for science ?
As other folks have commented, type hints are now a big deal. For static typing the best checker is pyright. For runtime checking there is typeguard and beartype. These can be integrated with array libraries through jaxtyping. (Which also works for PyTorch/numpy/etc., despite the name.)
- Type annotations and runtime checking for shape and dtype
diffrax
-
An Introduction to Neural Ordinary Differential Equations [pdf]
Did you use https://github.com/patrick-kidger/diffrax ?
-
Bridging numerical relativity and automatic differentiation using JAX
Compute the Christoffel symbols for a metric and solve the geodesic equation to find the EOM using automatic differentation powered differential equation solvers, such as diffrax
- Ask HN: What side projects landed you a job?
-
[P] Optimistix, nonlinear optimisation in JAX+Equinox!
Optimistix has high-level APIs for minimisation, least-squares, root-finding, and fixed-point iteration and was written to take care of these kinds of subroutines in Diffrax.
-
Show HN: Optimistix: Nonlinear Optimisation in Jax+Equinox
Diffrax (https://github.com/patrick-kidger/diffrax).
Here is the GitHub: https://github.com/patrick-kidger/optimistix
The elevator pitch is Optimistix is really fast, especially to compile. It
-
Scientific computing in JAX
Sure. So I've got some PyTorch benchmarks here. The main take-away so far has been that for a neural ODE, the backward pass takes about 50% longer in PyTorch, and the forward (inference) pass takes an incredible 100x longer.
-
[D] JAX vs PyTorch in 2023
FWIW this worked for me. :D My full-time job is now writing JAX libraries at Google. Equinox for neural networks, Diffrax for differential equation solvers, etc.
-
Returning to snake's nest after a long journey, any major advances in python for science ?
It's relatively early days yet, but JAX is in the process of developing its nascent scientific computing / scientific machine learning ecosystem. Mostly because of its strong autodifferentiation capabilities, excellent JIT compiler etc. (E.g. to show off one of my own projects, Diffrax is the library of diffeq solvers for JAX.)
-
What's the best thing/library you learned this year ?
Diffrax - solving ODEs with Jax and computing it's derivatives automatically functools - love partial and lru_cache fastprogress - simpler progress bar than tqdm
-
PyTorch 2.0
At least prior to this announcement: JAX was much faster than PyTorch for differentiable physics. (Better JIT compiler; reduced Python-level overhead.)
E.g for numerical ODE simulation, I've found that Diffrax (https://github.com/patrick-kidger/diffrax) is ~100 times faster than torchdiffeq on the forward pass. The backward pass is much closer, and for this Diffrax is about 1.5 times faster.
It remains to be seen how PyTorch 2.0 will compare, or course!
Right now my job is actually building out the scientific computing ecosystem in JAX, so feel free to ping me with any other questions.
What are some alternatives?
torchtyping - Type annotations and dynamic checking for a tensor's shape, dtype, names, etc.
tiny-cuda-nn - Lightning fast C++/CUDA neural network framework
plum - Multiple dispatch in Python
juliaup - Julia installer and version multiplexer
pytype - A static type analyzer for Python code
deepxde - A library for scientific machine learning and physics-informed learning
madtypes - Python Type that raise TypeError at runtime
Optimization.jl - Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.
flax - Flax is a neural network library for JAX that is designed for flexibility.
MindsDB - AGI's query engine - Platform for building AI that can learn and answer questions over federated data.
StatsBase.jl - Basic statistics for Julia