Symbolic parametric CAD value kernel with reverse-mode autodiff
Project description
cadmea
Cadmea is currently a symbolic parametric CAD kernel prototype. The packaged Python surface contains fixed-size symbolic values, reverse-mode autodiff, and a small optimizer layer.
Current Python API
import math
import cadmea as cd
x = cd.Parameter(0.2, name="x")
opt = cd.optim.Adam([x], lr=0.02)
for _ in range(520):
residual = cd.sin(x) - 0.5
loss = residual * residual
opt.zero_grad()
loss.backward()
opt.step()
assert abs(math.sin(x.value[0]) - 0.5) < 1e-8
The active value model is:
Constant: fixed scalar/vec1, vec2, vec3, or vec4 value.Parameter: user-owned differentiable input.Undefined: solver-owned unknown placeholder with optional hint.Expression: derived symbolic value.
Constructors infer dimension from arguments:
radius = cd.Parameter(15.0)
center = cd.Parameter(10.0, 20.0)
origin = cd.Constant(0.0, 0.0)
unknown = cd.Undefined(hint=(0.0, 0.0))
packed = cd.vec2(radius, cd.sin(radius))
Reverse-mode differentiation currently supports arithmetic, unary negation,
sin, and cos. Gradients accumulate on Parameter leaves:
w = cd.Parameter(190.0)
h = cd.Parameter(240.0)
area = w * h
area.backward()
assert w.grad == (240.0,)
assert h.grad == (190.0,)
Optimizers live under cadmea.optim:
SGDRMSPropAdamAdamWAdagrad
Optimizers mutate only Parameter values. They do not assign Undefined
values and are separate from the future sketch constraint solver.
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 Distributions
Built Distributions
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 cadmea-0.1.0-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17c66010e676805cbd5d9be11b49958ee3371d15042faedc5b2cefb102544a1
|
|
| MD5 |
e3cbf8e93f8e8fe5a177ec774e89b6f2
|
|
| BLAKE2b-256 |
625d64349adf0777ff940dfc553c228e30b28258c3aa484f86889a7e62137adc
|
File details
Details for the file cadmea-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 198.3 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b1f2ad0ef672bed034bcbf33d3aa7e4d2fc677109154b0ffc42732211aedffa
|
|
| MD5 |
3e6062266ad4ffcd3f0d2c184399039b
|
|
| BLAKE2b-256 |
64e8b7e12823e08821041c6cb07c92fbe87c99863ceb67f0757be880812b59c4
|
File details
Details for the file cadmea-0.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 187.2 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e0c87800a0f50a54a382908fcfc356d1f7f03e4e603fdd640badc499996cec1
|
|
| MD5 |
353ba7406d2fbba77bd699aab11e3d48
|
|
| BLAKE2b-256 |
332b25a12c23ccee1113b9c1e2933a0113334615b2daacc44b10003a5e97c5e8
|
File details
Details for the file cadmea-0.1.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e074d9246d44850ede1bcc1be1938c0b91f2fec550aae2b3efb955fd328f4c0
|
|
| MD5 |
097cd8d86eeb33087f5598302ff028a9
|
|
| BLAKE2b-256 |
c819d4f4e18395f95bfa81efa0fba64fcff64c87a5abd313626a739f05af92e1
|
File details
Details for the file cadmea-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 198.2 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a34bfbecf23dc6449fb72c6adfb2658cfdb433fbc5600745b359d42fb7741d3
|
|
| MD5 |
557ec770e238bdc09077ff3951c39b6c
|
|
| BLAKE2b-256 |
a3717ce8b85711139a5d77e6f8e17f9dc7dfd91471e8ca2c10b771e3b1b54afd
|
File details
Details for the file cadmea-0.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 186.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
594d8b0aeb8fbf48cfa157ff86076375f9fe1b47f79383785cf8b5a11bd9ec7c
|
|
| MD5 |
c97f7ead82f05055eb0ebfc22cb05fdf
|
|
| BLAKE2b-256 |
9433af98c4f622ba25b48ab551bbc7309f3ad16809f5d5ccde3ae46626e825d3
|
File details
Details for the file cadmea-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26b56c92fc5326a7550a96ad7ea719f5335bb80ceae4592ac35018e8f92f7bbb
|
|
| MD5 |
fe7e3d907e0ef57c0437f532e98f52b8
|
|
| BLAKE2b-256 |
62f47353d009c532b7c14d3758a37de2f7a4a056a434b1f7ed62216c3c142415
|
File details
Details for the file cadmea-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 198.2 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74c8f56b4aa7380b141d7b434cb06ad5b1d9c914d79dd9a43b163540161a55e4
|
|
| MD5 |
6b1854fd45343226672629fa3dd5c595
|
|
| BLAKE2b-256 |
8f32e9bb8c1057d506d56af13da8fdf298876044a78b1ca5ec1cbb822d7bdfe2
|
File details
Details for the file cadmea-0.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 186.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3aa74011c7c0f007335a34f05c5cf9175df256ea4102c1eb394f3ac0ae0b25b
|
|
| MD5 |
c7c36a05388ee5252b064f69f4cb6b3a
|
|
| BLAKE2b-256 |
4bbbd2937a51ddc289387b6cca32312d405983dba80f2cc09db714a4735153f1
|
File details
Details for the file cadmea-0.1.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a9191ee43e335a004818ae556350f95b002f288bcedd7e86ecb1e21bff1e95c
|
|
| MD5 |
eb932782e8b40ab219564611fe4c6741
|
|
| BLAKE2b-256 |
727747e7b46c7a3ebe73c572400c4eb4434c9914153142adcd6ebf51ff39f5c9
|
File details
Details for the file cadmea-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 198.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76785613e2c2a095b61f5b9d251915880ee2876346276ed0335c43a5a6b63507
|
|
| MD5 |
253687327af746906dece8f31e60af57
|
|
| BLAKE2b-256 |
3df500c40e88cc1cda8c6ccd27c4e6a712cfe7f5fca28676090afc52bed4e718
|
File details
Details for the file cadmea-0.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 187.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fae35904e4261bb83f75a0899144f79e014e2a69008ae98d818c4921a469899c
|
|
| MD5 |
f19038405618922cc0bbdf86f2caab59
|
|
| BLAKE2b-256 |
028888d8b22981f35496110c041f83df6cccced3338ccf5972c6fad1378712d7
|
File details
Details for the file cadmea-0.1.0-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5ef18492e8c00425ab22883cc94280b41c86c10a7adbed2964d5f7aa1e400d0
|
|
| MD5 |
d932e5ce2fff877fb7cf4dd3f8337694
|
|
| BLAKE2b-256 |
4d49c4213b32564e31b43138f1aaa77a907c21bcbd3659651975ef7c954548f5
|
File details
Details for the file cadmea-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
- Upload date:
- Size: 197.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b99821dd3e52f8ec5fb83c076f95df958ecc3b60ba4ec849f37710693c4c88f
|
|
| MD5 |
e27627d1f0e7b881711f63aa3d7da7be
|
|
| BLAKE2b-256 |
35d955af3c9281f0b2cc9379c6377805bf45e90f073f8b9fed5b9b235fd0f5a6
|
File details
Details for the file cadmea-0.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.
File metadata
- Download URL: cadmea-0.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
- Upload date:
- Size: 186.0 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37a31bb36cc219cf687dab5a9263b54e1d1ee5839cb643af335a19f99a46e75f
|
|
| MD5 |
7a87619c7c74e1e380ce3a79517f4e56
|
|
| BLAKE2b-256 |
24f4bd511b86e09e6f4cae6bbbfe09dee06ae95b2c9717af42f4707704a1615f
|