A functional language for differentiable programming
Project description
Sheaf is a functional language for differentiable computation. It is inspired by Clojure and is designed to operate within the Python/JAX machine learning ecosystem.
Sheaf has three main goals:
- Clojure Paradigm: Homoiconicity (code is data), immutability and minimalist syntax for differentiable computation.
- Native XLA Performance: Sheaf code runs on GPUs/TPUs through JAX. Models can self-evolve without stopping the JIT engine.
- Seamless Interop with Python: Compiled to pure JAX functions natively callable from Python.
Sample code:
(defn transformer-block [x layer-p config]
(as-> x h
(-> h ;; 1. Self-Attention
(layer-norm (get layer-p :ln1) 2)
(multi-head-attention layer-p config)
(first) ;; Attention output
(+ h)) ;; Residual 1
(-> h ;; 2. MLP
(layer-norm (get layer-p :ln2) 2)
(mlp (get layer-p :mlp))
(+ h)))) ;; Residual 2
Python interoperability
from sheaf import Sheaf
shf = Sheaf("mlp.shf")
for x, y in zip(X, shf.forward(X, params)):
print(f" {x} -> {y[0]:.3f}")
-
Website
-
Reference documentation
-
Quick Start guide
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sheaf_lang-1.1.0.tar.gz.
File metadata
- Download URL: sheaf_lang-1.1.0.tar.gz
- Upload date:
- Size: 50.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97c9d50c418859570b70b944522fab39b0dfa1783fcea8a17263f1a605c382b3
|
|
| MD5 |
8f239f6463c1bf9346e415c0a84835d0
|
|
| BLAKE2b-256 |
98a6012d1fe37269df29b04323d24bea32468335b5d2e93d6c3afa184ab630e7
|
File details
Details for the file sheaf_lang-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sheaf_lang-1.1.0-py3-none-any.whl
- Upload date:
- Size: 58.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07024d1681fff743d7fba7159e2682742d71bf5d769eba84a013aefacd13e566
|
|
| MD5 |
8fd282de988bf01f5bddb5536ece23c6
|
|
| BLAKE2b-256 |
3ee8f4295fe99519ed0410e783a4bbdc1420b1a27bef8d2cefedbe710797cc12
|