Skip to content

Commit 532aad5

Browse files
authored
Merge branch 'main' into dion/fix-nan-grads
2 parents f5c2946 + d4e1208 commit 532aad5

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Tesseract-JAX
44

5-
`tesseract-jax` executes [Tesseracts](https://github.com/pasteurlabs/tesseract-core) as part of [JAX](https://github.com/jax-ml/jax) programs, with full support for function transformations like JIT, `grad`, and more.
5+
Tesseract-JAX is a lightweight extension to [Tesseract Core](https://github.com/pasteurlabs/tesseract-core) that makes Tesseracts look and feel like regular [JAX](https://github.com/jax-ml/jax) primitives, and makes them jittable, differentiable, and composable.
66

77
[Read the docs](https://docs.pasteurlabs.ai/projects/tesseract-jax/latest/) |
88
[Explore the examples](https://github.com/pasteurlabs/tesseract-jax/tree/main/examples) |
@@ -12,7 +12,16 @@
1212

1313
---
1414

15-
The API of Tesseract-JAX consists of a single function, [`apply_tesseract(tesseract_client, inputs)`](https://docs.pasteurlabs.ai/projects/tesseract-jax/latest/content/api.html#tesseract_jax.apply_tesseract), which is fully traceable by JAX. This enables end-to-end autodifferentiation and JIT compilation of Tesseract-based pipelines.
15+
The API of Tesseract-JAX consists of a single function, [`apply_tesseract(tesseract_client, inputs)`](https://docs.pasteurlabs.ai/projects/tesseract-jax/latest/content/api.html#tesseract_jax.apply_tesseract), which is fully traceable by JAX. This enables end-to-end autodifferentiation and JIT compilation of Tesseract-based pipelines:
16+
17+
```python
18+
@jax.jit
19+
def vector_sum(x, y):
20+
res = apply_tesseract(vectoradd_tesseract, {"a": {"v": x}, "b": {"v": y}})
21+
return res["vector_add"]["result"].sum()
22+
23+
jax.grad(vector_sum)(x, y) # 🎉
24+
```
1625

1726
## Quick start
1827

@@ -31,7 +40,8 @@ The API of Tesseract-JAX consists of a single function, [`apply_tesseract(tesser
3140
2. Build an example Tesseract:
3241

3342
```bash
34-
$ tesseract build examples/simple/vectoradd_jax
43+
$ git clone https://github.com/pasteurlabs/tesseract-jax
44+
$ tesseract build tesseract-jax/examples/simple/vectoradd_jax
3545
```
3646

3747
3. Use it as part of a JAX program via the JAX-native `apply_tesseract` function:

docs/content/get-started.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Get started
22

3-
`tesseract-jax` executes [Tesseracts](https://github.com/pasteurlabs/tesseract-core) as part of JAX programs, with full support for function transformations like JIT, `grad`, `jvp`, and more.
4-
5-
The API of Tesseract-JAX consists of a single function, [`apply_tesseract(tesseract_client, inputs)`](tesseract_jax.apply_tesseract), which is fully traceable by JAX. This enables end-to-end autodifferentiation and JIT compilation of Tesseract-based pipelines.
6-
73
## Quick start
84

95
```{note}
@@ -23,7 +19,8 @@ For more detailed installation instructions, please refer to the [Tesseract Core
2319
2. Build an example Tesseract:
2420

2521
```bash
26-
$ tesseract build examples/simple/vectoradd_jax
22+
$ git clone https://github.com/pasteurlabs/tesseract-jax
23+
$ tesseract build tesseract-jax/examples/simple/vectoradd_jax
2724
```
2825

2926
3. Use it as part of a JAX program:

docs/index.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Tesseract-JAX
22

3-
```{include} content/get-started.md
4-
:start-line: 2
3+
Tesseract-JAX is a lightweight extension to [Tesseract Core](https://github.com/pasteurlabs/tesseract-core) that makes Tesseracts look and feel like regular [JAX](https://github.com/jax-ml/jax) primitives, and makes them jittable, differentiable, and composable.
4+
5+
The API of Tesseract-JAX consists of a single function, [`apply_tesseract(tesseract_client, inputs)`](tesseract_jax.apply_tesseract), which is fully traceable by JAX. This enables end-to-end autodifferentiation and JIT compilation of Tesseract-based pipelines:
6+
7+
```python
8+
@jax.jit
9+
def vector_sum(x, y):
10+
res = apply_tesseract(vectoradd_tesseract, {"a": {"v": x}, "b": {"v": y}})
11+
return res["vector_add"]["result"].sum()
12+
13+
jax.grad(vector_sum)(x, y) # 🎉
514
```
615

16+
Want to learn more? See how to [get started](content/get-started.md) with Tesseract-JAX, explore the [API reference](content/api.md), or learn by [example](demo_notebooks/simple.ipynb).
17+
718
## License
819

920
Tesseract JAX is licensed under the [Apache License 2.0](https://github.com/pasteurlabs/tesseract-jax/LICENSE) and is free to use, modify, and distribute (under the terms of the license).

0 commit comments

Comments
 (0)